[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: laptop environment detection



On October 15, 2002 02:27 am, you wrote:
> also sprach Bruce <bestb@sympatico.ca> [2002.10.15.0725 +0200]:
<snip>
> > I am really looking for a program that can figure out automatically
> > whether I am using the wired or wireless adaptor in my laptop (usually to
> > the same network), and make the connection accordingly.
>
> you should be able to identify the adapter by MAC address, no?

Not sure what you mean; wouldn't the MAC addresses only be useful for 
identifying oneself to the server?? The server doesn't care which adaptor I 
am using.

By the way, my wired interface is pci, the wireless is pcmcia.

> i think they both work, but each has registered a default route.
> insert them both and show me the output of /sbin/route -n after some
> seconds.

Only the first interface brought up seems to work. With both interfaces down, 
I can pump -i eth0, then pump -i wlan0. Both will report IP addresses, and 
route -n gives the following:

 debian:/home/bruce# route -n
 Kernel IP routing table
 Destination   Gateway       Genmask         Flags Metric Ref    Use Iface
 192.168.1.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
 192.168.1.0   0.0.0.0         255.255.255.0   U     0     0        0 wlan0
 0.0.0.0          192.168.1.1  0.0.0.0             UG   0      0        0 eth0
 debian:/home/bruce#

I figured out that only eth0 has a connection by unplugging each of the 
interfaces and trying to ping the gateway . 

If I do the opposite, i.e. bring up wlan0 first, then eth0, I get:

 debian:/home/bruce# route -n
 Kernel IP routing table
 Destination     Gateway         Genmask       Flags Metric Ref  Use Iface
 192.168.1.0     0.0.0.0         255.255.255.0  U     0      0     0 wlan0
 192.168.1.0     0.0.0.0         255.255.255.0  U     0      0     0 eth0
 0.0.0.0         192.168.1.1     0.0.0.0            UG    0      0     0 wlan0
 debian:/home/bruce#

and now only wlan0 has a connection.

In order to switch interfaces, in other words, I have to first bring down the 
currently active one.

Bruce



Reply to: