On 06/21/07 02:46, Russell Stuart wrote:
Well, it may be that you are connected to the modem by Ethernet, but
that doesn't mean you can't arrange to know if the link is up or
down.
If you are familiar with Cisco, there is a physical link, and a protocol
link. I'm ending with an (physical link) Up / (protocol down) Down
scenario, which can not be detected by Linux's device state.
For DSL, you can run PPPoE on your Linux box. That way you will know
when your link is down because the PPPoE connection dies, taking all
routes with it. I do this. It works. In the case of a cable modem
you can request a short dhcp-lease-time (see the option of that name
in dhcp-options(5)) which achieves the same thing. This is by far
the best solution because it reacts quickly, and altering of the
routing table happens automagically as the links go up and down.
Ugh! Besides the fact that this is not possible (in my scenario) it is
in my opinion, EXTREMELY sub-optimal. Don't even get me started on
PPPoE. There is also the fact that the DHCP leases would have to be
sub-minute in length to even remotely come close to working for this.
Assuming this isn't possible for some reason the only other way to do
this is manually. Ie, you monitor the link somehow. There are any
number of ways you can do this. One nice way is use Nagios to
monitor the link. This is nice because Nagios can do things when the
link goes down and comes back up again - like altering your routing
table. Nagios is also good because it allows for some hysteresis, ie
waiting for a few failed pings before taking action. And it can
report what happened by SMS or whatever. There are a lot of Nagios
type monitoring systems out there, maybe you use one. Failing a home
baked shell script will work just as well. It would just use say:
ping -n -q -c 1 -w 120 -i 20 -I a.d.d.r next.hop.addr in a continuous
loop to verify the link is up.
Double Ugh! Why do I need to implement a daemon to do this when just
about every other OS that I work with will purportedly do this its self.
Linux can purportedly do this too supposedly with Dead Gateway
Detection and / or Equal Cost Multipath Routing or some combination
there of.
No, I feel like there is a way to do this, I'm just over looking it. If
I do need to go back to this method, I'll completely re-design what
needs to be done or switch to a different router OS (Free/Net BSD?) to
do this.
Finally, be careful in how you set up your routing. You want to
avoid asymmetric routing, and that will happen by default when
someone connects to your backup link unless you take special steps to
avoid it.
Actually, asymmetric routes are what I want to use in the event traffic
does go to the backup route while the primary is up and running.
Keep in mind that no one will be connecting to any of the IP addresses
assigned to the router (save for router management) but rather the
globally routable IP addresses in the DMZ behind said router.
Grant. . . .
_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc