Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to check the network card information of Linux

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

In this article, the editor introduces in detail "how to view network card information in Linux". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to view network card information in Linux" can help you solve your doubts.

First, the two most straightforward commands, ifconfig and lspci.

1.ifconfig: the most commonly used command to configure and view network interface information. Executing this command on the server will get the following content of the class, where you can see the status and information of multiple devices and devices.

[oracle@mori ~] $ifconfig eth0 Link encap:Ethernet HWaddr 00:0C:29:A4:5A:BF inet addr:192.168.1.160 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fea4:5abf/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1650 errors:0 dropped:0 overruns:0 Frame:0 TX packets:112 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:134000 (130.8 KiB) TX bytes:12228 (11.9 KiB) eth2 Link encap:Ethernet HWaddr 00:0C:29:A4:5A:C9 inet addr:192.168.1.161 Bcast:192.168.1.255 Mask:255.255.255.0 Inet6 addr: fe80::20c:29ff:fea4:5ac9/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1618 errors:0 dropped:0 overruns:0 frame:0 TX packets:88 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:125909 (122.9 KiB) TX bytes:9320 (9.1 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: 1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:182 errors:0 dropped:0 overruns:0 frame:0 TX packets:182 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:10340 (10.0 KiB) TX bytes:10340 (10.0 KiB) 2.lspci | grep-I 'eth' or lspci | grep-I net command: lists the devices on each pci bus After filtering through grep, you can get a list of network card devices. The following article shows that there are two network devices on my pci bus, which are two intel network cards:

[oracle@mori ~] $lspci | grep-I 'eth' 02grep 01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) 02VR 06.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) [oracle@mori ~] $lspci | grep-I net 02grep 01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) 02VR 06.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) 3.iwconfig: used to view wireless network If you have a wireless network card on your device, you can use this command to view it at this time. There is no wireless network card device on my device, so you will get the following information.

[oracle@mori] $iwconfig lo no wireless extensions. Eth0 no wireless extensions. Pan0 no wireless extensions. Eth2 no wireless extensions. Second, in addition to the above commands, there is a mysterious and powerful tool that is mainly used to query and configure network card parameters than the ethtool 1.ethtool command.

two。 Usage: ethtool ethN / / where N is the number of the corresponding network card, such as eth0, eth2, etc.

There are many functions of 3.ethtool, but we will not repeat them here. If you have any requirements and check its instructions page man ethtool, this function can be used in the following scenarios: your server has multiple network cards and has been configured to run, but you do not remember eth0, eth2, eth3 … .. Which physical Nic corresponds to? you can use the following command at this time:

[root@mori oracle] # ethtool-p eth0 will see a light flashing in the physical port corresponding to eth0 at this time, right. This is the network card called eth0 that we saw in the system. It's as simple as that.

After reading this, the article "how to view network card information in Linux" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself to understand it. If you want to know more about related articles, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report