Ubuntu is a reliable operating system, but most people take time to understand how it works. One can easily restart, stop and start networking services under Ubuntu using a shell prompt. A restart can be prompted over ssh session. However do not stop networking service over ssh session as there will be loss of connectivity to the remote server. The correct way is by manually bringing the interface that needs to be restarted down and back up.
RECOMMENDED: How to Change Hostname on Ubuntu
The GUI for Linux network configuration is more graphical and appeasing visually. It may take longer to restart the network interface by using it. The restarting of the network interface by using the command line will require the user to have logged in as the root user or via sudo.
There are two methods of restarting the network in Ubuntu, the first is to use the service command to issue commands to the service you wish to work with. The second is to interact with the init script on the server. See the commands bellow:
sudo service network-manager restart
Both commands result in the same action, the usage comes down to personal preference.
The following tools can be used:
- /etc/init.d/networking script
- Run a system V init script such as networking.
The syntax is as follows on Ubuntu:
Open terminal or command line and type the following commands:
$ sudo /etc/init.d/
About Network Restart
A sudo service networking restart does not work well any more. To restart networking from remote is probably the best and secure approach. In today’s networking init script, restart and force reload will work in most circumstances.
When restarting the network one should be cautious when editing the network settings of the machine. If a wrong set of configuration is set it might render the machine inaccessible over the network. Network manager is the new tool available for Ubuntu network. The computer uses a wired connection when available but automatically switches to wireless connection when the network cable is unplugged.
RECOMMENDED: How to Add a New User in Ubuntu
Ubuntu does event based networking bringing up its simplicity. There is simply no way to undo it all or redo it all, the recommended way is to use if down and if up on the interface you want to reconfigure.
Recommended: How to Install Node.js on Ubuntu