Linux Netfilter discussions
 help / color / mirror / Atom feed
* ebtables brouting of all tcp and udp traffic
@ 2008-07-15  7:26 Arnaud MARTIN
  2008-07-15  9:25 ` Arnaud MARTIN
  0 siblings, 1 reply; 2+ messages in thread
From: Arnaud MARTIN @ 2008-07-15  7:26 UTC (permalink / raw)
  To: netfilter

I have created a bridge on my server and I would like to bridge only the protocols other than tcp and udp. For these protocols I have an application running on the box that is listening in promiscuous mode to catch these packets. 
The application is only interested in the packets not directly destined to the server itself.

I'm using the scrpt below to realize that:

MAC_OF_BR0=<MAC of my bridge>

ebtables -t broute --flush
ebtables -t broute -A BROUTING -d $MAC_OF_BR0 -p ipv4 -j redirect --redirect-target DROP
ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp -i eth0 -j DROP
ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp -i eth1 -j DROP
ebtables -t broute -A BROUTING -p ipv4 --ip-proto udp -i eth0 -j DROP
ebtables -t broute -A BROUTING -p ipv4 --ip-proto udp -i eth1 -j DROP

So far the brouting seems to work but as soon as I run this script, I'm not able to ssh to the server anymore. Also my application running on the server, has to connect to other server in the same configuration but it is not able to do it anymore. This is the reason why I added the 2nd line in the script but it doesn't work.

To sum up I need to broute all udp and tcp traffic, except the traffic destined to the bridge IP/interface.
How can I do it ?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ebtables brouting of all tcp and udp traffic
  2008-07-15  7:26 ebtables brouting of all tcp and udp traffic Arnaud MARTIN
@ 2008-07-15  9:25 ` Arnaud MARTIN
  0 siblings, 0 replies; 2+ messages in thread
From: Arnaud MARTIN @ 2008-07-15  9:25 UTC (permalink / raw)
  To: netfilter

I think I found the solution. I just needed to replace the 2nd rule by:

ebtables -t broute --flush
ebtables -t broute -A BROUTING -d $MAC_OF_BR0 -j ACCEPT
ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp -i eth0 -j DROP
ebtables -t broute -A BROUTING -p ipv4 --ip-proto tcp -i eth1 -j DROP
ebtables -t broute -A BROUTING -p ipv4 --ip-proto udp -i eth0 -j DROP
ebtables -t broute -A BROUTING -p ipv4 --ip-proto udp -i eth1 -j DROP

Like that the traffic directed to the server itself will be processed by the bridge "as normal" and not be brouted.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-07-15  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-15  7:26 ebtables brouting of all tcp and udp traffic Arnaud MARTIN
2008-07-15  9:25 ` Arnaud MARTIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox