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

1
sudo ifconfig en0 down

Restart the networking interface

1
sudo ifconfig en0 up

Verify the networking restart

1
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

1
2
3
networksetup -setairportpower en0 off
# or
networksetup -setairportpower "Wi-Fi" off

Restart the networking interface

1
2
3
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.

1
2
man ifconfig
man networksetup