Tuesday, June 23, 2015

Restarting network interface in Ubuntu starting 14.04 and up

After Ubuntu 12.04 the /etc/init.d/networking restart command will not work. So it is advised to create a restart script to be able to restart the network interface.

here are the steps done in creating the network restart script.
# vim nrestart.sh
This will create a new file. Then insert the following


ifdown eth0 && ifup eth0

Save after. Note replace the interface to suit your needs.

# chmod a+x nrestart.sh
This will make our script executable

# ./nrestart.sh
This is how to execute the command if you are in the same path.