Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
powder-vpn
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
David Johnson
powder-vpn
Commits
b0a29950
Commit
b0a29950
authored
Aug 24, 2018
by
David Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More bugfixes.
parent
8f0b2869
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
10 deletions
+22
-10
bin/setup-vpn.sh
bin/setup-vpn.sh
+22
-10
No files found.
bin/setup-vpn.sh
View file @
b0a29950
...
...
@@ -241,14 +241,14 @@ EOF
cat
<<
EOF
> /etc/openvpn/clients/
$node
-route-up.sh
#!/bin/sh
VNODES=
`/usr/local/etc/emulab/tmcc vnodelist | sed -nre 's/^VNODEID=(pcvm[0-9]*-[0-9]*) .*
$/
\1
/p' | xargs
`
for vnode in
$VNODES
; do
VTAG=
`/usr/local/etc/emulab/tmcc -n
$vnode
ifconfig | sed -nre 's/^.* LAN=
$agglan
.*VTAG=([0-9]*).*
$/
\1
/p'
`
if [ -n "
$VTAG
" ]; then
VNODES=
\`
/usr/local/etc/emulab/tmcc vnodelist | sed -nre 's/^VNODEID=(pcvm[0-9]*-[0-9]*) .*
$/
\1
/p' | xargs
\
`
for vnode in
\
$
VNODES ; do
VTAG=
\`
/usr/local/etc/emulab/tmcc -n
$vnode
ifconfig | sed -nre 's/^.* LAN=
$agglan
.*VTAG=([0-9]*).*
$/
\1
/p'
\
`
if [ -n "
\
$
VTAG" ]; then
break;
fi
done
if [ -z "
$VTAG
" ]; then
if [ -z "
\
$
VTAG" ]; then
echo "ERROR: fatal: could not find bridge for
$agglan
"
exit 1
fi
...
...
@@ -259,26 +259,38 @@ ip rule add from $agg_cidr table $aggprefix
ip rule add iif tun-
$aggprefix
to
$agg_cidr
table
$aggprefix
ip route add
$mlan_CIDR
via
$VPN_SERVER
dev tun-
$aggprefix
table
$aggprefix
ip route add 192.168.0.0/16 via
$VPN_SERVER
dev tun-
$aggprefix
table
$aggprefix
ifconfig br
$VTAG
$agg_gw
netmask
$agg_mask
up
ip route add
$agg_cidr
dev br
$VTAG
table
$aggprefix
ifconfig br
\
$
VTAG
$agg_gw
netmask
$agg_mask
up
ip route add
$agg_cidr
dev br
\
$
VTAG table
$aggprefix
EOF
chmod
755 /etc/openvpn/clients/
$node
-route-up
.sh
cat
<<
EOF
> /etc/openvpn/clients/
$node
-route-down.sh
#!/bin/sh
VNODES=
\`
/usr/local/etc/emulab/tmcc vnodelist | sed -nre 's/^VNODEID=(pcvm[0-9]*-[0-9]*) .*
$/
\1
/p' | xargs
\`
for vnode in
\$
VNODES ; do
VTAG=
\`
/usr/local/etc/emulab/tmcc -n
$vnode
ifconfig | sed -nre 's/^.* LAN=
$agglan
.*VTAG=([0-9]*).*
$/
\1
/p'
\`
if [ -n "
\$
VTAG" ]; then
break;
fi
done
if [ -z "
\$
VTAG" ]; then
echo "ERROR: fatal: could not find bridge for
$agglan
"
exit 1
fi
ip rule del from
$agg_cidr
table
$aggprefix
ip rule del iif tun-
$aggprefix
to
$agg_cidr
table
$aggprefix
ip route flush table
$aggprefix
ifconfig br
$VTAG
0 up
ifconfig br
\
$
VTAG 0 up
EOF
chmod
755 /etc/openvpn/clients/
$node
-route-down
.sh
#
# Ok, copy the key/crts/conf files to the agg host
#
rsync
-avz
-o
StrictHostKeyChecking
=
no
\
scp
-p
-o
StrictHostKeyChecking
=
no
\
/etc/openvpn/ca.crt
$KEY_DIR
/
$node
*
$fqdn
:
$OURDIR
rsync
-avz
-o
StrictHostKeyChecking
=
no
\
scp
-p
-o
StrictHostKeyChecking
=
no
\
/etc/openvpn/clients/
$node
*
$fqdn
:
$OURDIR
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment