summaryrefslogtreecommitdiffstats
path: root/retiolum/scripts/tinc_setup
diff options
context:
space:
mode:
authortv <tv@also>2011-11-10 00:35:24 +0100
committertv <tv@also>2011-11-10 00:35:24 +0100
commit30ec5d0a41d162ebe89a5cff44e12f3153d21fe0 (patch)
tree2a438100ddbbdafe33c79a2995d3442d478cf7ec /retiolum/scripts/tinc_setup
parent36e21625a382bdf08249b4e50dea6ad4ecccbb24 (diff)
//retiolum tinc-up: use iproute2 only
Diffstat (limited to 'retiolum/scripts/tinc_setup')
-rwxr-xr-xretiolum/scripts/tinc_setup/tinc-up16
1 files changed, 7 insertions, 9 deletions
diff --git a/retiolum/scripts/tinc_setup/tinc-up b/retiolum/scripts/tinc_setup/tinc-up
index 44dc0516..1a04706a 100755
--- a/retiolum/scripts/tinc_setup/tinc-up
+++ b/retiolum/scripts/tinc_setup/tinc-up
@@ -8,14 +8,12 @@ name=`sed -n 's|^ *Name *= *\([^ ]*\) *$|\1|p' $conf`
host=$dirname/hosts/$name
-prefix4=8
-route4=42.0.0.0/$prefix4
-addr4=`sed -n 's|^ *Subnet *= *\(42\.[^ /]*\)\(/[^ ]*\)\? *$|\1|p' $host`
+addr4=`sed -n 's|^ *Subnet *= *\(42[.][^ ]*\) *$|\1|p' $host`
+ip -4 addr add $addr4 dev $INTERFACE
+ip -4 route add 42.0.0.0/8 dev $INTERFACE
-route6=42::/16
-addr6=`sed -n 's|^ *Subnet *= *\(42:[^ ]*\) *$|\1|p' $host`
-
-ifconfig $INTERFACE up $addr4/$prefix4
-route add -net $route4 dev $INTERFACE
+addr6=`sed -n 's|^ *Subnet *= *\(42[:][^ ]*\) *$|\1|p' $host`
ip -6 addr add $addr6 dev $INTERFACE
-ip -6 route add $route6 dev $INTERFACE
+ip -6 route add 42::/16 dev $INTERFACE
+
+ip link set $INTERFACE up