Network card cable connection query

Tomasz Torcz tomek at crocom.com.pl
Mon Sep 29 07:30:43 UTC 2008


Dnia 2008-09-25, czw o godzinie 11:15 +0100, Dan Track pisze:
> Hi
> 
> Is there a way to identify whether a network card has a rj45 cable
> plugged into it from linux?
> 

  For checking if cable is plugged:
% cat /sys/class/net/ep0/carrier  
1

  For checking, if it's RJ45 -- ioctl() that ethtool uses to check used
port (you can also use ioctl() to check if link is detected).

  For checking if cable is plugged and there is valid network
configuration -- ask NetworkManager, I think.
-- 
Tomasz Torcz




More information about the fedora-list mailing list