2011-03-03 10:41:05 -07:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
|
|
|
exec 2>&1
|
|
|
|
|
2011-11-05 17:40:14 -06:00
|
|
|
echo 8192 > /proc/sys/net/ipv6/neigh/default/gc_thresh3
|
|
|
|
echo 4096 > /proc/sys/net/ipv6/neigh/default/gc_thresh2
|
|
|
|
|
2011-09-22 18:32:03 -06:00
|
|
|
PFX=fd84:b410:3441
|
2011-07-28 18:07:55 -06:00
|
|
|
|
2011-10-19 16:16:57 -06:00
|
|
|
log () {
|
|
|
|
echo "router: $@"
|
|
|
|
echo "router: $@" > /dev/console
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ $(mount | grep -c /opt/) -gt 1 ]; then
|
|
|
|
log "cannot run alongside other packages" > /dev/console
|
|
|
|
exit 1
|
|
|
|
fi
|
2011-09-23 16:04:25 -06:00
|
|
|
|
2011-10-19 16:16:57 -06:00
|
|
|
|
|
|
|
# I'm a router
|
|
|
|
hostname router
|
2011-09-23 16:04:25 -06:00
|
|
|
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding
|
2011-07-28 18:07:55 -06:00
|
|
|
|
2011-09-22 18:32:03 -06:00
|
|
|
# Bring up main ethernet interface
|
|
|
|
ip addr add $PFX:0::1/64 dev eth0
|
2011-03-03 10:41:05 -07:00
|
|
|
ip link set eth0 up
|
|
|
|
|
2011-09-22 18:32:03 -06:00
|
|
|
# Bring up vlans
|
2011-07-28 18:07:55 -06:00
|
|
|
for i in $(seq 24); do
|
2011-03-03 10:41:05 -07:00
|
|
|
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
|
2011-03-03 10:41:05 -07:00
|
|
|
ip link set eth0.$i up
|
|
|
|
done
|
|
|
|
|
2012-02-01 17:11:46 -07:00
|
|
|
# Subnet route for SNL at TF4
|
2012-01-31 10:50:42 -07:00
|
|
|
ip route add fd80:1::/48 via fd84:b410:3441:24::2
|
|
|
|
|
2011-03-03 10:41:05 -07:00
|
|
|
sleep 8100d
|