Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the ifconfig command to view the information of the network card in Linux

Shulou Source: shulou.com Published: 2022-06-01 06:34:54 10月05日 Update

This article will explain in detail the information about how Linux uses the ifconfig command to view the network card. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

The Linux ifconfig command is a command that is often used. With this command, we can view the information of the network card and simply configure the network card.

The naming rule of network card under Linux: eth0,eth2. * block Ethernet card, second block. Lo is a loopback interface with a fixed IP address of 127.0.0.1 and a mask of 8 bits. It represents your machine itself.

Ifconfig is to view the information of the network card.

Ifconfig [Interface]

Interface is optional. If this item is not added, information about all network cards in the system will be displayed. If you add this option, the specified Nic information is displayed.

For example: ifconfig eth0

Eth0 Link encap:Ethernet HWaddr 00:0C:29:F3:3B:F2 inet addr:192.168.0.10 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:78 errors:0 dropped:0 overruns:0 frame:0 TX packets:104 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:11679 (11.4 Kb) TX bytes:14077 (13.7 Kb) Interrupt:10 Base address:0x1080

We can see

* Line: connection type: Ethernet (Ethernet) HWaddr (hardware mac address)

Second line: IP address, subnet, mask of the network card

Line 3: UP (for network card on status) RUNNING (network cable for network card is connected) MULTICAST (support for multicast) MTU:1500 (* transmission unit): 1500 bytes

Fourth and fifth elements: statistics of receiving and sending packets

Line 7: receive and send data byte statistics.

This is the end of this article on "how Linux uses ifconfig commands to view network card information". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Tags: Network card information command representative address article byte data more Ethernet statistics good practical five elements Ethernet content unit regular meeting situation interface Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Huawei Redmi Microsoft Shulou Information