Restart OSX networking from the command line

I always forget this, so here it is:

Shutdown network interface:
sudo ifconfig en0 down

Start network interface: sudo ifconfig en0 up
  • idiot

    comment to myself: dont use from ssh connection 🙂

  • use a chained command if you need to do this remotely… and then cross your fingers! sudo ifconfig en0 down; sudo ifconfig en0 up or sudo ifconfig en0 down && sudo ifconfig en0

  • oiji

    sudo ifconfig en0 down && sudo ifconfig en0 up

  • Jamie Ivanov

    Run the commands from screen so it will run in the background even if your SSH session gets terminated.