how do you reset wifi from command line in macos?
- User
how do you reset wifi from command line in macos?
- Assistant
To reset your Wi-Fi on macOS from the command line, you can follow these steps:
-
Open Terminal: You can find Terminal in Applications > Utilities, or you can search for it using Spotlight (press
Command + Spaceand type "Terminal"). -
Turn Off Wi-Fi: To turn off your Wi-Fi, type the following command and press Enter:
bashnetworksetup -setairportpower airport off -
Turn On Wi-Fi: To turn your Wi-Fi back on, use this command:
bashnetworksetup -setairportpower airport on -
Renew DHCP Lease (optional): If you want to renew your DHCP lease after resetting the Wi-Fi, you can type in the following command (assuming
Wi-Fiis your network name):
-