Tuesday, April 23, 2024
HomeSoftware EngineeringThe best way to Reboot Networking on Mac from CLI

The best way to Reboot Networking on Mac from CLI


If you have to reboot, or restart the networking interface in your Mac, through the use of the CLI, then you may situation the next instructions:

Utilizing the ifconfig main interface

Tear down the networking interface

sudo ifconfig en0 down

Restart the networking interface

sudo ifconfig en0 up

Confirm the networking restart

ifconfig -u en0

Different with out sudo, utilizing networksetup

If you have to carry out the identical consequence, however not in a position to run sudo, then look to the networksetup.

Tear down the networking interface

networksetup -setairportpower en0 off
# or
networksetup -setairportpower "Wi-Fi" off

Restart the networking interface

networksetup -setairportpower en0 on
# or
networksetup -setairportpower "Wi-Fi" on

For extra data

For extra data on the above instructions, check out the person pages.

man ifconfig
man networksetup
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments