9

On FreeBSD/Linux, it is possible to restart network services by restarting a daemon.

Is there something similar in macOS Sierra?

10

You can tear down and start up the network interface using:

sudo ifconfig en0 down
sudo ifconfig en0 up
6

Network interfaces can also be Disabled & Enabled in System Preferences‑Network.

Make Service Inactive

4

The restarts Wi-Fi without sudo. Does anyone know how to do this with a single command?

networksetup -setairportpower en0 off
networksetup -setairportpower en0 on
  • 1
    Create a shell script with those two lines, or use Automator to create an application from a shell script with those two lines. I just did the latter, seems to work fine. – Magnus W Jun 21 '18 at 11:26
  • 1
    You can perhaps use && like so: networksetup -setairportpower en0 off && networksetup -setairportpower en0 on for single command. – Atul Yadav Mar 26 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .