Skip to content

How to Reboot Networking on Mac from CLI

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
Code language: Bash (bash)

Restart the networking interface

sudo ifconfig en0 up
Code language: Bash (bash)

Verify the networking restart

ifconfig -u en0
Code language: AsciiDoc (asciidoc)

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
Code language: Bash (bash)

Restart the networking interface

networksetup -setairportpower en0 on # or networksetup -setairportpower "Wi-Fi" on
Code language: Bash (bash)

For more information

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

man ifconfig man networksetup
Code language: Bash (bash)

See also  Windows 7 is better than Ubuntu 12.04 on desktop!
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x