Starting network services linux

How to Start, Stop or Restart Network Services on Rocky Linux 8

Network Restart Rocky Linux

You may need to restart or stop network services on your Rocky Linux system occasionally. This article shows you step-by-step how to start, stop, or restart network services on Rocky Linux 8. The same commands also work on other RHEL clones such as AlmaLinux 8 and CentOS 8.

Steps to start, stop and restart the network service

Open the terminal window on your system and run the ‘su’ command on the terminal to log in as the root user.

There are the following two ways through which you can start, stop or restart network service:

Now, we will explore each way one by one in the following tutorial:

Use of NetworkManager service

To start a network service on the RockyLinux 8, you will run the below-given command:

$sudo systemctl start NetworkManager.service

Login as root user via su

The above-mentioned command is used to start a network service on RockyLinux 8.

To stop a network service on the RockyLinux 8, you need to run the below-mentioned command:

$sudo systemctl stop NetworkManager.service

To restart a network service, you need to execute the following command:

$sudo systemctl restart NetworkManager.service

Use of nmcli tool

The nmcli is a tool or utility that is used for managing the NetworkManager services through the terminal.

Note: Before starting to use nmcli utility, it is noted that do not try to execute ‘$nmcli networking off’ for those systems that are connected remotely with others. This command will stop or disable the NetworkManager settings and you will disconnect from the network connection.

To turn on the network services, you will type the following command on the terminal in RockyLinux 8.

use nmcli command

To stop or turn off the network services, you will execute the following command on the terminal.

$sudo nmcli networking off

Conclusion

In this article, you have learned how to start, stop or restart network services on RockyLinux 8. I hope you have enjoyed this article and it would be helpful for you as well. Provide your feedback in the comment section.

Читайте также:  Linux list folder contents

About This Site

Vitux.com aims to become a Linux compendium with lots of unique and up to date tutorials.

Latest Tutorials

Источник

Linux network services: How to start, stop, and check their status

Traffic light on green

A service (also called a daemon process) is software that runs on a computer, generally in the background. This is usually because it’s something that the administrator isn’t likely to interact with directly.

Training & certification

For instance, a network service runs at the application layer to provide some form of service over a network. It’s expected that client computers will contact the service for access. A common example is the Apache web server. It runs on a system so that devices connected to the internet can view a specific set of files on a computer.

Red Hat Enterprise Linux (RHEL) provides an environment where these network services can run. RHEL also provides a utility named systemd to help you manage these services.

systemd has been the default service manager since RHEL 7. It’s the first thing that gets started (PID 1), and it is responsible for starting the rest of the system. It activates server daemons, system resources, and various other processes. With systemd, you can start, stop, and check the status of the network services running on your server. You interact with systemd by using the systemctl command.

Start a service

To start a given service, use:

For example, to start the sshd service, type:

$ sudo systemctl start sshd.service

You can ignore .service and run the systemctl start sshd command.

List services

You can list all loaded services on a server with:

$ sudo systemctl list-units --type=service

Stop a service

To find out whether a service is running, inactive, enabled, disabled, or has exited, use:

$ sudo systemctl status sshd

The systemctl command also has is-active and is-enabled options to see whether a service is active or enabled. For example, to check if a service is active or enabled, run:

IT Automation ebook

This command gives two possible outputs. The service is either active , which means it is running, or it’s inactive , which means it is stopped or not running.

Enable a service

You can configure a service to start automatically with the system so that you don’t have to start it manually after the server reboots or restarts.

To enable a service, which means the service starts automatically when the server boots, use:

$ sudo systemctl enable sshd

To both start and enable a service, add the —now option, like this:

$ sudo systemctl enable --now sshd

To check whether a service is enabled, enter:

$ sudo systemctl is-enabled sshd

When a service is enabled, it starts automatically at boot. When it’s disabled, it doesn’t start automatically at boot.

Читайте также:  Нет выбора загрузки ос linux

Disable a service

To disable a service, so the service will not start automatically at boot time, run:

$ sudo systemctl disable sshd

Wrap up

Not everything uses systemctl by default. Some applications are intended to be started manually. Of course, you can always add your own systemd service files when you need a network service to start automatically.

Systemd is full of features, and the systemctl command gives you easy control over the services your computer runs.

Источник

How To Start / Stop / Restart Network Service in OpenSUSE Linux

How To Start / Stop / Restart Network Service in OpenSUSE Linux 1

In this tutorial, I will take you through the steps to Start / Stop / Restart Network Service in OpenSUSE Linux. If you are performing some changes in network configuration file then you always need to stop/start/restart network service for changes to take effect. Similarly if you are troubleshooting any network issue then also you might need to restart network service few times. There are few commands available in OpenSUSE Linux which can be used to stop/start/restart network service in Linux. We will go through those commands and understand the usage with the help of examples.

How To Start / Stop / Restart Network Service in OpenSUSE Linux

How to Start / Stop / Restart Network Service in OpenSUSE Linux

1. How to Start Network Service in OpenSUSE Linux

If you want to start your network service in OpenSUSE Linux then you need to use service network start command as shown below. Alternatively you can also use systemctl start network command to start network service.

How To Start / Stop / Restart Network Service in OpenSUSE Linux 2

Please note that here I am using root user to run all the below commands. You can use any user with sudo access to run all these commands. For more information Please check Step by Step: How to Add User to Sudoers to provide sudo access to the User.

2. How to Stop Network Service in OpenSUSE Linux

If you want to stop network service then you need to use service network stop command as shown below. Alternatively you can also use systemctl stop network command to stop network service.

How To Start / Stop / Restart Network Service in OpenSUSE Linux 3

3. How to Check Status of Network Service in OpenSUSE Linux

If you want to check the status of Network Service then you need to use service network status command as shown below.

How To Start / Stop / Restart Network Service in OpenSUSE Linux 4

Alternatively you can also use systemctl network status command to check the status of network service.

localhost:~ # systemctl status networkNetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/NetworkManager.service.d └─NetworkManager-ovs.conf Active: active (running) since Thu 2020-12-17 22:34:34 IST; 46s ago Docs: man:NetworkManager(8) Main PID: 2875 (NetworkManager) Tasks: 3 CGroup: /system.slice/NetworkManager.service └─2875 /usr/sbin/NetworkManager --no-daemon Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.0954] device (eth0): state change: ip-config -> ip-check (reason 'none', sys-iface-stat> Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.1230] device (eth0): state change: ip-check -> secondaries (reason 'none', sys-iface-st> Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.1234] device (eth0): state change: secondaries -> activated (reason 'none', sys-iface-s> Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.1241] manager: NetworkManager state is now CONNECTED_LOCAL Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.1258] manager: NetworkManager state is now CONNECTED_SITE Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.1259] policy: set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: nisdomainname: you must be root to change the domain name Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.4903] device (eth0): Activation: successful, device activated. Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.4912] manager: startup complete Dec 17 22:34:35 localhost.localdomain NetworkManager[2875]: [1608224675.6314] manager: NetworkManager state is now CONNECTED_GLOBAL

4. How to Restart Network Service in OpenSUSE Linux

If you want to restart your network service then you need to use service network restart command as shown below. Alternatively you can also use systemctl restart network command to restart network service.

Читайте также:  Linux swap size recommendations

How To Start / Stop / Restart Network Service in OpenSUSE Linux 5

5. How to Check Network Manager Status in OpenSUSE Linux

If you want to check Network Manager status then you need to use service NetworkManager Status command as shown below.

How To Start / Stop / Restart Network Service in OpenSUSE Linux 6

Alternatively you can also use systemctl NetworkManager status command to check the status of network manager service.

localhost:~ # systemctl status NetworkManagerNetworkManager.service - Network Manager Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: disabled) Drop-In: /usr/lib/systemd/system/NetworkManager.service.d └─NetworkManager-ovs.conf Active: active (running) since Thu 2020-12-17 22:34:34 IST; 11h ago Docs: man:NetworkManager(8) Main PID: 2875 (NetworkManager) Tasks: 3 CGroup: /system.slice/NetworkManager.service └─2875 /usr/sbin/NetworkManager --no-daemon Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: [1608260973.5114] device (eth0): state change: ip-config -> ip-check (reason 'none', sys-iface-stat> Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: [1608260973.5332] device (eth0): state change: ip-check -> secondaries (reason 'none', sys-iface-st> Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: [1608260973.5340] device (eth0): state change: secondaries -> activated (reason 'none', sys-iface-s> Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: [1608260973.5350] manager: NetworkManager state is now CONNECTED_LOCAL Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: [1608260973.5369] manager: NetworkManager state is now CONNECTED_SITE Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: [1608260973.5372] policy: set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: nisdomainname: you must be root to change the domain name Dec 18 08:39:33 localhost.localdomain NetworkManager[2875]: [1608260973.9143] device (eth0): Activation: successful, device activated. Dec 18 08:39:34 localhost.localdomain NetworkManager[2875]: [1608260974.2572] manager: NetworkManager state is now CONNECTED_GLOBAL Dec 18 09:48:47 localhost.localdomain NetworkManager[2875]: [1608265127.4577] agent-manager: agent[ba8bd6ffe4b7ff54,:1.26/org.gnome.Shell.NetworkAgent/1000]: a>

Popular Recommendations:-

Источник

Оцените статью
Adblock
detector