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

What are the commands for viewing the network card in the Linux system

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

Share

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

This article mainly shows you what the Linux system to view the network card commands are, the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor to take you to study and learn the "Linux system view network card commands what are" this article.

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 ethtool1.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.

What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.

The above is about "what are the commands for checking the network card in the Linux system". If this article is helpful to you and you think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to 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: 296

*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