How to find out the connected state of a network cable in Linux


You may also like...

  • helloworld

    ip a
    eth0: mtu 1500 qdisc mq state UP group default qlen 1000
    eth1: mtu 1500 qdisc noop state DOWN group default qlen 1000

  • TheRealTachyon

    Since not everyone has yet been plagued with yet another ridiculous systemd related change in long standing conventions, you should mention that the odd looking network device names in your examples are only for Linux distributions that have migrated to systemd’s “Predictable Network Interface naming” standard which throws out the “eth0” and “wlan0” type device names we’ve been using everywhere for decades.

    Another way to check for cable connection is, (from a root shell):
    Look for “UP” in the output after the device you want to check (eg eth0)