I have a fresh install of Ubuntu Server 20.04.1 on a Raspberry Pi 3 B+

I initially set it up connected via WiFi. I now plugged in an ethernet cable but I'm unsure how to tell which is currently the active connection via the command line. I'd prefer to disable the WiFi and have a wired connection.

I'd also like to know how to re-enable WiFi in the future in case I ever disconnect the cable.

I ran ifconfig -a and see the output for both eth0 and wlan0

  • Please edit Your question and add output of the command ifconfig -a. The interface currently being used should have UP,RUNNING in the flags section of the output. Jan 15, 2021 at 0:19
  • Both eth0 and wlan0 show UP,RUNNING in the flags section. Jan 15, 2021 at 0:22
  • Edited to include the ifconfig output Jan 15, 2021 at 0:24
  • Try route command and see which interface is marked as default link. Jan 15, 2021 at 0:28
  • Ahh thanks for that command. It's eth0. I also added an answer for a solution using network-manager. Jan 15, 2021 at 0:31

2 Answers 2


I believe I found a solution. I installed network-manager via apt and ran:

nmcli radio wifi off

And to turn back on:

nmcli radio wifi on

Since both wired and WiFi can be connected at the same time, you should ask the system which one it's sending packets through with

ip route

Read man ip ip-route.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.