- Timestamp:
- May 2, 2012, 10:11:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/releng-9.0/nanobsd/files/tools/sync-fib-tables
r10647 r10652 7 7 SRC=${1:-0} 8 8 DST=${2:-1} 9 setfib $DST route -qn flush && setfib $SRC netstat -nr | grep -v 'default' | awk '/UGD/ {print "setfib '"$DST"' route -q add "$1" "$2}' | sh10 9 10 # Flush all routes and make sure to re-apply gateway (if existed) 11 gateway=`setfib $DST route -n get default | route -n get default | awk '/gateway:/ {print $2}'` 12 setfib $DST route -qn flush 13 [ -n "$gateway" ] && setfib $DST route -qn add default $gateway 14 15 # Hack to sync remaining dynamic routes 16 setfib $SRC netstat -nr -f inet | grep -v 'default' | awk '/UGD/ {print $1" "$2}' | while read tgt gw; do 17 setfib $DST route -qn add $tgt $gw 18 done 19 20 21
Note:
See TracChangeset
for help on using the changeset viewer.