Перезагрузка службы сети linux

How to Restart the Network on Ubuntu 22.04

In Linux distribution, the network manager is responsible for managing the network on your system. The latest release of Ubuntu 22.04 provides the facility to change or restart the network status with the help of the Command Line Interface or Graphical User Interface. Restarting the network helps in setting the connection and resolving network connection issues.

In this write-up, we will provide you with a deep insight into the methods to restart the network on Ubuntu 22.04. The outcomes are as follows:

Let’s dig into the CLI method first:

Method 1: Restarting the Network on Ubuntu 22.04 Using CLI

The CLI of Ubuntu 22.04 offers various commands to manage the network. This section enlists various commands that can be used to restart the network on Ubuntu 22.04.

Method 1.1: Using nmcli Command

The nmcli utility is used to control the network’s connections. Using the nmcli utility, users restart the network on Ubuntu 22.04. For this purpose, follow the given steps one by one.

Step 1: Check device status

First, check the network status, whether it is connected or not. For this purpose, run the following command:

The output shows that the network is connected.

Step 2: Turn off the Network

To turn off the network, run the following command:

$ sudo nmcli networking off

The successful execution of the command shows that the network is disabled now.

Step 3: Switch on the Network

Now, to reconnect the network, utilize the below script:

After this connection, the network’s active state will be restored.

Method 1.2: Using the Network Manager Service

The network manager service manages the network and connectivity settings on your device.

First, to check the network status on your device, use the below script:

$ systemctl status NetworkManager.service

The output showed that the network is in an active state.

Читайте также:  Красивый терминал arch linux

To restart the network on Ubuntu 22.04, execute the below script in the terminal:

$ sudo systemctl restart NetworkManager.service

Upon successful execution, the network will take a quick restart.

Method 2: Restarting Network on Ubuntu 22.04 Using GUI

The Graphical-User-Interface is the utility that provides an easy and user-friendly interface to the user. You can graphically interact with Ubuntu 22.04 to restart the network using the following steps.

Step 1: Open the Network Menu

First, open the network menu and check the network status:

The wire is connected, and the network icon shows that the network is in an active state.

Step 2: Turn off Network

To turn off the network, click on “Wired Connected” and then click on the “Turn off” option:

It will disconnect the network of your device.

Step 3: Turn on Network

After turning off the network, choose the“Connect” button to turn on the network again:

It will connect to the network of your device.

Step 4: Check Network Status

Furthermore, the network restarts the process, and the user can check the network status of their device:

The output shows that the device is connected to the network.

Congratulations! You have learned the process for restarting the network on Ubuntu 22.04.

Conclusion

A user can restart the network on Ubuntu 22.04 with the help of the Command Line Interface or Graphical User Interface. Restarting the network refreshes the network connection quickly and resolves the errors, if any. This short blog illustrated the knowledge to restart the network on Ubuntu 22.04 using CLI and GUI. The CLI uses the nmcli utility and NetworkManager service while the GUI restarts the network graphically on Ubuntu 22.04.

TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY

Источник

Перезапуск сети в Ubuntu

В Ubuntu и Debian инициализацией сетевых интерфейсов и настройкой сети занимается специальная сетевая служба — networking. Информация о конфигурации сетевых интерфейсов хранится в файле /etc/network/interfaces.

Если вы что-либо измените в этом файле, нужно будет перезапустить сеть, чтобы применить изменения. В этой статье мы рассмотрим как выполнить перезапуск сети Ubuntu 16.04.

Перезагрузка сети в Ubuntu

Можно, конечно, выполнить полную перезагрузку компьютера, но это не совсем удобно если можно просто перезапустить сеть Ubuntu. Для перезапуска сети используйте следующую команду:

sudo service networking restart

В современных дистрибутивах уже давным давно используется система инициализации Systemd, поэтому можно использовать команду systemctl вместо команды service:

sudo systemctl restart networking.service

Кроме того, можно перезапустить NetworkManager, это тоже помогает, если сеть настроена через него:

sudo systemctl restart NetworkManager

Читайте также:  Резервное копирование mysql linux

Перезапуск сети в NetworkManager

Чаще всего, для управления сетью в современных дистрибутивах используется программа Network Manager. Можно сразу же использовать ещё для наших целей. Просто отключите, а затем включите сеть обратно следующими командами:

sudo nmcli networking off

После отключения сети значок NetworkManager пропадёт с панели, а потом снова появится после включения. Аналогично, вы можете использовать NetworkManager в графическом интерфейсе. Кликните по его иконке, выберите нужное сетевое подключение и нажмите Выключить:

Затем включите его обратно.

Команды ifup и ifdown

Эти команды работают на более низком уровне, они управляют непосредственно самими сетевым интерфейсами. Для перезапуска сети мы можем отключить все интерфейсы, а затем включить обратно:

Вы не увидите никаких изменений в графическом интерфейсе, но когда сетевой интерфейс будет отключён, вы не будете иметь доступа к интернету.

Выводы

Как видите, не всегда обязательно перезагружать компьютер после изменений настроек, в большинстве случаев достаточно перезапустить только нужный сервис. Надеюсь, эта информация была вам полезной.

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

How to restart network services in Linux

Restart Networking in Linux

Sometimes, when you changed the network configuration or due to some network problems, you may need to restart the network services again on your Linux system to solve your problem. In this article, we will talk about how to restart the networking services on in different Linux distributions (Ubuntu, Debian, LinuxMint and CentOS) by using the command line. We have implemented different commands on Ubuntu 20.04 and CentOS 8 system. All commands which we have executed on Ubuntu 20.04 can be also used for Debian and LinuxMint distributions.

Get network Service Status

You can get the network services running status by using the following command:

For latest (Ubuntu/Debian/Mint)

To check the networking services are running on your system or not, by using the following ‘systemctl’ command you can view the networking service status on your Ubuntu/Debian/Mint system:

$ sudo systemctl status networking
$ sudo systemctl status networking.service

You can also display the networking service status by using the service command which is given as follows:

$ sudo service networking status

$ /etc/init.d/networking status

For CentOS 8 / Fedora

If you are using CentOS 8 then you can check the network service status by using the following command:

If you received an error like ‘network.service unit not found’ then, you will run the following command to start the network manager:

# systemctl start NetworkManager

Now, start the network services and you can get network status by using the above-mentioned command.

Stop Network Services

You can stop your network services through the method which is mentioned below. But, if you have a remote connection with SSH, we are not recommended you to stop the service because it may create problems.

Читайте также:  Virtualbox linux группы пользователей

For Ubuntu/Debian/Mint

You can use the ‘stop’ option with the above ‘networking’ command on Ubuntu, Debian, Kali, Mint distributions in order to stop network services.

$ sudo /etc/init.d/networking stop

$ sudo systemctl stop networking.service

linux restart network

For CentOS 8/Fedora

In CentOS 8, using the following command you can stop network services:

Now, if you will check the network status you will see that network services are stopped on your system.

linux restart network

Start Network Service

If networking services are stopped on your system then, you start these services on the Linux system.

For Ubuntu/Debian/Mint

You can also start the network services by using the service command. Use ‘start’ option to start the network service on your Ubuntu. Debian and LinuxMint distributions.

$ sudo service networking start

linux restart network

$ sudo systemctl start networking.service
$ $ sudo /etc/init.d/networking start

For CentOS 8/Fedora

In CentOS 8, by using the following command you can start the network service on your system:

Restart Network Service

You can also restart the network service by using the following command on Linux distributions:

For Ubuntu/Debian/Mint

Type the following command to restart the network service on Ubuntu, Debian, and Linux Mint:

$ /etc/init.d/networking restart
$ sudo systemctl restart networking.service
$ sudo systemctl restart networking

For CentOS 8/Fedora

Use the following command to restart the network service on CentOS 8:

# systemctl restart network

If you get the following error on the terminal then, you need to start the NetworkManager services on your system by using the following command:

# systemctl start NetworkManager

Now, again restart the network service. You will see the following output on the CentOS system:

linux restart network

Conclusion

From the above information, we have explored how to start, stop, and restart the network service on different Linux distribution like Ubuntu, Debian, Linux Mint, and CentOS 8. Moreover, you can troubleshoot the network error through the NetworkManager tool on CentOS 8. If you need more details then, you can implement all command on your system and then let us know about your problems. Please don’t stop services if you have a remote ssh connection that may create a problem.

Samreena Aslam holds a master’s degree in Software Engineering. She’s a technical writer and has written various articles on different Linux flavours including Ubuntu, Debian, CentOS and Mint as well as programming guides in various programming languages

Источник

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