Skip to contentSkip to conversation

catching all packets on an interface

Bridge Scott MacKay 2 participants 3 messages Mar 15, 2008 Ethernet bridge

lore
Share & tools
lore
#0 lore raw

In a simple bridge design, eth0, eth1, bridged to br0, what iptables rules would be needed to capture all of the packets?

It looked like one in PREROUTING/mangle and
POSTROUTING/mangle would do it for all locally
delivered/received and passthru....

-Scott

      ____________________________________________________________________________________

Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs

#1 lore raw

Hello,

by capture I'm guessing you mean match?

With bridges and iptables i normally use physdev

iptables -I FORWARD -m physdev --physdev-in eth0 --physdev-out eth1

Hth,

Matt.

Quoted 18 lines · Scott MacKay

In a simple bridge design, eth0, eth1, bridged to br0, what iptables rules would be needed to capture all of the packets?

It looked like one in PREROUTING/mangle and
POSTROUTING/mangle would do it for all locally
delivered/received and passthru....

-Scott

      ____________________________________________________________________________________

Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
Bridge mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/bridge

Signature · 1 line
Matt Richards
#2 lore raw

Ah great I did not realize you could use physdev on both. My need was to pass all packets which go thru the interface to QUEUE for mangling or at least investigation (so ideally after fragments are recombined and such).

I saw a nice flow diagram
(http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png)
showing the interactions of bridged packets and
normal iptables flow. It *seemed* like prerouting/postrouting caught all local/passthru packets coming in/out of the interface, so maybe:
iptables -I PREROUTING -m physdev --physdev-in eth0 -t mangle -j QUEUE
iptables -I POSTROUTING -m physdev --physdev-out eth0 -t mangle -j QUEUE
?

-Scott

Quoted 11 lines · --- Matt Richards

Hello,

by capture I'm guessing you mean match?

With bridges and iptables i normally use physdev

iptables -I FORWARD -m physdev --physdev-in eth0
--physdev-out eth1

Hth,

Quoted 19 lines

Matt.

Quoted 1 line · Scott MacKay

In a simple bridge design, eth0, eth1, bridged to

br0,

Quoted 1 line

what iptables rules would be needed to capture all

of

Quoted 10 lines

the packets?

It looked like one in PREROUTING/mangle and
POSTROUTING/mangle would do it for all locally
delivered/received and passthru....

-Scott

____________________________________________________________________________________

Quoted 7 lines
Quoted 6 lines

Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
Bridge mailing list
[email protected]

https://lists.linux-foundation.org/mailman/listinfo/bridge

Quoted 7 lines
Signature · 2 lines
-- 
Matt Richards
Quoted 1 line

_______________________________________________

Bridge mailing list
[email protected]

https://lists.linux-foundation.org/mailman/listinfo/bridge

      ____________________________________________________________________________________

Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs