Ubuntu – How to tell whether your computer is using wifi or ethernet to access the internet


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?

Best Answer

  • 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

  • Related Question