How to find out if the ethernet cable is plugged into the physical interface without bringing up NIC

219 篇文章 2 订阅

https://access.redhat.com/solutions/1465433

How to find out if the ethernet cable is plugged into the physical interface without bringing up an interface?

 SOLUTION 已验证 - 已更新 2015年十一月26日17:18 - 

English 

环境

  • Red Hat Enterprise Linux
    • 6.x

问题

  • How to check if the ethernet cable is plugged into the physical interface without bringing up an interface?

决议

  • For checking the status of the ethernet cable use ip link command.

1) If the ethernet cable is connected, and it is up also then it will show in the ip link command. Check the output of eth0.

Raw

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 5000
    link/ether 00:16:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:16:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

In this case, eth0 <BROADCAST,MULTICAST,UP,LOWER_UP> is connected , and the status of the ethernet cable is also Up "state UP qlen 5000".

2) If ethernet cable is connected, but it is down then check below output:

Raw

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 5000
    link/ether 00:16:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:16:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff

In this case, eth0 <NO-CARRIER,BROADCAST,MULTICAST,UP> is connected, but the status of the ethernet cable is down.

3) If ethernet cable is not connected,then check below output:

In this nothing will come.

Raw

# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:16:xx:xx:xx:xx brd ff:ff:ff:ff:ff:ff
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值