0
I have a board. This board have two interfaces one eth0
and other usb0
.
eth0
port is connected with network. and usb0
port is connected to another device
With the help of bridge-utils, I am able to set up a software bridge(br0)
over the board with eth0
and usb0
as its elements.
Now my problem is if usb0
side is down or not running, then is there any way to know that usb0 side is down or not working or not running?
I tried using SIOCGIFCONF
ioctl command and SIOCGIFFLAGS(IFF_UP and IFF_RUNNING)
to know whether any interface is down or not running. But with SIOCGIFCONF
I am getting information about only one interface br0 and not about usb0
or eth0
, and br0
is up and working and running.
Any suggestions would be appreciated.
And can't you just the UP status of the interfaces with
ip link show eth0
(same for usb0)? – ott-- – 2013-05-14T15:49:47.680Output of ip link show usb0 when usb0 is not running: # ip link show usb0 2: usb0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master br0 qlen 1000 link/ether c6:df:ac:7a:e0:5d brd ff:ff:ff:ff:ff:ff So with <NO-CARRIER>, ip link is showing that usb0 side is not running. That's ok.
Now my problem is why SIOCGIFCONF ioctl command is not showing all usb0, eth0, br0 interfaces. Why is this ioctl call is only listing only br0 interface. because if it won't list usb0 then i can't diagnose status of usb0. Do i need to use any other ioctl call or some other method. – None – 2013-05-15T07:36:22.217
That ioctl() is obviously no help in that case. I'd suggest a script that extracts the interfaces from a
brctl show
and then queries every interface. – ott-- – 2013-05-15T20:40:23.077