Linux name network adapter

Как узнать сетевую карту в Linux

Иногда нужно посмотреть сетевые карты в Linux, подключенные к компьютеру, узнать имя продукта или технические характеристики карты, а также скорость передачи данных. Например, когда вы хотите проверить совместимость сетевого драйвера или модуля ядра с Ethernet адаптером необходимо знать его аппаратные спецификации, такие как: номер модели и производитель, (например: Broadcom NetXtreme, Intel I350), скорость (например: (1 Гбит/сек, 10 Гбит/сек), режим соединения (full/half duplex) и т д.

Также эта информация вам понадобится, если вы хотите подобрать драйвер для своего wifi адаптера. В этой инструкции я расскажу как узнать сетевую карту Linux и посмотреть все доступные ее характеристики.

Информация о сетевой карте с помощью Ethtool

Если вас интересует информация о проводной сетевой карте Ehternet, то вы можете воспользоваться утилитой Ethtool. Это инструмент командной строки для проверки и изменения настроек PCI Ethernet карт. Для установки Ethtool в Ubuntu или Debian используйте команду:

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

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

net

Здесь вы можете посмотреть поддерживаемые режимы работы Supported link modes, скорость Speed и тип коннектора Port, а также состояние подключения. Для просмотра информации о сетевом драйвере и прошивке используйте опцию i:

net1

Здесь вы можете видеть какие режимы поддерживает прошивка, а также ее версию. Если вас интересует MAC адрес выполните:

net2

Информация о сетевой карте в lshw

Во втором способе мы воспользуемся утилитой для отображения подробной информации об аппаратуре Linux — lshw. С помощью нее вы можете посмотреть информацию не только о карте Ethernet, но и о Wifi адаптере, а также посмотреть список сетевых карт.

Для установки lshw на Ubuntu или Debian наберите:

Чтобы посмотреть узнать сетевую карту linux и просмотреть подробные сведения о ней, запустите утилиту со следующими параметрами:

net4

В выводе команды вы увидите все подключенные к системе сетевые интерфейсы, кроме того, тут показывается более подробная информация, чем в выводе предыдущей утилиты. В самом начале вы видите производителя — vendor и имя продукта — product, скорость передачи данных size, а также в разделе configuration можно найти поле driver, где указан используемый драйвер.

Список сетевых карт в lspci

Если вам нужно узнать только продукт и имя производителя вашей сетевой карты можно использовать lspci. Обычно lscpi уже предустановлена в системе, но если нет ее можно установить командой:

sudo apt install pciutils

Читайте также:  Linux top load averages

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

net5

Тут вы можете видеть, что к системе подключены две сетевые карты linux, для проводного интернета и беспроводная, обе от Broadcom.

Информация о сетевой карте с помощью ip

Утилита ip позволяет посмотреть более подробную информацию о сетевом протоколе для вашей карты. Для просмотра информации выполните:

net6

На снимке экрана вы видите две физические сетевые карты linux — wlan0 и eth0, а также два виртуальных устройства. Для каждой из карт можно узнать состояние и MAC адрес.

Выводы

В этой статье мы рассмотрели несколько способов узнать сетевую карту Linux. Вы можете посмотреть не только производителя и название устройства, но и его характеристики, такие как скорость сетевой карты linux, используемый драйвер и MAC адрес. Если у вас остались вопросы, спрашивайте в комментариях!

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

Источник

How to find network card driver name and version on Linux

Question: An Ethernet network interface card is attached to my Linux box, and I would like to know which network adapter driver is installed for the NIC hardware. Is there a way to find out the name and version of a network card driver for my network card?

For network interface card (NIC) hardware to operate properly, you need a suitable device driver for the NIC hardware (e.g., ixgbe driver for Intel NICs). A NIC device driver implements a hardware-independent common interface between the Linux kernel and the NIC, so that packets can be moved between the kernel and the NIC. While some drivers may be statically built in the kernel, most drivers for modern NICs are dynamically loaded as kernel modules.

When you are troubleshooting a NIC hardware problem, one thing you can do is to check whether a correct network adapter driver is installed properly. In this case, you need to know which kernel module is your NIC driver.

There are several ways to find the name/version of an Ethernet card driver on Linux.

Method One: dmesg

The first method is to to check dmesg messages. Since the kernel loads necessary hardware drivers during boot, dmesg output should tell if an Ethernet card driver is installed.

The above output shows that a driver named tg3 is loaded in the kernel.

If you want to know more detail about this driver (e.g., driver version), you can use modinfo command.

If dmesg does not print any information about Ethernet driver, that means no suitable network device driver is available on your system.

Method Two: ethtool

The second method is to use the ethtool command. To find out the driver name for an interface eth0 , run the following.

Method Three: lshw

Another useful tool for NIC driver information is lshw . Type the following command to get detailed information about available Ethernet card(s) and their driver.

In the lshw output, look for the capabilities line, and examine driver and driverversion in the line.

If no suitable NIC driver is installed on your system, the driver field will remain empty.

Читайте также:  Virtual can interface linux

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License. If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

Источник

Find Out Network Adapters Available in Ubuntu Linux

Wondering which network adapters you are using in Ubuntu or any other Linux OS? It is very easy to to find out the manufacturer of the network adapters in your computer in Linux. Open a terminal and use the following command:

If the above command doesn’t work with sudo, remove the super user privileges. Weird but helps. The output of the command reads like this:

Find out network adapter in Linux

*-network
description: Wireless interface
product: BCM4360 802.11ac Wireless Network Adapter
vendor: Broadcom Corporation
physical id: 0
bus info: [email protected]:03:00.0
logical name: wlan0
version: 03
serial: 9c:f3:87:c1:5d:6a
width: 64 bits
clock: 33MHz
capabilities: bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=wl0 driverversion=6.30.223.248 (r487574) ip=192.168.1.23 latency=0 multicast=yes wireless=IEEE 802.11abg
resources: irq:18 memory:b0600000-b0607fff memory:b0400000-b05fffff

As you can see, the wireless network adapter in my Macbook Air is BCM4360, a troublesome wireless adapter because of which often Ubuntu does not detect wireless networks.

lshw command actually used to list hardware in Linux and hence the command is named lshw. With the option network, it filters the result for networking hardware only.

Alternate method to know the network adapter

Alternatively, you can use lspci command that displays the information about PCI buses in the system. You should not need super user privileges to use this command. Just type the command in terminal:

The output of the command reads as:

Find out Network Adapter in Ubuntu command line

00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4)
00:1c.1 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 2 (rev e4)
00:1c.2 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)
00:1c.4 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 5 (rev e4)
00:1c.5 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 6 (rev e4)
00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
02:00.0 Multimedia controller: Broadcom Corporation Device 1570
03:00.0 Network controller: Broadcom Corporation BCM4360 802.11ac Wireless Network Adapter (rev 03)
04:00.0 SATA controller: Marvell Technology Group Ltd. 88SS9183 PCIe SSD Controller (rev 14)

These command gives you information about both wired and wireless network adapters. You might have noticed that there is no wired network adapter for my system in the output above. The reason is that I am using a Macbook Air and it does not have an Ethernet port.

Читайте также:  Oracle linux remi repo

I hope this quick post helped you to find the network adapters in your Linux system. Any questions or suggestions are always welcomed.

Источник

How do I get the name of the network adapter before install, to set it in the autoinstaller config file (Ubuntu 20.04)?

Being before installation how do I know the name of the network adapter before installing it ? Can be used just mac without knowing the device name ?

@Rinzwind the device name ex: «enp025» I need to know it to set it the autoinstall config, or if I don’t have it, maybe use the mac (with match) — regarding mac in docs appear under the name

It is explained in the link: for PCI devices it is «en» + «p» + + «s» + in decimal.

Ubuntu 20? There is no such release. Ubuntu uses yy.mm format (year.month of release) for all server & desktop releases, the yy being used only for IoT and specialist appliance/device releases (also suitable for cloud use) that can use snap packages only. By Ubuntu 20 do you mean Ubuntu Core 20? as it’s a different product to Ubuntu 20.04 LTS (desktop or server).

1 Answer 1

If you delete the network: section from your autoinstall config, then a network config will be generated automatically. This might suit your needs.

default behavior

The networking configuration process is very confusing, but this is the way it seems to work when there is no network: section in the autoinstall config

1

In the installer, cloud-init has a default generic netplan config that is used when nothing is specified. This config matches all physical interfaces.

# This is the initial network config. # It can be overwritten by cloud-init or subiquity. network: version: 2 ethernets: zz-all-en: match: name: "en*" dhcp4: true zz-all-eth: match: name: "eth*" dhcp4: true 

2

Actual interface details are added to the installer filesystem in /etc/cloud/cloud.cfg.d/$.cfg . I believe casper is putting this file in place.

3

When the installer boots cloud-init merges its configuration to create a netplan config for the installer environment. A test VM I tried ends up with

# cat /etc/netplan/50-cloud-init.yaml # This file is generated from information provided by the datasource. Changes # to it will not persist across an instance reboot. To disable cloud-init's # network configuration capabilities, write a file # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following: # network: network: ethernets: ens192: critical: true dhcp-identifier: mac dhcp4: true nameservers: addresses: - REDACTED - REDACTED search: - REDACTED zz-all-en: dhcp4: true match: name: en* zz-all-eth: dhcp4: true match: name: eth* version: 2 

4

The installer, subiquity , creates a config for curtin that only includes the portion of the installer netplan config that relates to actual interfaces.

# cat /var/log/installer/subiquity-curtin-install.conf . write_files: . etc_netplan_installer: . 

5

the installed system (located in /target ) ends up with configuration given to curtin .

# cat /target/etc/netplan/00-installer-config.yaml # This is the network config written by 'subiquity' network: ethernets: ens192: critical: true dhcp-identifier: mac dhcp4: true nameservers: addresses: - REDACTED - REDACTED search: - REDACTED version: 2 

6

At some point, the installer also changes its own configuration to use the installed configuration.

Источник

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