Modifiche a rc.local di Scooreggione

Rispetto al file rc.local fornito di default con scooreggione sono state apportate le diverse modifiche:

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.

#110 Local routes
#111 RtTable
#112 RtTableDefault
#113 Special Table for /1
#114 blackholes table

#Copy local routes only from table main 254 to table 110
ip route show table 254 | grep -Ev ^default | grep -Ev ^blackhole | while read ROUTE ; do
MASK=`echo "${ROUTE}" | awk '{print $1}' | awk -F/ '{print $2}'`
if [ "$MASK" -ne 16 ] ; then
ip route add table 110 $ROUTE
fi
done

#First evaluate local routes
ip rule add from all lookup 110 pref 3
#La rotta della vpn sta nella main
ip rule add to 10.150.254.0/24 table main pref 3

#Private routes to OLSR table
ip rule add to 10.0.0.0/8 table 111 pref 4
ip rule add to 172.16.0.0/12 table 111 pref 4
ip rule add to 192.168.0.0/16 table 111 pref 4


#Evaluate blackholes
ip rule add from all table 114 pref 5

#Lookup default route first from user and then from OLSR
ip rule add from all lookup 254 pref 7
ip rule add from all lookup 112 pref 8

#Blackhole private aggregates
ip route add blackhole 10.0.0.0/8 table 114
ip route add blackhole 172.16.0.0/12 table 114
ip route add blackhole 192.168.0.0/16 table 114


exit 0