How to disable wifi when connected to ethernet?

I can't find a way to do it it settings.
Is there a command(s) to do this in terminal?

Hi, welcome to the forums!

There's a toggle on the top right corner under Settings -> Wi-Fi:

You can also disable a specific interface by running a terminal command:

  1. Find out the network interfaces available:

    nmcli dev
    
  2. Disable a network interface:

    nmcli dev down <interface_name>
    

    sc2

    You'd use up to enable the interface, instead.

I think ethernet takes preference so you don't really need to disable the wireless if you don't want to, unless you are somehow concerned for some other reason. It's possible to setup an automatic script so that Wi-Fi is enabled whenever you disconnect from ethernet, and vice-versa:

https://wiki.archlinux.org/title/NetworkManager#Use_dispatcher_to_automatically_toggle_wireless_depending_on_LAN_cable_being_plugged_in

1 Like

Thank you zenzen! Actually Thank you 2X!
My intention/question was not correctly expressed, since what I wanted was to avoid wireless connectivity if the cable was connected without having to enable disable manually... but you answered my question when you pointed me to the wiki.archlinux.org portal and use the network manager dispatcher (1st thank you) and the 2nd thank you is ... showing me the wealth of information in that site that I've never heard of!

2 Likes

I don't know if it is still a security issue but when I was working for a local government IT section the head of IT advised me that if I saw one of his desktops using a dial-up modem and also had an ethernet connection to pull out the ethernet cable due to potential security of the network being compromised!

Yeah, the Arch Linux wiki is one of the most extensive knowledge bases for Linux. Enjoy!