0

I have 5 ethernet interfaces, let's say eth0 to eth4. They're connected on Linux bridge.

I'm trying to force bridge to forward all traffic to eth0 when destination MAC in the packet is not one of eth1,eth2,eth3,eth4 MAC (I have a list of those MACs).

In short:

  • If MAC is in the list -> forward as usual (so between eth1-4).
  • If MAC is NOT in the list -> forward only to eth0.

I've read manuals for bridge-utils and ebtables, even got to second page of Google and can't find the solution.

I found option --among-dst and I think I need something basically in reverse.

But I still didn't find any possibility to force bridge to forward traffic to specific interface.

I'm not really sure how bridge works internally, but I noticed that when destination MAC of the packet is not in bridge table (brctl showmacs), then it broadcasts the packet on all interfaces, hoping that it will come to its destination one way.

Is what I'm trying to do even possible?

0

I noticed that when destination MAC of the packet is not in bridge table (brctl showmacs), then it broadcasts the packet on all interfaces, hoping that it will come to its destination one way.

Yes, and that's how all "learning" bridges work – including physical Ethernet switches.

You can opt out individual ports from this behavior by disabling the flood option (which "Controls whether a given port will flood unicast traffic for which there is no FDB entry") using either bridge(8) or ip-link(8):

bridge link set dev eth1 flood off
ip link set eth3 type bridge_slave flood off

These options cannot be controlled through the obsolete brctl tool.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.