ipfilter problems

Angelin Lalev lalev at sv-bg.com
Sat Apr 2 01:28:42 PST 2005


Two days ago I've switched the firewall on my FreeBSD 5.3 RELEASE
router from ipfw to ipfilter.  The  firewalls are not my speciality
and ipfilter looked simplier way to do NAT with firewall, because
it separates NAT rules from filtering rules.

The router has two interfaces rl0 (192.168.0.254/24) and rl1 
(82.137.64.106/29, 192.168.5.1/24, 10.1.6.2/24).
The ipfilter is compiled in kernel:
======================
options IPFILTER
options IPFILTER_LOG
options IPFILTER_DEFAULT_BLOCK

/etc/ipnat.conf
============
map rl1 192.168.0.1/27 -> 82.137.64.106/32

/etc/ipf.rules
============
pass in quick on lo0
pass out quick on lo0
pass out quick on rl0 all
pass in quick on rl0 all
pass in quick on rl1 proto tcp from 192.168.5.1/24 to 192.168.5.1 port = 
80 flags S keep state
pass in quick on rl1 proto tcp from 192.168.5.1/24 to 192.168.5.1 port = 
3128 flags S keep state
# local counter-strike server. No NAT.
pass in quick on rl1 from 192.168.5.1/24 to 192.168.0.50 keep state
block in quick on rl1 from 192.168.5.1/24 to any
pass out quick on rl1 all keep state

The problem
========
On 192.168.0.0/24 network I have 6 machines. The router itself is an old
166 MHz Pentium box, but load averages are not bigger than 10%. When one 
of the machins makes dns lookup (the dns server is on outside - 
62.73.78.2) it fails with timeout in about 9 of 10 times.
ipfstat -t shows that a rule is created - something like this:
Source IP                  Dest IP                ST   PR    
pkts.        bytes 
192.168.0.4,1029      62.73.78.2,53      0/0  udp  165           9992  

Any help will be appreciated.


More information about the freebsd-questions mailing list