Restarting Networking Services for a NIC in Linux or Unix

Restarting Networking Services for a NIC in Linux or Unix

penguinMany Linux Based Operating System Distribution Variants will require a manual reboot or restart of the network interface card to apply any changes you have made to the networking configuration after you’ve completed your work.

So how do you quickly restart the networking interface card without bringing down the whole server for longer than necessary? Luckily, Linux allows us to easily restart the networking interface without having to reboot, meaning we can have your network connection back up in seconds rather than a few minutes due to rebooting.

Do I need to restart my NIC if I…

If you’re not sure if the changes you’ve made warrant a network restart, you can check this quick list I put together of common changes made to the networking interface configurations for Ethernet adapters.
Some of the things when changed which require a manual NIC restart afterwords are:

  • Reconfiguring the IP Address.
  • Reconfiguring the Subnet Mask.
  • Reconfiguring the Network the IP Addresses o.n
  • Reconfiguring the Gateway Host IP Address.
  • Changing the MAC (Media Access Control) Address.
  • Changing “ONBOOT” actions or configuration settings.
  • Adding an additional IP Address via a virtual Network Interface Card.
  • etc.


How do I stop, start, or restart my Linux networking services?

Now that you have determined whether or not the changes you have just made to your network interface card will require a restart of the networking, we will now guide you through the network restarting. Your Linux host machine isn’t as wild-rooted as you may think. It won’t bite, …hard.

There are three main options you have when working with your networking services in Linux, and all are very straight forward and self-explanatory.

  • Stop
  • Start
  • Restart



The Stop parameter will bring your network services down until manually brought back up by the Start parameter, where as the restart parameter will instantly stop and subsequently start up again the networking services for your Ethernet Networking Interface Services card.

Please note that each Distribution of Linux can be compiled differently, and thus their environmental variables may differ from distribution to distribution (aka flavor, brand, type, etc) thus it is very important to know which of the commands below most closely matches the distribution of Linux you are using.

RedHat Linux, CentOS, and other variants’ command to reload or restart network (login as root user):

service network restart



OR

/etc/init.d/network restart



To start Linux networking service on Red Hat Enterprise Linux, CentOS, or other similar variants:

service network start



To stop Linux network service on Red Hat Enterprise Linux, CentOS, or other similar variants:

service network stop



Debian Linux (and similar distributions) command to reload or restart network:

/etc/init.d/networking restart



To start Linux networking services on Debian Linux and similar distributions:

/etc/init.d/networking start



To stop Linux network service on Debian Linux and similar distributions:

/etc/init.d/networking stop



Ubuntu Linux and similar distributions use the sudo command in combination with the command for restarting the network on Debian Linux:

sudo /etc/init.d/networking restart



To start Linux networking service on Ubuntu Linux and similar distributions:

sudo /etc/init.d/networking start



To stop Linux network service for a Ubuntu Linux or a variant distribution based on Ubuntu Linux:

sudo /etc/init.d/networking stop



If you have done this and it hasn’t solved your networking issues, it may be due to a formatting error or misconfiguration of one of your network configuration scripts, or else there may be something at the service level in the operating system or the physical hardware level preventing your network from coming back up. Use any clues such as error messages as a reference point for googling up your particular issue.