OpenWrt Forum Archive

Topic: [RESOLVED] [12.09-rc1][brctl][busybox] MAC / STP show commands

The content of this topic has been archived on 10 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

brctl appears to be missing a number of show commands documented, for example, here:

http://www.tldp.org/HOWTO/BRIDGE-STP-HO … ridge.html

Currently, brctl on my router permits the following:

[root @ OpenWrt] ~ # brctl --help
BusyBox v1.19.4 (2012-11-18 02:19:39 UTC) multi-call binary.

Usage: brctl COMMAND [BRIDGE [INTERFACE]]

Manage ethernet bridges

Commands:
        show                    Show a list of bridges
        addbr BRIDGE            Create BRIDGE
        delbr BRIDGE            Delete BRIDGE
        addif BRIDGE IFACE      Add IFACE to BRIDGE
        delif BRIDGE IFACE      Delete IFACE from BRIDGE
        setageing BRIDGE TIME           Set ageing time
        setfd BRIDGE TIME               Set bridge forward delay
        sethello BRIDGE TIME            Set hello time
        setmaxage BRIDGE TIME           Set max message age
        setpathcost BRIDGE COST         Set path cost
        setportprio BRIDGE PRIO         Set port priority
        setbridgeprio BRIDGE PRIO       Set bridge priority
        stp BRIDGE [1/yes/on|0/no/off]  STP on/off

Is this a bug, or can someone confirm if brctl is only partially implemented?  Others in the forum seem to be able to run "brctl showmacs IFACE" without issue.

++++
EDITS
++++
* Edited heading tags and subject as issue is not platform or architecture specific

(Last edited by jeremy.moschner on 28 Feb 2013, 11:01)

It is only partially implemented.

I have a TP-Link WDR3600 which (from I've read) only differs in the wireless. I guess OpenWrt added more commands somewhere after RC1. I am running a self-compiled Gargoyle firmware:

| Gargoyle version 1.5.X    | OpenWrt Attitude Adjustment branch |
| Gargoyle revision 94308d0 | OpenWrt revision r35153            |
| Built February 03, 2013   | Target  ar71xx/usb_large   

I have working:
brctl show
brctl showmacs br-lan
brctl showstp br-lan

not working:
brctl showbr br-lan
never heard of command [br-lan]

Thanks jow.

I see that you've performed some recent commits to busybox, so I'll take your word on it smile

I take it that this was a change inherited from an upstream regression in busybox itself?

Would there be a way to obtain similar output by some other means?  Specifically, to expose the following:

1. Per bridge, the ageing time, forward delay, hello time, max message age, path cost, port priority and bridge priority. These are all variables which can be changed currently by brctl.

2. The values of bridge's state (eg. forwarding, listening etc - (perhaps through dmesg?)) and root port.

3. Per port, the learned mac addresses, locality and ageing timer.

Install the full "bridge" package if you're interested in these values.

Is there not some overlap between the binaries in busybox and the bridge package?

[root @ OpenWrt] ~ # opkg install bridge
Installing bridge (1.5-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/packages//bridge_1.5-1_ar71xx.ipk.
Collected errors:
 * check_data_file_clashes: Package bridge wants to install file /usr/sbin/brctl
        But that file is already provided by package  * busybox
 * opkg_install_cmd: Cannot install package bridge.


[root @ OpenWrt] ~ # ls -l /usr/sbin/brctl
lrwxrwxrwx    1 root     root            17 Nov 18 15:27 /usr/sbin/brctl -> ../../bin/busybox

Would I need to remove busybox and replace its functionality through equivalent standalone packages?

Yes there's some overlap. The existing /usr/sbin/brctl is just a symlink to the busybox binary, run "rm /usr/sbin/brctl" then retry the install. To restore the original symlink run "ln -s ../../bin/busybox /usr/sbin/brctl".

Ok. I will try this out tonight and confirm.

Confirmed - working now and changes persist after reboot.  Thanks jow for your assistance.

For future reference, here are the steps I took to get this to work.

1. Update opkg

[root @ OpenWrt] ~ # opkg update
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/packages//Packages.gz.
Inflating http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/packages//Packages.gz.
Updated list of available packages in /var/opkg-lists/attitude_adjustment.

2. Remove the symbolic link to busybox

[root @ OpenWrt] ~ # rm /usr/sbin/brctl

3. Install the bridge package (using --force-overwrite only if required)

[root @ OpenWrt] /usr/lib/opkg # opkg install bridge --force-overwrite
Installing bridge (1.5-1) to root...
Downloading http://downloads.openwrt.org/attitude_adjustment/12.09-rc1/ar71xx/generic/packages//bridge_1.5-1_ar71xx.ipk.
Configuring bridge.

The following options are now presented using brctl

[root @ OpenWrt] /usr/lib/opkg # brctl 
Usage: brctl [commands]
commands:
        addbr           <bridge>                add bridge
        delbr           <bridge>                delete bridge
        addif           <bridge> <device>       add interface to bridge
        delif           <bridge> <device>       delete interface from bridge
        hairpin         <bridge> <port> {on|off}        turn hairpin on/off
        setageing       <bridge> <time>         set ageing time
        setbridgeprio   <bridge> <prio>         set bridge priority
        setfd           <bridge> <time>         set bridge forward delay
        sethello        <bridge> <time>         set hello time
        setmaxage       <bridge> <time>         set max message age
        setpathcost     <bridge> <port> <cost>  set path cost
        setportprio     <bridge> <port> <prio>  set port priority
        show            [ <bridge> ]            show a list of bridges
        showmacs        <bridge>                show a list of mac addrs
        showstp         <bridge>                show bridge stp info
        stp             <bridge> {on|off}       turn stp on/off

(Last edited by jeremy.moschner on 1 Mar 2013, 13:52)

I should also add that a subsequent sysupgrade will require the same steps as above to install the bridge package.

However, a force option should not be required if the symbolic link from /usr/sbin/brctl is removed first.

Hi

Brctl command doesn't show up all the commands, I am using the Busybox version.

brctl --help
BusyBox v1.24.2 () multi-call binary.

Usage: brctl COMMAND [BRIDGE [INTERFACE]]

Manage ethernet bridges

Commands:
        show                    Show a list of bridges
        addbr BRIDGE            Create BRIDGE
        delbr BRIDGE            Delete BRIDGE
        addif BRIDGE IFACE      Add IFACE to BRIDGE
        delif BRIDGE IFACE      Delete IFACE from BRIDGE
        setageing BRIDGE TIME           Set ageing time
        setfd BRIDGE TIME               Set bridge forward delay
        sethello BRIDGE TIME            Set hello time
        setmaxage BRIDGE TIME           Set max message age
        setpathcost BRIDGE COST         Set path cost
        setportprio BRIDGE PRIO         Set port priority
        setbridgeprio BRIDGE PRIO       Set bridge priority
        stp BRIDGE [1/yes/on|0/no/off]  STP on/off

When I try to install the bridge package using opkg, it says "* opkg_install_cmd: Cannot install package bridge".
I have an internet connection and I also update to the latest version using opkg update.

Please tell me how to get the bridge working.

brtcl show gives the following result

brctl show
bridge name     bridge id               STP enabled     interfaces
br-lan          7fff.0008a209f763       no              eth0
                                                                             wlan0

When I try to ping the eth0 interface from a host computer which is conected using an ethernet, it doen't reach to the eth0 interface. Both are in the same subnet.

Please tell me if any know how to reslove this issue.

Thanks
Vamsi

The discussion might have continued from here.