diff options
author | tv <tv@iiso> | 2011-11-09 23:58:06 +0100 |
---|---|---|
committer | tv <tv@iiso> | 2011-11-09 23:58:06 +0100 |
commit | 36e21625a382bdf08249b4e50dea6ad4ecccbb24 (patch) | |
tree | 5d375f6358b81690a3ad58e4eb994c12bb495e47 | |
parent | 44a6e46c1f134a548dff6c71d245e1b793e80d6b (diff) |
//retiolum tinc-up: fix ipv4 netmask
-rwxr-xr-x | retiolum/scripts/tinc_setup/tinc-up | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/retiolum/scripts/tinc_setup/tinc-up b/retiolum/scripts/tinc_setup/tinc-up index b1a705b1..44dc0516 100755 --- a/retiolum/scripts/tinc_setup/tinc-up +++ b/retiolum/scripts/tinc_setup/tinc-up @@ -8,13 +8,14 @@ name=`sed -n 's|^ *Name *= *\([^ ]*\) *$|\1|p' $conf` host=$dirname/hosts/$name -route4=42.0.0.0/8 -addr4=`sed -n 's|^ *Subnet *= *\(42\.[^ ]*\) *$|\1|p' $host` +prefix4=8 +route4=42.0.0.0/$prefix4 +addr4=`sed -n 's|^ *Subnet *= *\(42\.[^ /]*\)\(/[^ ]*\)\? *$|\1|p' $host` route6=42::/16 addr6=`sed -n 's|^ *Subnet *= *\(42:[^ ]*\) *$|\1|p' $host` -ifconfig $INTERFACE up $addr4 +ifconfig $INTERFACE up $addr4/$prefix4 route add -net $route4 dev $INTERFACE ip -6 addr add $addr6 dev $INTERFACE ip -6 route add $route6 dev $INTERFACE |