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

Top 11 Linux Log Monitoring Tools for System Administrators

In Linux environments, system administrators need to continuously monitor log files to evaluate system health,…

6 hours ago

Accelerating AI with open source machine learning infrastructure

The landscape of artificial intelligence is rapidly evolving, demanding robust and scalable infrastructure. To meet…

13 hours ago

Hardening automation for CIS benchmarks now available for Ubuntu 24.04 LTS

We’re pleased to release Ubuntu Security Guide profiles for CIS benchmarks. These profiles will allow…

13 hours ago

Detecting and Fixing Memory Leaks with Valgrind

Memory leaks are among the most frustrating bugs to track down in C and C++…

1 day ago

How to Kill Processes Using Specific Ports on Linux, Windows and MacOS

Have you ever encountered issues starting a server or application because the required port is…

1 day ago

How to Fix the “Native Host Connector Not Detected” Error for GNOME Extensions in Ubuntu 22.04

When upgrading to Ubuntu 22.04 LTS (Jammy Jellyfish), many users encounter the error message: “Although…

1 day ago