[PLUG] Understanding Networking Components
Mike Connors
mconnors1 at gmail.com
Mon Apr 2 12:26:18 UTC 2012
>
> Please explain to me how the ethernet interface could interfere with the
> wireless interface. I must be missing something critical here because
> they're on different interfaces (eth0 and wlan0), and while both are UP,
> only one is RUNNING.
>
> Thanks,
>
> Rich
>
There can be more than 1 default route in the routing table. This often the
done in a mult-nic configuration as each ip network will have a gateway of
last resort.
The problem here is that your route table has cached the default route for
eth0, eth0 is not connected to any network and that interface is being
preferred either based on metric or just because that interface is listed
in the routing table first based on alphanumeric sequence. Which when I
statically configure eth0 on the same ip net as wlan0, my routing table now
shows eth0 default route listed first...
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0
eth0
0.0.0.0 10.0.0.1 0.0.0.0 UG 0 0 0
wlan0
The routing table makes the decision on which interface to send packets out
based on metrics. If the default route for eth0 is lower than wlan0 than
that's the interface the routing table sends the packets to. I'm not sure
if metrics are assigned automatically in sequential order by interface name
such that eth0 would always have a lower metric than wlan0.
I did some of my own testing and here's what I've discovered.
1. I added a static ip addr stanza for eth0 to /etc/network/interfaces and
then brought up eth0 without it being physically connected.
~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:58:82:11:2e
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
Here's the routing table w. 2 default routes on different nets with both
Default Routes have a metric of 0:
:~# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
Iface
10.0.0.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 10.0.0.1 0.0.0.0 UG 0 0
0 wlan0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0
0 eth0
Traceroute shows packets are being routed out wlan0 interface:
:~# traceroute www.google.com
traceroute to www.google.com (74.125.127.104), 30 hops max, 60 byte packets
1 10.0.0.1 (10.0.0.1) 2.000 ms 1.997 ms 2.060 ms
2 * * *
3 te-0-0-0-6-ur03.troutdale.or.bverton.comcast.net (68.85.150.177)
10.373 ms 16.574 ms 17.475 ms
So, it seems you have a stale route table cache entry for eth0 that is
buggering up your routing.
I suspect if you run a traceroute you'll see packets attempting to go via
eth0?
What happens if you run this command to flush the routing table cache and
then connect to the wlan?
"ip route flush scope global type unicast"
Oddly enough, even with 2 default routes on the same ip net, packets are
still be routed through wlan0. I didn't expect this to be the case. Maybe
the superior intelligence of Debian? ;-P
:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use
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
:~# traceroute google.com
traceroute to google.com (173.194.33.38), 30 hops max, 60 byte packets
1 10.0.0.1 (10.0.0.1) 0.930 ms 1.703 ms 2.005 ms
2 * * *
3 te-0-0-0-6-ur03.troutdale.or.bverton.comcast.net (68.85.150.177)
17.533 ms 17.687 ms 17.684 ms
4 be-1-ur04.troutdale.or.bverton.comcast.net (68.85.243.170) 17.422 ms
ae-4-0-ar03.beaverton.or.bverton.comcast.net (68.
Cheers,
Mike
More information about the PLUG
mailing list