Categories: Tutorials

How To start/Stop/Restart Network Service on Ubuntu or Debian Linux

This post will guide you how to start or restart network service on the latest Ubuntu 18.04 or Debian linux system. How do I start, stop or restart Network service from the command line on your Ubuntu Linux system.

Sponsored
Displaying Netowrking Configuration File


If you are working on a Ubuntu Linux system, and you may be need to set IP address for a given enternet interface or you need to change network settings by modifying networking configuration file called interfaces located in the /etc/network directory using your vim text editor. or you can use cat command to dispaly the content of the current networking configuration file, type:

$ sudo vim /etc/network/interfaces

or

$ cat /etc/network/interfaces

Outputs:

devops@devops:~$ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet dhcp

Starting Network Service in Ubuntu


If your network service daemon is stopped, and you may be need to start it by using the following command:

$ sudo systemctl start networking.service

or

$ sudo /etc/init.d/networking start

Stop Network Service in Ubuntu


If you wish to stop a network service in your Ubuntu or Debian Linux, and you can type the following comand:

$ sudo systemctl stop networking.service

or

$ sudo /etc/init.d/networking stop

Restart Network Service in Ubuntu


If you modified networking configuration in your Ubuntu system, and you need to restart its service by using the following command:

Sponsored
$ sudo systemctl restart networking.service

or

$ sudo /etc/init.d/networking restart

Checking Status of Networking Service


If you need to check the current status of networking service in your Ubuntu system, and you can issue the following command:

$ sudo systemctl status networking.service

Or

$ sudo /etc/init.d/networking status

Outputs:

devops@devops:~$ sudo systemctl status networking.service
networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; disabled; vendor preset: enabled)
Active: active (exited) since Tue 2019-10-08 02:59:03 EDT; 18min ago
Docs: man:interfaces(5)
Main PID: 1158 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 1121)
CGroup: /system.slice/networking.service

Oct 08 02:58:59 devops systemd[1]: Starting Raise network interfaces...
Oct 08 02:59:03 devops systemd[1]: Started Raise network interfaces.

Enabling Netowrk Service in Ubuntu


If you want to enable your network service at system boot on your Ubuntu system, and you can run the following command:

$ sudo systemctl enable networking.service

Outputs:

devops@devops:~$ sudo systemctl enable networking.service
Synchronizing state of networking.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable networking

Disabling Network Service in Ubuntu


If you want to diable network service at system boot, just using the following command:

$ sudo systemctl disable networking.service

Conclusion


You should know that how to start/stop/restart/enable/disalbe network service in your Ubuntu or Debian L Linux system.

The post How To start/Stop/Restart Network Service on Ubuntu or Debian Linux first appeared on RSSFeedsCloud.

Ubuntu Server Admin

Recent Posts

Building RAG with enterprise open source AI infrastructure

One of the most critical gaps in traditional Large Language Models (LLMs) is that they…

11 hours ago

Life at Canonical: Victoria Antipova’s perspective as a new joiner in Product Marketing

Canonical is continuously hiring new talent. Being a remote- first company, Canonical’s new joiners receive…

1 day ago

What is patching automation?

What is patching automation? With increasing numbers of vulnerabilities, there is a growing risk of…

2 days ago

A beginner’s tutorial for your first Machine Learning project using Charmed Kubeflow

Wouldn’t it be wonderful to wake up one day with a desire to explore AI…

3 days ago

Ubuntu brings comprehensive support to Azure Cobalt 100 VMs

Ubuntu and Ubuntu Pro supports Microsoft’s Azure Cobalt 100 Virtual Machines (VMs), powered by their…

3 days ago

Ubuntu Weekly Newsletter Issue 870

Welcome to the Ubuntu Weekly Newsletter, Issue 870 for the week of December 8 –…

4 days ago