zoukankan      html  css  js  c++  java
  • Linux服务器查看对应网卡的网口

    服务器装完系统就要配置网络,然而服务器经常是多网卡多网口,我们在某个网口插上网线后,到/etc/sysconfig/network-scripts/下配置ip时无法确定网口对应的配置文件。(比如是eth0还是eth1)

    有的服务器可以用ifdown、ifup来观察网卡指示灯,但是这个方法只对一部分服务器有效。

    目录

    方法一:使用ethtool(在服务器旁)

    方法二:使用mii-tool(不在服务器旁)


    方法一:使用ethtool(在服务器旁)

    如果在服务器旁边则可通过以下命令进行测试:

    ethtool -p eth0

    此时eth0文件对应的网口就会闪烁。(eth0文件就是 /etc/sysconfig/network-scripts/ 目录下以 ifcfg-  开头的文件名的后半部分)

    方法二:使用mii-tool(不在服务器旁)

    如果不在服务器旁而是进行远程操作,那么可使用以下命令进行测试:

    mii-tool eth0

    如果是:eth0: negotiated 100baseTx-FD flow-control, link ok--表明eth0对应的网口已接上网线

    如果是:eth0: no link--表明该网口未接上网线(或网线没接好)

    如果是:SIOCGMIIPHY on 'eth0' failed: No such device--表明没有叫eth0的网口

    来源:http://bbs.chinaunix.net/thread-1953745-1-1.html

       https://blog.csdn.net/u011857683/article/details/83758689

  • 相关阅读:
    P1443 马的遍历
    P1747 好奇怪的游戏
    蜀绣
    Five hundred miles
    如果没有你
    Yellow
    流星

    深入理解计算机中的 csapp,h和csapp.c
    可迭代的集合类型使用foreach语句
  • 原文地址:https://www.cnblogs.com/mefj/p/13573626.html
Copyright © 2011-2022 走看看