技术改变生活

博客园 首页 新随笔 联系 订阅 管理

ethtool -p DEVNAME   查看相应设备名称对应的设备位置

使用方法如下:
ethtool -p eth0

回车后与eth0 相对应的网卡接口旁边的指示灯就会闪烁,这样你就能很快确定eth0 网口的位置啦。(按下Ctrl+C 结束命令,停止闪烁)

 

 

查看linux下网卡状态是否连接

[root@x101 ~]# ethtool eth1
Settings for eth1:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised pause frame use: No
Advertised auto-negotiation: Yes
Speed: Unknown!
Duplex: Unknown! (255)
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
MDI-X: Unknown (auto)
Supports Wake-on: d
Wake-on: d
Current message level: 0x00000007 (7)
drv probe link
Link detected: no

[root@x101 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
link/ether 00:0c:29:bc:12:d3 brd ff:ff:ff:ff:ff:ff
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 00:0c:29:bc:12:dd brd ff:ff:ff:ff:ff:ff
4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 00:0c:29:bc:12:d3 brd ff:ff:ff:ff:ff:ff
inet 192.168.0.108/24 brd 192.168.0.255 scope global bond0
valid_lft forever preferred_lft forever
inet 192.168.0.110/24 scope global secondary bond0
valid_lft forever preferred_lft forever
inet 192.168.0.112/24 scope global secondary bond0:1
valid_lft forever preferred_lft forever
inet6 fe80::9de8:66ee:bba5:8f9a/64 scope link
valid_lft forever preferred_lft forever

 

posted on 2020-09-02 22:15  小阿峰  阅读(1914)  评论(0编辑  收藏  举报