D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Detect if ethernet device is plugged in, multiple redudant routing

 

Hi.. 

How about "ip route"

you can set gateway metric. 

I used to set up this option when I had NAT, I had two ADSL line 

so If one line isn't work, gateway and routeing table disappeard automatically. 

So I can use next line without disconnecting 


-----Original Message-----
From: list-bounces@xxxxxxxxxxxxx [mailto:list-bounces@xxxxxxxxxxxxx]On Behalf Of 
Simon Williams
Sent: Tuesday, June 20, 2006 8:57 PM
To: list@xxxxxxxxxxxxx
Subject: [LUG] Detect if ethernet device is plugged in, multiple redudant routing


I have a laptop.
It has ethernet and wireless. It also has a pcmcia ethernet card, irda, 
usb and serial network connections, but those should be ignored for this.

When the ethernet is plugged in, it should use that. If it isn't then it 
should try the wireless.

The problem is that if both devices are up, the one which was activated 
first always gets all the traffic, even if it's not actually got a 
connection (no ethernet cable, or wireless out of range).

Since the ethernet card is always activated first on boot, I have so far 
been manually taking it up and down when connecting and disconnecting 
the lan cable.

I'm sure Linux can do better than this, so...

Does anyone know if there is some program, ifconfig option, driver 
extension or file in /sys or /proc that will tell me whether or not an 
ethernet device is plugged in to something?

I've googled and looked around my system, but I can't find anything.

Alternatively, how do I say- when sending a packet go through the 
routing table like normal, but if the first route you find doesn't work 
then try the next one. Then remember that and try the first route only 
every 10 seconds or so until it works again (so that it doesn't try the 
first one for every single packet).


Thanks in advance
Simon

-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html
-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html