Re: Multi-ISP with one Dynamic IP

Russel
2006-03-27T22:05:19Z

>> I have two feeds, one with a static IP and one with a dynamic IP. How
>> can I configure a Multi-ISP setup with the dynamic IP, or can I? I
>> don''t
>> think the gateway will change, just the interface IP.
>
>What about restarting Shorewall through a dhclient-exit-hooks script?
>Every
>time dhclient runs, it checks for the presence of an exit-hooks script
>and
>runs it, passing the script certain variables.  The script can check
>the
>"reason" variable to decide if your IP address has changed and
decide
>whether or not to restart Shorewall.  You can also use the same
>technique to
>re-run ddclient, thus avoiding keeping ddclient running as a daemon.
>
>I say that all this is possible, but I lack the skills to write an
>example
>script that actually works.  If I ever get a working sample, I''ll
post
>it,
>but that''s a low priority for me now.

I said it was a low priority for me to do this, but I''ve looked at some
examples and read a bit of documentation.  After doing some testing,
this is what works for me:

# /etc/dhcp3/dhclient-exit-hooks.d/shorewallrestart

echo `date`: Running dhclient on $interface - reason is $reason\
        >> /tmp/shorewallrestart.debug
if [ x$reason = xRENEW ] || [ x$reason = xREBIND ]; then
        echo Restarting shorewall, ddclient, and openvpn\
                >> /tmp/shorewallrestart.debug
        /sbin/shorewall restart
        /usr/sbin/ddclient
        /etc/init.d/openvpn restart
fi
echo ''------------------------------------'' >>
/tmp/shorewallrestart.debug

# end of script

Suggested improvements are welcome.
-Russel