分类:

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
      ............
      ............
   3)ifconfig -a
    [root@localhost /]# ifconfig -a
    eth0 Link encap:Ethernet HWaddr 00:09:6B:09:08:FC
          inet addr:192.168.10.1 Bcast:192.168.10.255 Mask:255.255.255.0
          inet6 addr: fe80::209:6bff:fe09:8fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:106732953 errors:0 dropped:0 overruns:0 frame:0
          TX packets:104379788 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:2351331877 (2.1 GiB) TX bytes:391707945 (373.5 MiB)
          Base address:0x2500 Memory:fbfe0000-fc000000
   eth1   Link encap:Ethernet HWaddr 00:09:6B:09:08:FD
          BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
          Base address:0x2540 Memory:fbfc0000-fbfe0000

4)ethtool

#ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        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
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x000000ff (255)
        Link detected: yes

#ethtool eth1

Settings for eth1:
        Supported ports: [ MII ]
        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
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: Unknown! (0)
        Duplex: Half
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: d
        Current message level: 0x000000ff (255)
        Link detected: no
从上面可以看出eth0 处于连接状态,eth1没有连接

查看Linux下网卡状态或 是否连接的更多相关文章

  1. 查看Linux下网卡状态或 是否连接(转)

      1) 通过mii-tool指令       [root@localhost root]# mii-tool        eth0: negotiated 100baseTx-FD, link o ...

  2. linux下网卡bonding配置(转)

    linux下网卡bonding配置   章节 bonding技术 centos7配置bonding centos6配置bonding 一.bonding技术 bonding(绑定)是一种linux系统 ...

  3. Linux下网卡混杂模式设置和取消

    工作中发现一个网卡工作状态不对了,查看了一下,发现这个网卡和正常工作的网卡  信息不一样,它显示的居然是混杂模式,而正常工作的是  running 模式 ,所以来了解下混杂模式怎么取消... 下文来自 ...

  4. linux下网卡bonding配置

    linux下网卡bonding配置   章节 bonding技术 centos7配置bonding centos6配置bonding 一.bonding技术 bonding(绑定)是一种linux系统 ...

  5. [转载]linux下网卡漂移导致网络不可用

    转自:https://blog.csdn.net/hyatsz/article/details/47690993 linux下网卡漂移导致网络不可用 2015年08月16日 00:48:50 hyat ...

  6. Linux 下网卡参数配置

    目录 Linux 下网卡参数配置 第一种:修改 interfaces 文件 网卡配置实例 回环参数配置 DHCP方式配置 静态 IP 地址分配 无线网卡配置 March 17, 2015 7:48 P ...

  7. 查看Linux下*.a库文件中文件、函数、变量

    查看Linux下*.a库文件中文件.函数.变量等情况在Linux 下经常需要链接一些 *.a的库文件,那怎么查看这些*.a 中包 含哪些文件.函数.变量: 1. 查看文件:ar -t xxx.a 2. ...

  8. Linux下 网卡测速

    参考: How do I verify the speed of my NIC? Linux下 网卡测速 命令: $ sudo ethtool eth0 Settings for eth0: Supp ...

  9. 查看Linux下系统资源占用常用命令

    一 top命令 1.作用top命令用来显示执行中的程序进程,使用权限是所有用户. 2.格式top [-] [d delay] [q] [c] [S] [s] [i] [n] 3.主要参数d:指定更新的 ...

随机推荐

  1. 从汇编看c++中全局对象和全局变量

    先来看c++源码: #include <iostream> using namespace std; class X { public: int i; public: X() : i(ii ...

  2. 从汇编看c++中指向成员变量的指针(一)

    在c++中,指向类成员变量的指针存储的并不是该成员变量所在内存的地址,而仅仅是该成员变量在该类对象中相对于对象首地址的偏移量.因此,它必须绑定到某一个对象或者对象指针上面,这里的对象和对象指针,就相当 ...

  3. 变态最大值(nyoj)

    变态最大值 描述 Yougth讲课的时候考察了一下求三个数最大值这个问题,没想到大家掌握的这么烂,幸好在他的帮助下大家算是解决了这个问题,但是问题又来了. 他想在一组数中找一个数,这个数可以不是这组数 ...

  4. 补丁惹的祸-ContractName Microsoft.VisualStudio.Text.ITextDocumentFactoryService

    未找到与约束ContractName Microsoft.VisualStudio.Text.ITextDocumentFactoryService...匹配的导出 问题: 重新安装了VS2012,结 ...

  5. JSON互转

    http://www.cnblogs.com/undead/archive/2012/07/18/2594900.html 最近在做一个基于JAVA Servlet的WEB应用以及对应的Anroid应 ...

  6. SQL别名解析(转载)

    通过使用 SQL,可以为列名称和表名称指定别名(Alias). 其实,select列的时候取别名有三种方法,这三种方法并不是所有数据库都适用. 方法一.直接在字段名称后面加上别名,中间以空格隔开. 方 ...

  7. qt 自动完成LineEdit

    原地址:http://www.cppblog.com/biao/archive/2009/10/31/99873.html     ---------------------------------- ...

  8. rails跑通第一个demo

    rails -h 查看帮助 Usage: rails new APP_PATH [options] Options: -r, [--ruby=PATH] # Path to the Ruby bina ...

  9. 蜂鸟A20开发板刷 cubietruck 的 SD 卡固件

    美睿视讯 为蜂鸟A20准备的 MerriiLinux 功能非常简陋.所以能用上主流的 debian 或者 LUbuntu 就可以说是非常迫切的需求了.蜂鸟A20(Merrii Hummingbird ...

  10. 【C/C++】Linux下使用system()函数一定要谨慎

    [C/C++]Linux下使用system()函数一定要谨慎 http://my.oschina.net/renhc/blog/53580 曾经的曾经,被system()函数折磨过,之所以这样,是因为 ...