I have eth0 and wlan0 according to ifconfig and I can ping google.com. How can I find out (with a normal user, not root) what interface is active, as in, what interface did the ping (or whatever, ping is not mandatory) use?NOTE: using Ubuntu 11.04 or Fedora 14
How to find out which interface am I using for connecting to the internet?
linux;routing
You can use route to find your default route:$ routeKernel IP routing tableDestination     Gateway         Genmask         Flags Metric Ref    Use Iface192.168.1.0     *               255.255.255.0   U     1      0        0 eth0link-local      *               255.255.0.0     U     1000   0        0 eth0default         192.168.1.1     0.0.0.0         UG    0      0        0 eth0The Iface column in the line with destination default tells you which interface is used.