FreeBSD bridge + filtering, BIG problem
yongari at kt-is.co.kr
Wed Dec 1 19:26:01 PST 2004
On Wed, Dec 01, 2004 at 02:20:40PM +0100, Cl?ment MOULIN wrote:
> Pyun YongHyeon wrote:
> >Both pf and ipf can't create *states* in bridge mode. That restriction
> comes from bridge(4). Since pf/ipf couldn't create states it will drop the
> packet when it thinks the packet is in out of TCP window.
> >If you want to use pf/ipf in bridge mode, don't use stateful inspection.
> >One more note: filtering works only for inbound traffics in bridge mode.
> If you're right, it SHOULD really be specified in bridge(4), but I'm not
> very sure about this, since I see states with pfctl and no packets are
> dropped in my case (except maybe in scp from internet to sr01) !
Are you sure you can see *states* with "pfctl -ss"?
Both pf/ipf can't create states since it couldn't see ANY outbound
packets in bridge environments. In jail(fw01), you can see states
since packets go through L3 hook points.
> Finally, I have found the main problem. Both for ipf/pf, I have to set
> sysctl "net.link.ether.bridge.ipf" to 1... That does'nt exists on FreeBSD
> 4X. After that, incoming traffic is filtered (accounting works, blocking
> rules too).
Yes, incoming poackets only in bridged setup.
> We REALLY need to specify this in FreeBSD handbook (sections 14.9 -
> firewalls and 24.5.4 - bridging) and Migration Guide of 5X, since it could
> be a big security hole.
Agreed. We need more clear documentations for pf/ipf in bridge
> My last problem is that scping from sr01 to internet that stalled after
> 144KB exactly (internet to sr01 works) ! This is a pf issue, since it occurs
> only when pf is enabled.
For states created by pf without seeing the first SYN packet, its
connection is fragile. Since pf didn't see options like window scale
pf will drop the connection eventually when it thinks the sequence
number of the packet is in out of TCP window. The duration of the
connection depends on your application/setup etc.
http://www.kr.freebsd.org/~yongari | yongari at freebsd.org
More information about the freebsd-pf