# /etc/network/routes # LEG19032005 # IP=ip #IP=echo # functions to block bogon networks source /etc/network/bogons # Documentation: # # routes adds/removes complicated routes when ifup/down-ing an # interface. To use it, you put: # # up rtconfig # down rtconfig # # To the respective iface stanza in the interfaces(5) file. # # For each interface, say myif, you want to control with this file # write a shell function named: rt_myif. rt_myif is called with # either add or del as argument, you have to add or delete the desired # routes respectively # # Example: # # function rt_myif () { # route $1 -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1 # } # More complex examplo # # #function rt_myif () { # # $1 = add|del # #SRCROUTES="172.19.155.32/27 172.19.155.128/27" #DSTROUTES="172.19.154.0/24 172.21.0.0/16" #IIFACE=eth3 #DSTTABLE=rt_table_special # #for dstrt in $DSTROUTES; do # $IP route $1 $dstrt dev $IFACE table $DSTTABLE #done # #for srcrt in $SRCROUTES; do # for dstrt in $DSTROUTES; do # $IP rule $1 from $srcrt to $dstrt iif $IIFACE table $DSTTABLE # done #done # #}