In this article, we will see How to restart Network Interface in Debian. We can restart the networking service in Linux using various command. Use the following commands as per your Linux distribution to restart the networking service. You must run the command as root user either using sudo or su commands. The ifup command bring a network interface up. The ifdown command take a network interface down.
Debian / Ubuntu Linux restart network interface
To restart network interface, enter:
sudo /etc/init.d/networking restart
To stop and start use the following option (do not run them over remote ssh session as you will get disconnected):
sudo /etc/init.d/networking stop
To start the interface;
sudo /etc/init.d/networking start
Debian/Ubuntu Linux with systemd, run:
sudo systemctl restart networking
There is other way also to restart the netwoporki interface:
Disabling the Network Interface:
The first step is to disable the network interface using the ifdown command. Open a terminal and replace your_interface_name with the actual name of your network interface. For example:
sudo ifdown your_interface_name
If you are working with the eth0 interface, the command would be:
sudo ifdown eth0
This command deactivates the specified network interface, temporarily disconnecting it from the network.
Enabling the Network Interface:
Once the interface is disabled, you can enable it again using the ifup command. Run the following command in the terminal, replacing your_interface_name with the actual name of your network interface:
sudo ifup your_interface_name
For instance, if you disabled the eth0 interface, the command would be:
sudo ifup eth0
This command reactivates the network interface, establishing a connection to the network.
Conclusion
You should now have a good understanding of how to restart the network interface in Ubuntu. We have GUI mode also in Ubuntu where we can modify the IP addresses.
If you have any questions please leave them in the comments below.