我的服务器的一个网络端口出现了异常行为。它似乎无法处理/响应任何流量(ping 等)。以下是使用“ifconfig”(分配的静态地址为 10.100.0.80)列出的内容
eth0 Link encap:Ethernet HWaddr 00:18:7D:0E:53:8B
inet addr:10.100.0.80 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::218:7dff:fe0e:538b/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:802 errors:0 dropped:799 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:57099 (55.7 KiB) TX bytes:2410880 (2.2 MiB)
Interrupt:16
存在大量“TX 字节”。如果此端口直接连接到另一台机器,TX 字节将继续快速增加,Wireshark 会获取以下内容。
唯一没有乱七八糟的数据包是偶尔从我的笔记本电脑发出的数据包(如数据包 28)。我不确定这些 MAC CTRL 数据包是什么,或者这是否是其他东西的副作用。
以下是 K12 文本格式的捕获。
+---------+---------------+----------+
14:59:22,793,169 ETHER
|0 |01|80|c2|00|00|01|00|18|7d|0e|53|8b|88|08|00|01|1f|ff|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|
+---------+---------------+----------+
14:59:22,797,366 ETHER
|0 |01|80|c2|00|00|01|00|18|7d|0e|53|8b|88|08|00|01|1f|ff|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|
+---------+---------------+----------+
14:59:22,801,559 ETHER
|0 |01|80|c2|00|00|01|00|18|7d|0e|53|8b|88|08|00|01|1f|ff|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|00|
无论端口设置为获取 DHCP 地址(尽管位于 DHCP 服务的网络上,但无法获取)还是静态地址,似乎都会发生这种情况。
它在安装 CentOS 6.6 OS(以单用户模式启动并正常启动)和使用 CentOS 6.8 启动到实时 CD/USB 时都会发生这种情况,因此不确定这是否是 CentOS 6.X 特有的问题,尽管到目前为止还没有发生过这种情况。同一台服务器有第二个以太网 (eth1) 端口,似乎运行正常。
ETA ethtool 输出与 grawity 建议的一致,eth0 是故障端口
ethtool eth0
Settings for eth0:
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/Half 1000baseT/Full
Link partner advertised pause frame use: Symmetric
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: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes
ethtool eth1
Settings for eth1:
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: No
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: g
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes
没发现什么不对劲的地方?我会用 ethtool 查看暂停帧。
答案1
“暂停”帧有时用于以太网级流量控制。
您可以看到它们的使用情况以及速度正在协商中ethtool
。这里奇怪的是,eth0 声称不支持暂停帧,但提供它们的用途反正:
Settings for eth0:
Supported pause frame use: No <- what eth0 supports
Advertised pause frame use: Symmetric <- what eth0 offers
Link partner advertised pause frame use: Symmetric <- what your switch offers
当然,除非网卡正在接收大量数据,否则它不应该发送暂停帧——显然,如果它说不支持暂停帧,那它就不应该发送它们根本...
尝试使用以下方法禁用它ethtool -A eth0 rx off tx off
(这可能是驱动程序错误,也可能是硬件问题;我不知道。)或者,禁用流量控制在开关上该特定端口。