1st August 2021

Restarting, Starting, Stopping, Checking the Status of the Network Service in Linux

In Linux-based operating systems, information about network operations such as network settings, network commands or network configuration is included. In Linux operating systems, as everything is a file, network settings are also kept in files. The settings can be edited with any text editor or by various tools.

Network files

Network settings are located in the following files and directories.

 

Each of the settings files is used for different operations. The files in the network-scripts directory are used for network settings. Network settings are eth0, eth1, etc. according to the network card in files starting with ifcfg. kept by names.

Inside the network settings;

It also has various settings such as MAC address, Network type. When you want to get IP using DHCP, it will be sufficient to write the  DEVICE, BOOTPROTO and ONBOOT settings.

Network Operations

In Linux systems, we can use the following commands to examine the Stop, Start, Restart and Status of our Network services.

LEARN MORE  What is VMware Workstation?

Stop Network Service

You can stop the network service as follows. Check before stopping the service. There will be a problem with your connection. We recommend that you try it in your test environment.

Ubuntu, Debian, Kali and Mint

Ubuntu, Debian, Kali, Mint etc. We will use the networking stop command to service networking stop.

service networking stop
service networking stop

 

Fedora and CentOS

Fedora and CentOS etc. We will use the networking stop command to systemctl stop network.target.

systemctl stop network.target
systemctl stop network.target

 

Start Network Service

You can start the network service as follows.

Ubuntu, Debian, Kali and Mint

Ubuntu, Debian, Kali, Mint etc. We will use the networking start command to sudo service networking start.

service networking start
service networking start

 

Fedora and CentOS

Fedora and CentOS etc. We will use the networking stop command to sudo systemctl start NetworkManager-dispatcher.service.

systemctl start NetworkManager-dispatcher.service
systemctl start NetworkManager-dispatcher.service

 

Status Network Service

You can status the network service as follows.

Ubuntu, Debian, Kali and Mint

Ubuntu, Debian, Kali, Mint etc. We will use the networking start command to sudo service networking status.

service networking status
service networking status

 

Fedora and CentOS

Fedora and CentOS etc. We will use the networking stop command to sudo systemctl status NetworkManager-dispatcher.service.

sudo systemctl status NetworkManager-dispatcher.service
sudo systemctl status NetworkManager-dispatcher.service

 

Restart Network

You can restart the network service as follows.

Ubuntu, Debian, Kali and Mint

Ubuntu, Debian, Kali, Mint etc. We will use the networking start command to sudo service networking restart.

LEARN MORE  What is Ansible? How is the file structure?

service networking restart
service networking restart

 

Fedora and CentOS

Fedora and CentOS etc. We will use the networking stop command to sudo systemctl restart NetworkManager-dispatcher.service.

systemctl restart NetworkManager-dispatcher.service
systemctl restart NetworkManager-dispatcher.service

 

Leave a Reply

Your email address will not be published. Required fields are marked *