diff --git a/routing/interfaces b/routing/interfaces new file mode 100644 index 0000000..9ae14b7 --- /dev/null +++ b/routing/interfaces @@ -0,0 +1,32 @@ +# This file describes the network interfaces available on your system +# and how to activate them. For more information, see interfaces(5). + +# The loopback network interface +auto lo +iface lo inet loopback + +# The routes added here will not be visible to the 'route' command; you +# should use 'ip route show table foo' instead. + +auto eth0 +iface eth0 inet static + address 129.97.134.42 + netmask 255.255.255.0 + gateway 129.97.134.1 + up ip rule add from all lookup campus prio 1 + down ip rule del from all lookup campus prio 1 + up ip rule add from all lookup orion prio 2 + down ip rule del from all lookup orion prio 2 + up ip route add 129.97.0.0/16 via 129.97.134.1 dev eth0 table campus realm campus + down ip route del 129.97.0.0/16 via 129.97.134.1 dev eth0 table campus realm campus + up ip route add 10.0.0.0/8 via 129.97.134.1 dev eth0 table campus realm campus + down ip route del 10.0.0.0/8 via 129.97.134.1 dev eth0 table campus realm campus + up ip route add 172.16.0.0/20 via 129.97.134.1 dev eth0 table campus realm campus + down ip route del 172.16.0.0/20 via 129.97.134.1 dev eth0 table campus realm campus + up ip route add 192.168.0.0/16 via 129.97.134.1 dev eth0 table campus realm campus + down ip route del 192.168.0.0/16 via 129.97.134.1 dev eth0 table campus realm campus + +auto eth0:mirror +iface eth0:mirror inet static + address 129.97.134.71 + netmask 255.255.255.0 diff --git a/orionroutes.py b/routing/orionroutes.py similarity index 98% rename from orionroutes.py rename to routing/orionroutes.py index 22674e5..2126cb9 100755 --- a/orionroutes.py +++ b/routing/orionroutes.py @@ -1,5 +1,8 @@ #!/usr/bin/python +# This file updates the orion routing table. +# Put it at /usr/local/sbin/orionroutes.py + # Configuration ORION_TABLE = 1 # from /etc/iproute2/rt_tables ORION_REALMS = 1 # from /etc/iproute2/rt_realms diff --git a/routing/setup-routing b/routing/setup-routing new file mode 100644 index 0000000..199636d --- /dev/null +++ b/routing/setup-routing @@ -0,0 +1,10 @@ +# This file configures the packet scheduler + +tc qdisc del dev eth0 parent root +tc qdisc add dev eth0 parent root handle 1: htb default 2 r2q 10000 +tc class add dev eth0 parent 1: classid 1:1 htb rate 1000Mbit +tc class add dev eth0 parent 1:1 classid 1:2 htb rate 100Mbit +tc class add dev eth0 parent 1:1 classid 1:3 htb rate 200Mbit +tc class add dev eth0 parent 1:1 classid 1:4 htb rate 700Mbit ceil 1000Mbit +tc filter add dev eth0 parent 1: protocol ip pref 2 route to orion flowid 1:3 +tc filter add dev eth0 parent 1: protocol ip pref 1 route to campus flowid 1:4 diff --git a/routing/update-orion-routes b/routing/update-orion-routes new file mode 100755 index 0000000..394745e --- /dev/null +++ b/routing/update-orion-routes @@ -0,0 +1,6 @@ +#!/bin/bash + +# This file updates the orion routing table. +# Put it at /usr/local/sbin/update-orion-routes. + +wget --quiet -O - http://noc.uwaterloo.ca/~ns-owner/ext-routes.txt | /usr/local/sbin/orionroutes.py