免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1277 | 回复: 0
打印 上一主题 下一主题

FAQ:如何查看Linux下网卡是否连接(UP)? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-08 16:55 |只看该作者 |倒序浏览
FAQ:如何查看Linux下网卡是否连接(UP)?
    //如何不到服务器端,通过指令判断Linux的网卡是否已经连接到网络并为UP状态。有的人用ifconfig -a 查网卡已经配置的正确的IP地址,可是就是ping不能网络,到机房一看网线没接,^@^! 网络不通 会有好多原因,但最先查的就是网卡的网络是还已连接并UP。就像办公室的MM喊着说上不了网

,结果“本地连接”都是“X”的一样的情况。
   本FAQ将帮助您如何不到服务器端,通过指令判断Linux的网卡是否已经连接到网络并为UP状态!
ASK:
   1)  通过mii-tool指令
       [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
      Currently active devices:
      lo eth0

      ............
      ............
     
本文来自ChinaUnix博客,如果查看原文请点:
http://blog.chinaunix.net/u2/71257/showart_973425.html


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/73112/showart_1076221.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP