Hello all,
Please help me to investigate ipf problem.
I've set up my FreeBSD 8.2 64-bit firewall strictly according to the FreeBSD tutorial found here: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-ipf.html
Now my /etc/ipnat.rules looks like
...and I have these lines in my ipf.rules file:
This firewall works great with the exception of the ftp protocol: anyone can use active or passive ftp-mode from the local net behind FreeBSD firewall but it's not possible to use at least passive ftp mode on the firewall itself (so I can't install programs from ports)!
Using ftp and tcpdump utilities I checked ftp session with 'tcp ftp.freebsd.org' step by step and found out that after switching to ftp passive mode my firewall times out making data-connection from >1024 port to >1024 server side port. This does not happen when making connections from the LAN behind the firewall.
Should I comment out ipfilter and ipmon lines in rc.conf the problem dissapears.
But according to "Allow out gateway & LAN users' non-secure FTP (both passive & active modes)" the gateway itself should have both passive and active mode ftp acceess enabled by the single line in ipf.rules and the single line in ipnat.rules.
So is it IPFilter malfunction or do I misunderstand anything?
Please help me to investigate ipf problem.
I've set up my FreeBSD 8.2 64-bit firewall strictly according to the FreeBSD tutorial found here: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls-ipf.html
Now my /etc/ipnat.rules looks like
Code:
map re0 10.3.0.0/16->0/32 proxy port 21 ftp/tcp
map re0 10.3.0.0/16->0/32 portmap tcp/udp auto
map re0 10.3.0.0/16->0/32
...and I have these lines in my ipf.rules file:
Code:
# Allow out gateway & LAN users' non-secure FTP ( both passive & active modes)
# This function uses the IPNAT built in FTP proxy function coded in
# the nat rules file to make this single rule function correctly.
# If you want to use the pkg_add command to install application packages
# on your gateway system you need this rule.
pass out quick on dc0 proto tcp from any to any port = 21 flags S keep state
This firewall works great with the exception of the ftp protocol: anyone can use active or passive ftp-mode from the local net behind FreeBSD firewall but it's not possible to use at least passive ftp mode on the firewall itself (so I can't install programs from ports)!
Using ftp and tcpdump utilities I checked ftp session with 'tcp ftp.freebsd.org' step by step and found out that after switching to ftp passive mode my firewall times out making data-connection from >1024 port to >1024 server side port. This does not happen when making connections from the LAN behind the firewall.
Should I comment out ipfilter and ipmon lines in rc.conf the problem dissapears.
But according to "Allow out gateway & LAN users' non-secure FTP (both passive & active modes)" the gateway itself should have both passive and active mode ftp acceess enabled by the single line in ipf.rules and the single line in ipnat.rules.
So is it IPFilter malfunction or do I misunderstand anything?