Linux : How to display the physical connection state on network interface

By | July 24, 2012

To detect if there is a link or not on network interface without any physical intervention, simply run the following command :

cat /sys/class/net/<interface_name>/carrier

This command should return ” 0 ” or ” 1 “. Of course, 0 mean disconnected and 1 connected.