2 interfaces on a bridge with same MAC address

/etc/config/network

config interface 'public_essid'
	option	type	'bridge'
	option	ifname	'eth1.2766'
	option	proto	none

/etc/config/wireless

config wifi-iface 'public'
	option	device		'radio0'
	option	network		'public_essid'
	option	mode		ap
	option	ssid		'Public'
	option	encryption	none
	option	isolate		1
root@OpenWrt:~# ip address
[...]
9: br-public_essid: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
	link/ether c0:4a:00:9d:80:93 brd ff:ff:ff:ff:ff:ff
	inet6 fe80::c24a:ff:fe9d:8093/64 scope link
		valid_lft forever preferred_lft forever
10: eth1.2766@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-public_essid state UP qlen 1000
	link/ether c0:4a:00:9d:80:93 brd ff:ff:ff:ff:ff:ff
17: wlan0-1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-public_essid state UP qlen 1000
	link/ether c2:4a:00:9d:80:92 brd ff:ff:ff:ff:ff:ff
	inet6 fe80::c04a:ff:fe9d:8092/64 scope link
		valid_lft forever preferred_lft forever
[...]

We have a bridge with 3 interfaces (or a switch with 3 ports). How can 2 of them (br-public_essid and eth1.2766) share a single MAC address of c0:4a:00:9d:80:93 and work? As far as I know all interfaces in the same broadcast domain cannot have duplicated MAC.

But eth1.2766 is member of the br-public_essid bridge.

A bridge assumes a MAC address of one of the interfaces.

wlan0-1 is a member of that bridge, too. I too lazy to try, but I'm pretty sure if I change the MAC of that wireless interface to the same with the other 2, it won't work. When a packet arrive at eth1.2766 with the destination MAC of c0:4a:00:9d:80:93, the bridge will not know where to forward it, as both br-public-essid and wlan0-1 now have that address.

Which interface does the CPU use, eth1.2766 or br-public-essid? I guess the CPU uses br-public-essid to communicate with the bridge, while the eth1.2766 is used by bridge to communicate with the outside. If that is true, I think eth1.2766 is a dumb port for data to flow through, and does not really have a MAC - no data is supposed to be sent from or ended up at that port.

The ports don't really have a MAC. They are "enslaved" to the bridge interface which is the real interface. If a packet arrives on any port with the destination MAC of the bridge, the CPU takes it, it's the final destination.

Overall it works like an unmanaged switch with the CPU plugged into one of the ports.

4 Likes