moth/packages/router/service/router/run

24 lines
399 B
Plaintext
Raw Normal View History

#! /bin/sh -e
exec 2>&1
hostname router
2011-09-22 18:32:03 -06:00
PFX=fd84:b410:3441
2011-09-22 18:32:03 -06:00
# We're a router
echo 1 > /proc/sys/net/ipv6/conf/default/forwarding
2011-09-22 18:32:03 -06:00
# Bring up main ethernet interface
ip addr add $PFX:0::1/64 dev eth0
ip link set eth0 up
2011-09-22 18:32:03 -06:00
# Bring up vlans
for i in $(seq 24); do
ip link add link eth0 name eth0.$i type vlan id $i
2011-09-22 18:32:03 -06:00
ip addr add $PFX:$i::1/64 dev eth0.$i
ip link set eth0.$i up
done
sleep 8100d