Linux系统下查看网卡列表

Linux系统下如果没有安装udev的话,网卡不会以eth0的方式存在于系统里,系统会直接使用BIOS传递过来的设备名作为网卡名称,例如em1之类的。那么如何查看所有网卡的名称呢?

$ cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
 bond0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
   em2:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
   em4:    3587      18    0    0    0     0          0         2    11100      65    0    0    0     0       0          0
  p3p1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
    lo:    3934      64    0    0    0     0          0         0     3934      64    0    0    0     0       0          0
   em1:   15196     117    0   18    0     0          0        19    15865     107    0    0    0     0       0          0
  p3p2:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
   em3:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0
 
$ netstat -i
Kernel Interface table
Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
bond0      1500 0         0      0      0 0             0      0      0      0 BMmU
em1        1500 0       193      0     33 0           144      0      0      0 BMRU
em2        1500 0         0      0      0 0             0      0      0      0 BMU
em3        1500 0         0      0      0 0             0      0      0      0 BMU
em4        1500 0        18      0      0 0            69      0      0      0 BMRU
lo        65536 0       119      0      0 0           119      0      0      0 LRU
p3p1       1500 0         0      0      0 0             0      0      0      0 BMsU
p3p2       1500 0         0      0      0 0             0      0      0      0 BMsU

发表评论

电子邮件地址不会被公开。