How to Reboot Networking on Mac from CLI

0 min read 127 words

If you need to reboot, or restart the networking interface on your Mac, by using the CLI, then you can issue the following commands:

Using the ifconfig primary interface

Tear down the networking interface

sudo ifconfig en0 down

Restart the networking interface

sudo ifconfig en0 up

Verify the networking restart

ifconfig -u en0

Alternative without sudo, using networksetup

If you need to perform the same result, but not able 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 more information

For more information on the above commands, take a look at the man pages.

man ifconfig
man networksetup
Tags:
Andrew
Andrew

Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.

Tags