zoukankan      html  css  js  c++  java
  • 查看网卡是否连接网线

     

    ubuntu下先要给网卡写好配置:

    auto em3
    iface em3 inet manual
    up ip link set dev $IFACE up
    down ip link set dev $IFACE down

    1. 查看网卡是否连接网线

    [root@PLASPACSHCN13 ~]# mii-tool 
     

    2. 查看指定网卡是否连接网线

    [root@PLASPACSHCN14 ~]# mii-tool em3
    em3: negotiated 1000baseT-FD flow-control, link ok
     

    3. 给网卡配置ip地址,然后ping这个ip地址即可。

    4. [root@PLASPACSHCN14 ~]# ethtool em3

    Settings for em3:
    Supported ports: [ TP ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Half 1000baseT/Full
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Half 1000baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Full
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 1
    Transceiver: internal
    Auto-negotiation: on
    MDI-X: off
    Supports Wake-on: g
    Wake-on: d
    Current message level: 0x000000ff (255)
    drv probe link timer ifdown ifup rx_err tx_err
    Link detected: yes

    注:

    “Link detected: yes”  这个表示已连接网线。

    如果没有配置好网卡,会导致返回"Link detected: no"
     
    参考:http://blog.chinaunix.net/uid-15866552-id-3483122.html
  • 相关阅读:
    华为鲲鹏服务器测试
    gcc反汇编测试
    信息安全系统设计与实现:第五章学习笔记
    C语言实现ls之myls改进
    C语言编程实现mystat
    基于openEuler的OpenSSL编译安装和编程实践
    团队作业(三):确定分工
    centos的网络配置及克隆操作要点
    Flink特点分析
    机器学习之线性回归模型
  • 原文地址:https://www.cnblogs.com/pinganzi/p/5826469.html
Copyright © 2011-2022 走看看