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 192.168.4.1 dev wlan0  proto static
192.168.4.0/24 dev wlan0  proto kernel  scope link  src 192.168.4.103

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

10.8.0.2 dev tun0  proto kernel  scope link  src 10.8.0.1
192.168.4.0/24 via 10.8.0.2 dev tun0
10.0.0.0/24 dev eth1  proto kernel  scope link  src 10.0.0.1
10.8.0.0/24 via 10.8.0.2 dev tun0
24.72.122.0/24 dev eth0  proto kernel  scope link  src 24.72.122.184
169.254.0.0/16 dev eth1  scope link
default via 24.72.122.1 dev eth0


Two physical interfaces, one tunnel with multiple networks.

An internal network of 10.0.0.0/24 all traffic goes out eth1
The tunnel (tun0) will get traffic destined for 192.168.4.0/24, and 10.8.0.0/24 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]