说明: 重启网卡会造成短暂的网络断开,大概丢失6个ping包。30秒吧。
1. 查看网卡是否连接网线
[root@PLASPACSHCN13 ~]# mii-tool
2. 查看指定网卡是否连接网线
[root@PLASPACSHCN14 ~]# mii-tool eth0
eth0: negotiated 100baseTx-FD, link ok
3. 给网卡配置ip地址,然后ping这个ip地址即可。
4. [root@PLASPACSHCN14 ~]# ethtool eth1
Settings for eth1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
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
Speed: Unknown!
Duplex: Unknown! (255)
Port: Twisted Pair
PHYAD: 2
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown
Supports Wake-on: g
Wake-on: g
Current message level: 0x000000ff (255)
Link detected: no
“Link detected: no” 这个表示没有连接网线。