While running Ubuntu 14.04, my laptop has both its Wifi turned on with a saved wireless network in range, and an ethernet cable plugged in (which leads to a Devolo homeplug from the same network). If I click the "Up/Down" button at the top right of the main screen, both have a "Disconnect" option below them, so that I can't tell which one the computer is using to connect to the internet.

Short of disabling the wifi or disconnecting the ethernet cable, is there any 'programmatic' method to determine how the computer is connected to the internet?

2 Answers 2


If you use the command route there will be and entry in the table with the value 'Default' or '' as destination field, then the 'Iface' field will be the interface (Ethernet or wifi) your computer is using to reach the internet.


$ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface U 0 0 0 eth0 UG 0 0 0 eth0


I use conky for this purpose. It shows live information about all the interfaces on your computer. This is a screeshot from my computer and as you can see on the right side(the red and green graphs) are all the interfaces my PC has.

You can install conky with

sudo apt-get install conky

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .