OpenWrt Forum Archive

Topic: showmacs option not available for the brctl command of the bridge

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

showmacs option not available for the brctl command of the bridge

I have downloaded the trunk 13899.

Any idea?

Showmacs is not available with the brctl provided by the busybox
The brctl shuld be removed from the busybox and the brctl provided by the package "bridge" should be used
Davide

Hi

I used the bridge package available under network utilities in make menuconfig. brctl is not shwoing up.

brctl which is avaible in busybox is working as expected, the bridge is configured, but it doesn't forward any packets.

I am using the lastest OpenWrt verison with 4.4.14 linux kernel version.

Please see the brctl show result.

brctl show

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

I can ping the br-lan from a host pc connected using an ethernet wire, but unable to ping eth0 and wlan0.

Please tell me how to reslove this issue.

I disabled the Firewall, still it didn't work as expected.


Thanks
Vamsi

"Ping wlan0" makes no sense.  You would ping a device that is connected to wlan0.  You should be able to do that from a device on Ethernet, from inside the router, or from another wifi device, because they're all bridged together.

What I mean is a device connected to a wlan0 interface, but instead of going to that point, I want to do a basic testing to check the bridge configuration is working or not, so I tried to ping the eth0 interface from a host pc which is connected using an ethernet wire (interfaces are all in the same subnet). The PC couldn't able to reach to the eth0 interface, but it can reach the Br-lan interface. I hope you got it, what I am trying to do.

        ethernet
PC --------------->OpenWrt(MinnowBoard turbot).
 

ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:08:A2:09:F7:63
          inet addr:192.168.3.1  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fda1:1333:71fb::1/60 Scope:Global
          inet6 addr: fe80::208:a2ff:fe09:f763/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1220 errors:0 dropped:72 overruns:0 frame:0
          TX packets:101 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:95412 (93.1 KiB)  TX bytes:11362 (11.0 KiB)

eth0      Link encap:Ethernet  HWaddr 00:08:A2:09:F7:63
          inet addr:192.168.3.10  Bcast:192.168.3.255  Mask:255.255.255.0
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:75582 errors:0 dropped:5 overruns:0 frame:0
          TX packets:11269 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9900135 (9.4 MiB)  TX bytes:1543904 (1.4 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:118 errors:0 dropped:0 overruns:0 frame:0
          TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:11820 (11.5 KiB)  TX bytes:11820 (11.5 KiB)

wlan0     Link encap:Ethernet  HWaddr 00:03:7F:87:86:69
          inet6 addr: fe80::203:7fff:fe87:8669/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1166 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:127392 (124.4 KiB)

The interfaces that are in a bridge should not have their own IP addresses.  The IP(s) are attached the br-lan itself. Anything that comes into br-lan will automatically go out eth0 or wlan0 or both depending on the internally collected MAC address table.  It works a lot like an unmanaged Ethernet switch -- just turn it on there is no need to explicitly configure, it just works.

Thank you for the reply smile.
I know that we shouldn't assign IP addresses to the bridge interfaces, I only did that for testing. There is no point to do a ping test to the device connected to the wlan0 interface if the bridge fails to forward the packet from the wired interface to the internal bridge interface (In my case, from br-lan to eth0, I did ping from a host PC).
I know how a bridge or a switch works, the issue here is the bridge is not forwarding the packets, I know it will forward to one of the egress ports based on the rules  (MAC or any other tables).  The brctl utils doesn't have showmac option to cross verify the MAC address in tables collected based on ARP or using the other protocol, I am using the busy box brctl package.
The bridge is not working as expected, I want to know whether I have to do anything special in OpenWrt to make the bridge working.

You don't have to do anything special.   The brctl show shows a regular bridge.  The ifconfig status shows no data received on wlan0, perhaps there is a wifi configuration problem.

The only reference you should have to eth0 anywhere in your configs is to put it in the LAN bridge in /etc/config/network.

config interface 'lan'
    option type 'bridge'
    option ifname 'eth0'
        option proto 'static'
...

Then in the /etc/config/wireless connect the AP to the lan as well

config wifi-iface
        option mode 'ap'
        option device 'radio0'
        option network 'lan'
...

The IP address you put in the lan config will apply to both eth0 and wlan0.  The handle to a bridge is the br-lan device. 

When "slaves" of a bridge, the hardware interfaces become mere media converters that take a packet and copy it over.  They are no longer independent things that can have an IP address or respond to a ping.

(Last edited by mk24 on 2 May 2017, 20:42)

If you want to see the MAC addresses on each port of the bridge (which is what showmacs does). Check out this shell function:

https://pastebin.com/8JWX5ETx

The discussion might have continued from here.