mii-tool
一般使用mii-tool可以设置以太网设备,使用它还可以显示当前的设置信息。
mii-tool -v em1
em1: negotiated 1000baseT-FD flow-control, link ok
product info: vendor 00:d8:97, model 54 rev 0
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-controlethtool
ethtool与mii-tool类似,可以提供更多的配置选线和设备统计信息显示。
ethtool em1
Settings for em1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised pause frame use: Symmetric
Advertised auto-negotiation: Yes
Link partner advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Link partner advertised pause frame use: Symmetric Receive-only
Link partner advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 1
Transceiver: internal
Auto-negotiation: on
MDI-X: off
Supports Wake-on: g
Wake-on: d
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yesifconfig
ifconfig用来安装和配置网络接口,同时提供系统中网络设备的基本性能统计信息,基于这些统计信息可以基本确定每个网络设备的健康状况和性能情况。 ifconfig提供的数据是自系统启动开始的累计值。
ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.10.200.31 netmask 255.255.255.0 broadcast 10.10.200.255
inet6 fe80::3c41:204f:bb6a:32cf prefixlen 64 scopeid 0x20<link>
inet6 fe80::1212:5fb1:ad46:6dc0 prefixlen 64 scopeid 0x20<link>
inet6 fe80::899d:dd4d:bcf5:af9f prefixlen 64 scopeid 0x20<link>
ether 52:54:00:f6:20:04 txqueuelen 1000 (Ethernet)
RX packets 37181529 bytes 60072792766 (55.9 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 29861642 bytes 11325730097 (10.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 5023286 bytes 4597022868 (4.2 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5023286 bytes 4597022868 (4.2 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0- RX packets: 设备已经接受的数据大小
- RX errors: 接收时的错误数
- dropped: 发送或接收时丢弃的数据包数
- overruns: 当网络设备没有足够的缓冲区来发送或接收数据包的次数
- frame: 底层以太网桢错误的数量
- TX packkes: 设备已经发送的数据大小
- TX errors: 发送时的错误数
ip
ip是用来取代ifconfig的新命令,可以对Linux网络进行多方面的配置,同时也可以显示网络设备的性能统计信息。
例如ip link或ip -s link显示所有网络设备更加详细的统计信息,也是从系统启动开始的总的统计数据。