[PLUG] Understanding Networking Components [SOLVED]

Mike Connors mconnors1 at gmail.com
Tue Apr 3 19:33:32 UTC 2012


>
>   Running 'ifconfig -a' showed routes for both eth0 and wlan0, but only the
> latter was RUNNING. So, as root, I ran 'ifconfig eth0 down' to remove the
> routes and ... voila! That was the problem.
>
>     Now, what I'd like from you networking gurus is a script I can put in
> rc.local to test if wlan0 is RUNNING. And, if it is, to take down eth0.
> This
> way eth0 is taken out of the stack when the system boots and dhcpcd sees a
> WAP, but otherwise it is turned on and RUNNING to use the attached cable.
>

I'm glad to hear you got this sorted out. If the interface is down (not
running) any routes for that interface should not be included in the
routing table. Which is what confused me and why I thought you had a stale
route table cache entry.

I cannot get my eth0 to go in / out of the "running" state by running ifup
/ ifdown, although it works with the loopback interface.

Also, two default routes on the same network and I have no problems.

:~# netstat -r
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt
Iface
10.0.0.0        *               255.255.255.0   U         0 0          0
wlan0
10.0.0.0        *               255.255.255.0   U         0 0          0
eth0
default         10.0.0.1        0.0.0.0         UG        0 0          0
eth0
default         10.0.0.1        0.0.0.0         UG        0 0          0
wlan0

So if the only difference between your two laptops in terms of wireless, is
the radio and more importantly the driver. Which you had problems with
previously. I'm inclined to believe that driver is not functioning the way
it should be.

It shouldn't be in a "running" state unless there is physical connectivity
and packets are flowing across the interface.

As for the script idea, why not just remove the "allow-hotplug eth0"
statement from your /etc/network/interfaces file

allow-hotplug eth0
iface eth0 inet dhcp

"When the Linux kernel detects the physical interface eth0, the *
allow-hotplug* stanza causes ifup to bring up the interface."

That should keep the interface down and trouble free. Then just plug in the
cable and "ifup eth0".



More information about the PLUG mailing list