如何查看Linux下网卡是否连接(UP)?

2024-12-03 13:52:17
推荐回答(1个)
回答1:

有的人用ifconfig -a 查网卡已经配置的正确的IP地址,可是就是ping不能网络,到机房一看网线没接,^@^! 网络不通 会有好多原因,但最先查的就是网卡的网络是还已连接并UP。就像办公室的MM喊着说上不了网,结果“本地连接”都是“X”的一样的情况。 [root@localhost root]# mii-tool eth0: negotiated 100baseTx-FD, link ok eth1: no link或[root@localhost root]# mii-tool -v eth0: negotiated 100baseTx-FD, link ok product info: vendor 00:50:43, model 2 rev 3 basic mode: autonegotiation enabled basic status: autonegotiation complete, link ok capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD eth1: no link product info: vendor 00:50:43, model 2 rev 3 basic mode: autonegotiation enabled basic status: no link capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control或[root@localhost root]# mii-tool -w 21:20:33 eth0: negotiated 100baseTx-FD, link ok 21:20:33 eth1: no link //mii-tool主要是用于配置网卡工作模式的指令,同时也可以进行查询、监控等工作!2)[root@localhost /]# /etc/init.d/network status Configured devices: lo eth0 eth1 Currently active devices:lo eth0等同于[root@localhost root]# service --status-all Configured devices: lo eth0 eth1