This is a classic Linux laptop issue, especially on MacBooks. The wireless getting disabled on wake is usually one of a few things:
Most likely culprit - rfkill getting triggered:
Check the rfkill status:
If you see the wireless is "soft blocked" or "hard blocked", that's your problem. The soft block is what nmcli is toggling, but sometimes the hardware switch (or what the kernel thinks is a hardware switch) gets in a weird state.
Unblock it:
Code:
sudo rfkill unblock wifisudo rfkill unblock all
Then bring it back up:
MacBook-specific issue - Broadcom driver problems:
MacBook Pro 2015 likely has a Broadcom wireless chip, which can be finicky on Linux. Check what driver you're using:
Code:
lspci -k | grep -A 3 Network
If you see "bcma" or "b43" drivers, those are the open-source ones that sometimes have power management issues. The "wl" (broadcom-sta) proprietary driver often works better but has its own quirks.
Power management being too aggressive:
NetworkManager might be putting the wireless into power save mode and it's not waking up properly. Check current power save status:
Code:
iw dev wlan0 get power_save
(Replace wlan0 with your actual wireless interface name - check with ip link)
Disable power save temporarily to test:
Code:
sudo iw dev wlan0 set power_save off
If that fixes it, make it permanent by creating a file:
Code:
sudo vim /etc/NetworkManager/conf.d/default-wifi-powersave-off.conf
Add:
Code:
[connection]wifi.powersave = 2
Then restart NetworkManager:
Code:
sudo systemctl restart NetworkManager
Systemd sleep hooks interfering:
Sometimes systemd-sleep is killing the wireless on suspend. Check the logs right after waking:
Code:
journalctl -b | grep -i wirelessjournalctl -b | grep -i networkjournalctl -u NetworkManager | tail -50
Look for errors or warnings about the wireless interface around suspend/resume time.
Nuclear option - restart NetworkManager on wake:
Create a systemd service that runs on resume:
Code:
sudo vim /etc/systemd/system/restart-nm-on-wake.service
Add:
Code:
[Unit]Description=Restart NetworkManager on wakeAfter=suspend.target
[Service]Type=oneshot
ExecStart=/bin/systemctl restart NetworkManager
[Install]WantedBy=suspend.target
Enable it:
Code:
sudo systemctl enable restart-nm-on-wake.service
Quick diagnostic to run next time it happens:
Code:
rfkill listnmcli radio wifi
nmcli device status
iw dev wlan0 get power_save
journalctl -u NetworkManager --since "5 minutes ago"
That'll tell you what's actually going wrong.
My guess is it's either rfkill getting set on wake, or power management being too aggressive with the Broadcom chip. The MacBook 2015 Broadcom wireless is notorious for this on Linux.
What does rfkill list show when the wireless stops working?
You might not like this, but in some cases you have no choice, I have ethernet adapters on all my laptops,
wi-fi works "most" of the time on "most" of them. But ethernet always works.