Re: What happens if there are two interfaces?

On 12/31/2012 05:44 AM, Timothy Murphy wrote:
Nathanael Noblet wrote:

"ip route" just tells me both interfaces are up,
not which one is being used.
Even "ifconfig", which gives the number of packets
passing through each interface,
is not completely conclusive.

ip route on my machine gives:
default via dev wlan0  proto static dev wlan0  proto kernel  scope link  src

Which means wlan0 is the default route. Everything goes out that way.

Yes, thanks for that observation -
I had overlooked the fact that "ip route" (and "route")
specify a default interface.

However, this doesn't completely answer the question.
You appear to have only one interface active,
so naturally all packets must go that way.
I assume that is the situation with most people most of the time.

It does answer the question. Here's a more complex ip route output on one of my machines dev tun0  proto kernel  scope link  src via dev tun0 dev eth1  proto kernel  scope link  src via dev tun0 dev eth0  proto kernel  scope link  src dev eth1  scope link
default via dev eth0

Two physical interfaces, one tunnel with multiple networks.

An internal network of all traffic goes out eth1
The tunnel (tun0) will get traffic destined for, and The internal interface also has a link local / avahi / bonjour browsing connection.
Everything that doesn't match that goes out the default connection.

My experience with 2 interfaces active, say WiFi and ethernet,
does not entirely fit in with your theory,
as ifconfig shows a large number of packets
going through each interface.
I'll experiment further and see more exactly what happens.

I would also expect that packets on a wireless network continuously rise for protocol / AP whatever reasons. Even if *data* wasn't going out.

The fact of the matter is ip route tells you exactly what you need to answer the question you asked.

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