[Bridge] physical interface on a bridge

Jørgen Hovland jorgen at hovland.cx
Fri Feb 24 05:20:22 PST 2006


----- Original Message ----- 
From: "Stephen Hemminger" <shemminger at osdl.org>


>
> The old way is to do ioctl() SIOCDEV_PRIVATE with BRCTL_GET_BRIDGES
> and that gives a table of ifindices, you can use that to map port -> 
> ifindex -> etherdevice
>
> Newer way is to look in directory:
> /sys/class/net/brX/brif
> It has symlinks to the devices that are being bridged.
> /sys/class/net/eth0/brport/port_id
> contains the portid of eth0 in what ever bridge it is in.
>

Works perfectly.
Thanks

Joergen 




More information about the Bridge mailing list