具体代码如下
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