linux檢視有哪些網路卡的方法:1、使用「ifconfig -a」命令檢視;2、使用「cat /proc/net/dev」命令檢視;3、使用「lspci | grep -i 'eth'」或「lspci | grep -i net」命令檢視。
本教學操作環境:linux5.9.8系統、Dell G3電腦。
方法1:使用ifconfig -a
ifconfig: 最常用的設定和檢視網路介面資訊的命令,伺服器上執行此命令會得到類下文的內容,一下內容可看到多個裝置和裝置狀態、資訊。
[root@xuegod65 ~]# ifconfig -a eth0 Link encap:Ethernet HWaddr 00:0C:29:04:08:91 inet addr:192.168.1.250 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe04:891/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14454 errors:0 dropped:0 overruns:0 frame:0 TX packets:961 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1174828 (1.1 MiB) TX bytes:112979 (110.3 KiB) eth1 Link encap:Ethernet HWaddr 00:0C:29:04:08:9B inet addr:192.168.240.1 Bcast:192.168.240.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe04:89b/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:112 errors:0 dropped:0 overruns:0 frame:0 TX packets:90 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:9334 (9.1 KiB) TX bytes:8366 (8.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:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
方法2:使用cat /proc/net/dev
[root@xuegod65 ~]# cat /proc/net/dev Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed lo: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 eth0: 1190124 14635 0 0 0 0 0 0 119423 999 0 0 0 0 0 0 eth1: 9334 112 0 0 0 0 0 0 8366 90 0 0 0 0 0 0
方法3:使用lspci | grep -i 'eth'
或 lspci | grep -i net
可列出每個pci匯流排上的裝置,通過grep過濾後可得到網路卡裝置列表
[oracle@mori ~]$ lspci |grep -i 'eth' 02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) 02:06.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) [oracle@mori ~]$ lspci | grep -i net 02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) 02:06.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
相關推薦:《Linux視訊教學》
以上就是linux怎麼檢視有哪些網路卡的詳細內容,更多請關注TW511.COM其它相關文章!