I want to check if a specified ethX is physically up or down. How do I do that with the command line?
|
For example:
provides:
|
||||
|
|
|
Check As far as I know this is specific to Linux 2.6 but provides a clean interface to the kernel driver. |
|||||||||
|
|
last line shows what you want:
# ethtool eth0
Settings for eth0:
Supported ports: [ TP ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: g
Wake-on: d
Current message level: 0x00000037 (55)
Link detected: yes
|
|||||
|
is another. Good old
or
will also tell you if the interface is up |
|||||||||||||
|
you should see all statuschanges |
|||||||||||||
|
|
You can also use mii-tool to see if the link is up and check the negotiated speed.
|
|||||||||||||
|
|
If your system is using
or a specific interface (e.g. eth0):
|
|||
|
|
|
netplugd is a service that can run program(s) when a cable is plugged in or a cable taken out. So the command line would be to grep /var/log/messages or dmesg for netplugd output. |
|||||
|
|
To quickly add to @goo's answer, you would interpret the This is a port which is administratively up, but physically down:
In other words, the This is a port that is administratively down (its physical layer is 'up', technically - it is a VM):
Finally, this port is working normally:
It is administratively |
||||
|
|
|
You can have full details with below command
And if you just want to see link status the give below command
|
||||
|
|