https://gist.githubusercontent.com/0x55xx5/d3c5fea540cc162d56163559090eb18b/raw/2ad7237170e65c7ea132b181f11b75eb6e4881e1/wififix_monterey
How to Use the Script
1. Save the script
Copy the code into a new file, for example:
save the script and renamed
fix_network.sh
2. Make it executable
open the terminal app
input the bold command
chmod +x fix_network.sh
3. Run the script
Since it needs admin rights, run:
sudo ./fix_network.sh
On macOS Monterey, there is a known bug with Wi-Fi and DHCP.
Sometimes, after your Mac goes to sleep or loses power, it connects to Wi-Fi but does not get an IP address. This means you see the Wi-Fi as “connected,” but the internet does not work.
This is not your router’s fault. It’s a Monterey system problem caused by the way it handles network setup. Sometimes the Mac’s software tries to connect too quickly, and the network settings don’t load correctly.
That’s why rebooting, reconnecting Wi-Fi, or using a VPN may suddenly “fix” it — because they restart the network process