Перезапуск сетевых интерфейсов линукс

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.

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.

Читайте также:  Linux mint 11 росинка установка

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

Источник

How to restart network on Ubuntu 22.04 LTS Jammy Jellyfish

There exist various ways of restarting the network on Ubuntu 22.04 Jammy Jellyfish. Possibly the simplest way would be to restart the network from a GUI such as GNOME.

Other ways would include the use of the command line and commands like ip . Finally, the NetworkManager command line tool nmcli can be used to successfully restart network on Ubuntu 22.04 Jammy Jellyfish.

In this tutorial you will learn:

  • How to restart network from GNOME GUI
  • How to restart network using the ip command
  • How to restart network by using the NetworkManager command line tool nmcli

Restarting the network on Ubuntu 22.04 Jammy Jellyfish

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 22.04 Jammy Jellyfish
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Restarting network on Ubuntu 22.04 LTS Jammy Jellyfish step by step instructions

Restarting network from GUI desktop on Ubuntu 22.04

  1. In case you are running the default GNOME GUI on your Ubuntu 22.04 the simplest way to restart the network is to click on the top-right network icon: Expand the network settings menu from the top right corner of the desktop
  2. From there simply select network interface you wish to restart and click on the Turn Off menu option.
  3. Once the network interface is turned off you can now turn it on by clicking on the Connect menu option. Completing both steps will effectively restart your network. Clicking the connect button turns the network back on
Читайте также:  Firefox файл настроек linux

Restarting network from command line on Ubuntu 22.04

There are at least two ways to restart the network on Ubuntu 22.04 from the command line. Both methods are covered below.

    The first method is used to restart an individual interface, by putting into a down state and then into an up state. You can see a list of all your network interfaces by using the ip a command. In the example below, we will restart the enp0s3 interface by putting it down and then up again.

$ sudo ip link set enp0s3 down $ sudo ip link set enp0s3 up

Restarting the network by putting the interface down and up

The next method is using the nmcli command which will turn NetworkManager completely off and back on. This will restart your entire network, not just an individual interface.

$ sudo nmcli networking off $ sudo nmcli networking on

Restarting the network by using the nmcli command on Ubuntu 22.04

Closing Thoughts

In this tutorial, we saw how to restart the networking in Ubuntu 22.04 Jammy Jellyfish Linux. This included several methods, including via command line and GUI. Restarting the network is an essential tool in an administrator’s toolkit, since it is one of the most basic troubleshooting steps to try when ever there is a problem connecting to a network or remote host.

Источник

Перезапуск сети в 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

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

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

sudo nmcli networking off

Читайте также:  What is log file in linux

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

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

Команды ifup и ifdown

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

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

Выводы

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

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

Источник

How to restart network interfaces on Linux

restart network interface

O nce you make changes in the network interface, they affect the network services manager of your system. To enable the system or machine to connect to the network, one needs to restart the network interface to apply the changes without rebooting your server.

This article will guide you on restarting the network interface in various Linux distributions.

Note: When running SSH/ VNC or other remote-based sessions, you should take precautions since restarting the network interface or service can result in network disconnectivity, resulting in connection loss.

We will handle the following topics.

What is a network interface?

A network interface refers to the point of connection between a computer and the network. It can be either software (especially with Virtual machines) or a hardware component. When dealing with network interfaces, there is one term that you will likely come across – NIC (Network Interface Card).

A Network Interface Card is a circuit board chip inserted/ soldered on the motherboard allowing your computer to connect to the internet. If you have worked with many earlier Desktop computers (even some today), you know that most cannot connect to a WiFi network, and that’s because they don’t have a wireless NIC. You are advised to purchase a USB Network Adapter that will act as your wireless interface connection in such a situation.

How to list network interfaces on Linux

You can use different ways to see all the available network interfaces on your system. You can use the GUI or the Command-line (CLI). In this post, we highly recommend using the Terminal (CLI) since the GUI settings app might not list specific interfaces.

1. The ifconfig command

This command has long been used to list and configure network interfaces on Linux. Unfortunately, this command is marked as ‘deprecated’ and does not come pre-installed in certain distributions like recent Debian and Kali Linux releases.

To list network interfaces using ifconfig, execute the command below.

Источник

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