Sometimes you do not need complex scripts or hacks. You just want Ubuntu to behave like a grown-up laptop: when Ethernet is plugged in, use it. When you unplug, fall back to Wi-Fi.
The good news: if you use NetworkManager (which Ubuntu does by default), you can solve this by adjusting connection priorities. No cronjobs, no dispatcher scripts, no extra packages.
What this does (and what it does not)
With connection priorities you are not “turning Wi-Fi off”. Instead, you are telling Ubuntu:
- Ethernet should always be preferred when it is available.
- Wi-Fi is still your backup connection.
- When Ethernet disconnects, Wi-Fi can reconnect automatically.
This is perfect if you dock your laptop at home or at the office and you want a stable connection without thinking about it.
A real use case
My typical workflow looks like this:
- Laptop on Wi-Fi while moving around the house, working from the couch, or grabbing coffee.
- Then I drop it on a desk dock or plug in a cable for calls, uploads, or anything that benefits from stability.
- Without priorities, the machine might keep Wi-Fi connected anyway (and sometimes even keep routing traffic through it resulting in slower connection speeds).
- With priorities set, Ethernet takes over immediately, and I stop wondering why my “wired” connection still feels like Wi-Fi.
How to set it up
First, list your connection profiles:
nmcli connection show
Now set a low priority for your Wi-Fi connection:
nmcli connection modify "YOUR_WIFI_NAME" connection.autoconnect yesnmcli connection modify "YOUR_WIFI_NAME" connection.autoconnect-priority -999
And set a high priority for your wired connection:
nmcli connection modify "YOUR_WIRED_NAME" connection.autoconnect yes
nmcli connection modify "YOUR_WIRED_NAME" connection.autoconnect-priority 999
If you want to apply it right away, reconnect:
nmcli connection down "YOUR_WIFI_NAME" 2>/dev/nullnmcli connection up "YOUR_WIRED_NAME"
Notes and tips
- If you have multiple Wi-Fi profiles (home + office), repeat the Wi-Fi command for each profile.
- These are just numbers: higher wins. I use 999 and -999 because it makes the intent obvious.
- This keeps Wi-Fi available as a fallback, which is exactly what you want on a laptop.
The result
From now on, plugging in Ethernet becomes a silent upgrade. Ubuntu will prefer the wired network automatically, and when you unplug, Wi-Fi can take over without drama.
If you are like me and you want fewer surprises in your work setup, this is a tiny tweak that pays off every single day.



Leave a Reply