Посмотреть доступные сети linux

6 способов просмотреть список сетевых интерфейсов в Debian

Сетевой менеджер часто оказывается в ситуациях, когда ему приходится изменять различные сетевые конфигурации. Для этого ему необходимо знать обо всех доступных сетевых интерфейсах в его системе. Поэтому в этой статье мы расскажем о методах, которые вы можете использовать для составления списка сетевых интерфейсов в Debian.

Вывод списка сетевых интерфейсов в Debian

Для вывода списка сетевых интерфейсов в Debian вы можете воспользоваться любым из шести методов, описанных ниже:

Использование команды ip

Чтобы составить список сетевых интерфейсов в Debian с помощью команды IP, вам нужно выполнить следующие шаги:

Запустите терминал в Debian 11 и введите в нём следующую команду, после чего нажмите клавишу Enter:

Как только эта команда будет успешно выполнена, вы сразу же сможете увидеть все ваши сетевые интерфейсы на терминале, как показано на следующем изображении:

Список IP-адресов

Также вы можете ввести следующую команду в терминале и нажать клавишу Enter:

Вывод вышеупомянутой команды показан на рисунке ниже:

команда ip link show

Использование команды netstat

Для получения списка сетевых интерфейсов с помощью команды netstat в Debian 11, вам нужно выполнить следующие шаги:

Прежде всего, вам нужно запустить терминал в Debian 11. После этого введите в терминале следующую команду и нажмите клавишу Enter:

Если при выполнении этой команды вы получите сообщение об ошибке, то, вероятно, вам нужно установить пакет net-tools перед выполнением этой команды. Это можно сделать, набрав в терминале следующую команду и нажав клавишу Enter:

sudo apt install net-tools

Как только команда netstat будет успешно выполнена, вы сможете увидеть все ваши сетевые интерфейсы на терминале, как показано на рисунке ниже:

команда netstat

Список сетевых интерфейсов с помощью файловой системы /sys

Чтобы составить список сетевых интерфейсов в Debian с помощью команды ls, вам нужно выполнить следующие шаги:

Читайте также:  What is unix and linux operating systems

Запустите терминал в Debian и введите в нём следующую команду, после чего нажмите клавишу Enter:

В результате успешного выполнения этой команды на вашем терминале появится следующее сообщение:

sys class net

Использование команды ifconfig

Для получения списка сетевых интерфейсов с помощью команды ifconfig в Debian, вам нужно выполнить следующие шаги:

Прежде всего, вам нужно запустить терминал в Debian. Затем введите в терминале следующую команду и нажмите клавишу Enter для её выполнения:

Как только эта команда будет успешно выполнена, вы сможете увидеть список всех ваших сетевых интерфейсов в терминале, как показано на рисунке ниже:

Список сетевых интерфейсов с помощью команды ifconfig

Использование команды nmcli для списка сетевых интерфейсов

Чтобы вывести список сетевых интерфейсов в Debian с помощью команды nmcli, вам нужно выполнить следующие шаги:

Запустите терминал в Debian и установите в нём Network Manager, набрав следующую команду и нажав клавишу Enter:

sudo apt install network-manager

Наконец, выполните следующую команду в терминале и нажмите клавишу Enter:

Как только эта команда будет успешно выполнена, вы сможете увидеть все ваши сетевые интерфейсы на терминале, как показано на рисунке ниже:

список nmcli

Использование /proc/net/dev

Чтобы получить список сетевых интерфейсов с помощью команды cat в Debian, вам нужно выполнить следующие шаги:

Прежде всего, вам нужно запустить терминал в Debian 11. Затем введите в терминале следующую команду и нажмите клавишу Enter:

Результат выполнения этой команды показан на рисунке ниже:

Список сетевых интерфейсов

Заключение

Следуя любому из методов, рассмотренных в этой статье, вы можете легко узнать все ваши сетевые интерфейсы. Все эти методы довольно просты и удобны для выполнения. Более того, они будут отлично работать в системах Debian.

Похожие записи:

Источник

How to list network interfaces in Ubuntu

A network interface is a software interface for the networking hardware. In Linux-based systems like Ubuntu, network interfaces are of two types: virtual and physical network interfaces. A simple network hardware device, such as a network interface controller, comes under the category of the physical network interface. Ethernet network card or eth0 is an example of it. On the other hand, a virtual network interface does not have a physical existence but is associated with any physical device. VLANs, bridges, Loopback are examples of virtual network interfaces.

In Ubuntu, you can configure network interfaces at the installation time or after the complete setup of the operating system, whether it is a physical or virtual network interface. To configure network settings via the Ubuntu command line, you must first know how many network interfaces exist on the

Читайте также:  Linux подключить флешку ntfs

machine. This article will show you how to list network interfaces in Ubuntu using five different methods. So let’s get started!

Method 1: How to list network interfaces in Ubuntu using ip command

Linux administrators are familiar with the “ip” command, which is a powerful tool for configuring network interfaces. The “ip” stands for Internet protocol. In Ubuntu, the “ip” command can be utilized to assign and delete addresses and routes, put up or down interfaces, control ARP cache, and more. On all modern network interfaces, “iproute” is the package that contains the “ip” utility.

Now, we will see how we can use the “ip” command for listing the network interface in Ubuntu. For this, we will utilize the “link” option with the “ip” command. This option is used to list out and modify network interfaces:

In the “ip” command, there is another option that can be used for the same purpose. Adding the “address” option in the “ip” command will also show you the list of network interfaces and their IP addresses in the Ubuntu terminal:

Method 2: How to list network interfaces in Ubuntu using nmcli command

The “nmcli” stands for Network Manager Command-Line Tool. In Ubuntu, network status is reported, and the Network Manager is controlled using nmcli. You can also utilize this tool as an alternative to nm-applet and other graphical clients. This command is also used for creating, viewing, deleting, activating, and deactivating network connections.

By using “nmcli”, if you want to list out network interfaces in Ubuntu, then write out the below-given command in your terminal:

Here “device” option will list out the network interfaces, and the “status” will display their current status on the system:

To view the profile of the network interfaces, utilize this command in your terminal:

This command will retrieve the profile information of the network interface from the “/etc/sysconfig/network-scripts” file, comprising connection name as “NAME”, Universal Unique Identifier as “UUID“, network interface type as “TYPE”, and lastly, device name as “DEVICE”:

Читайте также:  Настройка network manager astra linux

Method 3: How to list network interfaces in Ubuntu using netstat command

Network statistics or “netstat” is another utility used in Ubuntu to display network interface statistics, routing tables and monitor incoming and outgoing network connections. This command-line tool is essential for Linux-based systems and network administrators for resolving network-related issues and determining traffic performance.

In the netstat command, the “-i” option is added to list all network interface packet transactions. Execution of the below-given will also you the active network interfaces on your Ubuntu system:

Method 4: How to list network interfaces in Ubuntu using ifconfig command

The kernel-resident network interfaces are configured with the help of “ifconfig” or interface configuration command. This utility is used for setting up the interfaces as needed at boot time. After that, it is typically used only when system tuning or debugging is required. You can also use “ipconfig” command for the assignment of an IP address and netmask to an interface and to enable or disable it.

The below-given command will list out all the network interfaces of your Ubuntu system even if they are not active:

You can also utilize the below-given command for the same purpose:

Method 5: How to list network interfaces in Ubuntu using the “/sys/class/net/” file

The “/sys/class/net/” file contains the names of network interfaces or the network cards on your system. Utilize the “ls” command to list out the network interfaces present in this file:

Conclusion

When you operate as a Linux administrator, you are responsible for managing the system’s network configuration. Both physical and virtual network interfaces can be configured at installation or after setting up the whole Ubuntu system. To make any required changes in the network interface, you must know the information related to network interfaces. This article demonstrated how to list network interfaces in Ubuntu using five different methods. All of the discussed utilities are simple and easy to implement. Try any of them for getting a list of your network interfaces.

About the author

Sharqa Hameed

I am a Linux enthusiast, I love to read Every Linux blog on the internet. I hold masters degree in computer science and am passionate about learning and teaching.

Источник

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