OpenWrt Forum Archive

Topic: br-lan and duplicate MAC address

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

I have two WRT160NL bridged together via OpenVPN, and both br-lan's are getting the same mac address.

br-lan    Link encap:Ethernet  HWaddr 00:03:7F:BF:17:8E

I have tried assigning my own MAC address (22:22:22:22:22:22) on the command line or through /etc/config/network, but I either get no packets passing through, or see local unicast packets flooded across the OpenVPN connection.

Any hints what else to look at?

Also, brctl showmacs does not appear to be implemented. Is it just the command, or is the bridge flooding all packets on all ports by default?

Further experiments give me "tap1: received packet with  own address as source address" even through all MACs are unique, as far as I can tell.

Also, the busybox version of brctl is missing the showmacs command, but the bridge package has it.

After further testing it does look like there might be a bug or two in bridge.

First, the MAC address that get's created depends on the sequence in which network interfaces are created, but is otherwise stable, i. e. you'll get the same one every boot. Seeding /dev/urandom early in the boot (as the first script in /etc/rc.d/S*) does not alter the MAC address at all.

Secondly, changing the MAC address vie ifconfig or network.lan.macaddr does give the appearance of having changed the address (i. e. ifconfig and brctl show show the new address), but packets stop from being received properly, and the original mac address appears to be still used somewhere in the stack, i. e. I'm still getting the "received packet with own address" error, and brctl showmacs shows the old address as a local one.

Not sure how to proceed from here, other than digging into the source.

And I've now checked with Wireshark: the packets on the wire (ethernet) are indeed OK, but things get lost internally. One interesting detail from the Wireshark trace is that the ICMP replies from OpenWrt have their checksum field zeroed. This does not happen when I don't change the MAC address (i.e. when everything is working).

You can see the confusion here:

root@delta:/# ifconfig -a|grep Ether
br-lan    Link encap:Ethernet  HWaddr 02:00:00:00:00:04  
eth0      Link encap:Ethernet  HWaddr 00:23:69:B9:AF:6D  
eth1      Link encap:Ethernet  HWaddr 00:23:69:B9:AF:6E  
wlan0     Link encap:Ethernet  HWaddr 00:03:7F:BF:17:8E  
root@delta:/# brctl show
bridge name    bridge id        STP enabled    interfaces
br-lan        8000.020000000004    no        eth0
                            wlan0
root@delta:/# brctl showmacs br-lan
port no    mac addr        is local?    ageing timer
  2    00:03:7f:bf:17:8e    yes           0.00
  1    00:1d:4f:46:35:d9    no          10.22
  1    00:23:69:b9:af:6d    yes           0.00

Note how ifconfig and brctl show agree on the new, locally administered address I set, but brctl showmacs still has the old, auto-assigned one.

(Last edited by stb on 29 Dec 2009, 12:01)

I've created trac tickets 6423 and 6424.

To finish this off: upgrading to r18957 fixed the root problem, so all the workarounds became unneccessary, and everything is working out of the box.

The discussion might have continued from here.