2

I have a linux bridge with three interfaces, e.g. tap0, tap1 and tap2. What I would like to do is to modify the standard bridge behavior in the following way:

  • If a L2 broadcast is originated from tap0 then this should only be forwarded to tap2 (tap1 should drop it).

  • If a L2 broadcast is originated from tap1 then this should only be forwarded to tap2 (tap0 should drop it).

  • If a L2 broadcast is originated from tap2 then this should be forwarded to tap0 and tap1 as normal bridges do.

Is it possible to control bridging behavior in this way in linux?

Cheers

Daniel

1 Answer 1

2

Look at ebtables which control forwarding for Linux bridges:

# forward tap0 broadcasts to tap2, do not forward to tap1
ebtables -A FORWARD -i tap0 -o tap2 -d ff:ff:ff:ff:ff:ff -j ACCEPT
ebtables -A FORWARD -i tap0 -o tap1 -d ff:ff:ff:ff:ff:ff -j DROP

# forward tap1 broadcasts to tap2, do not forward to tap0
ebtables -A FORWARD -i tap1 -o tap2 -d ff:ff:ff:ff:ff:ff -j ACCEPT
ebtables -A FORWARD -i tap1 -o tap0 -d ff:ff:ff:ff:ff:ff -j DROP

# forward tap2 broadcasts to tap0 and tap1
ebtables -A FORWARD -i tap2 -o tap0 -d ff:ff:ff:ff:ff:ff -j ACCEPT
ebtables -A FORWARD -i tap2 -o tap1 -d ff:ff:ff:ff:ff:ff -j ACCEPT

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .