Have you ever been in the middle of a download, a Zoom call, or watching a video when your internet just… vanishes? Then you check, and NetworkManager (NMS) has quietly slipped offline. Again. It’s frustrating, and you’re not alone. Thousands of Linux users bump into this issue daily. But what causes it? And how do we fix it?
Let’s break it down in a fun, simple, and very human way.
What Is NetworkManager (NMS) Anyway?
NetworkManager is the part of Linux that handles your network connections. Think of it as the “air traffic controller” for your Wi-Fi and Ethernet. It decides which network to connect to, how to connect, and when to switch.
But sometimes, this friendly controller gets confused. It may drop the ball (your connection), and you’re suddenly off the grid.
Why Does NMS Keep Dropping the Connection?
Here are some common reasons:
- Weak Wi-Fi Signal: Your device may be too far from the router.
- NetworkManager Conflicts: Too many network interfaces confuse NMS.
- Driver Issues: The drivers for your wireless card might be outdated or buggy.
- Automatic Suspend: Your laptop suspends the Wi-Fi card to save power.
- AP Scanning: Constant scanning for better networks causes drops.
- Roaming Aggressively: Switching between networks without stability checks.
Don’t worry. We’re going to tackle these one at a time and show you how to fix them.
1. Check Your Signal Strength
This one’s easy. If the Wi-Fi signal is weak, connections may drop. NMS does its job, but the signal isn’t constantly there to hold on to.
Try this:
- Move closer to your router.
- Avoid walls, microwaves, and large metal objects.
- Switch to the 2.4 GHz band for longer range, or 5 GHz for speed (but watch the range).
If things improve, you’ve found your problem.
2. Stop NMS From Roaming Wildly
By default, NMS might aggressively switch networks when it thinks another one looks better. This can cause sudden disconnects or lag.
Here’s how to calm it down:
Open a terminal and run:
nmcli device wifi list
Then connect with care:
nmcli device wifi connect YOUR_NETWORK_NAME password YOUR_PASSWORD
After that, you can lock onto this network and prevent hopping by editing its configuration in:
/etc/NetworkManager/system-connections/
Set:
wifi.scan-rand-mac-address=no
and disable roaming with:
802-11-wireless.mac-address=YOUR_MAC
802-11-wireless.mac-address-blacklist=
This keeps the NMS loyal to your chosen Wi-Fi.
3. Tame Power Saving Settings
Your system might turn off the Wi-Fi card to save battery. It seems helpful — until your Zoom call suddenly drops.
To disable this feature:
- Open a terminal.
- Run:
sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf - Set or change this line to:
wifi.powersave = 2
Then save and restart NetworkManager:
sudo systemctl restart NetworkManager
Now your Wi-Fi won’t play dead to save some battery juice.
4. Update or Switch Your Drivers
Drivers help your OS talk to your hardware. If your Wi-Fi drivers are outdated or buggy, expect drops.
Check your driver:
lshw -C network
Or even:
lspci -k | grep -A 3 -i network
Then look up your wireless chipset. Visit your distro’s wiki or forums and check what others with your card are using.
Sometimes swapping to a better-supported open-source driver (like iwlwifi or ath9k) works wonders.
5. Tell NetworkManager to Chill on Scans
NMS likes to keep checking for better signals. It’s like it’s always got one foot out the door. But you can stop it from constantly scanning and interfering with your existing connection.
Create or edit this file:
/etc/NetworkManager/conf.d/disable-autoscan.conf
Add this:
[device]
wifi.scan-rand-mac-address=no
[connection]
wifi.cloned-mac-address=preserve
Then restart the service again:
sudo systemctl restart NetworkManager
This tells NMS: “Relax. You’re on a good network. Don’t keep looking around.”
6. Turn Off IPv6 (Sometimes)
Sometimes NMS struggles with IPv6 on certain routers. Turning it off might stabilize the connection.
- Go to your network settings (GUI or terminal with
nmcli). - Edit your network profile.
- Set IPv6 to “Ignore”.
Restart your device or reconnect, and test again.
7. Use Static IP (Advanced But Useful)
Dynamic IP addresses change often. If there’s a hiccup in that process, your connection might drop. Setting a static IP removes that uncertainty.
Edit your connection like this:
nmcli connection modify "YOUR_CONNECTION_NAME" ipv4.method manual ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8,8.8.4.4
Then bring the connection up again.
nmcli connection down "YOUR_CONNECTION_NAME" && nmcli connection up "YOUR_CONNECTION_NAME"
Be sure your chosen IP doesn’t conflict with another device. You can find this info in your router’s DHCP settings.
Bonus Tips!
- Use a Different Network Tool: Tools like wicd or ConnMan can replace NMS if it keeps causing issues.
- Check Network Logs: Use
journalctl -u NetworkManagerto see what went wrong recently. - Blacklist Auto-switching Scripts: Some distros include scripts that might interfere with NMS — check for packages like
netctl.
Conclusion: Make Friends With Your Network
NMS is powerful, but a bit over-eager. With a few tweaks, you can teach it to work with you, not against you. Whether you’re surfing the web on your couch or doing mission-critical server work, a steady connection is gold.
Now you have tools to fight back. And you didn’t even break a sweat!
So go forth, Linux navigator. May your packets always arrive in order, and your signal never fade!
