diff --git a/docs/MultiISP.xml b/docs/MultiISP.xml index fcc5285f4..4b722548e 100644 --- a/docs/MultiISP.xml +++ b/docs/MultiISP.xml @@ -640,14 +640,22 @@ place to start. + The script should be copied to a directory on root's PATH such as + /usr/local/sbin/. + The script monitors two interfaces but it is a trivial exercise to extend it to more than two. At the top are a number of variables to set: - # The commands to run when the status of a line changes. Both commands will be executed. + # +# IP family -- 4 or 6 # -COMMAND1= -COMMAND2="ip -4 route ls" +FAMILY=4 +# +# The commands to run when the status of a line changes. Both commands will be executed. +# +COMMANDA= +COMMANDB="ip -$FAMILY route ls" ... # # Interfaces to monitor -- you may use shell variables from your params file @@ -676,7 +684,7 @@ UP_COUNT=5 # DOWN_COUNT=2 - If you leave COMMAND1 empty, the script sets its value + If you leave COMMANDA empty, the script sets its value automatically depending on whether Shorewall-lite is installed. When the status of an interface changes: @@ -722,11 +730,28 @@ return $status on OpenSuSE 11.0 -- YMMV. Modify the PROG and STATEDIR variables as needed. + As an alternative to using the init script, you can add the + following to /etc/shorewall/started: + + if [ "$COMMAND" = start ]; then + killall -9 swping 2> /dev/null #be sure that there are none left running + /usr/local/sbin/swping & +fi + + and add this to + /etc/shorewall/stopped. + + if [ "$COMMAND" = stop -o "$COMMAND" = clear ]; then + killall -9 swping 2> /dev/null +fi + This simple script has a number of limitations: - It only works on IPv4 (but is easy to modify for IPv6) + It only works on IPv4 or IPv6 but not both at once. So if you + want to monitor both IPv4 and IPv6, you need to clone the script are + run two copies; one for IPv4 and one for IPv6. @@ -744,7 +769,7 @@ return $status - It is tricky to configure a system such that a system works + It is tricky to configure a system such that the system works correctly when one of its providers is down unless you largely don't care which interface is used.