查看网卡是否连接网线
ubuntu下先要给网卡写好配置:
auto em3
iface em3 inet manual
up ip link set dev $IFACE up
down ip link set dev $IFACE down
1. 查看网卡是否连接网线
[root@PLASPACSHCN13 ~]# mii-tool2. 查看指定网卡是否连接网线
[root@PLASPACSHCN14 ~]# mii-tool em3em3: negotiated 1000baseT-FD flow-control, link ok
3. 给网卡配置ip地址,然后ping这个ip地址即可。
4. [root@PLASPACSHCN14 ~]# ethtool em3
Settings for em3:
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: d
Current message level: 0x000000ff (255)
drv probe link timer ifdown ifup rx_err tx_err
Link detected: yes
注:
“Link detected: yes” 这个表示已连接网线。