It looks like during system startup (in some setups?) ipdivet.ko kernel module loads later than the default /etc/rc.firewall script executes, and thus script fails to properly add NAT related ipfw rules. In my case it was this rule: if [ -n "${natd_interface}" ]; then ${fwcmd} add 50 divert natd ip4 from any to any via ${natd_interface} fi This results in: ipfw: getsockopt(IP_FW_ADD): Invalid argument So after every reboot I should manually run sh /etc/rc.firewall to flush and add ipfw rules once again. I've got this problem at least on two my PCs and at least one guy has similar problem as reported here http://www.opennet.ru/openforum/vsluhforumID3/69154.html#26. Here is parts of my configuration files although I doubt it would help: rc.conf: ifconfig_vr1="dhcp" gateway_enable="YES" # IPFW firewall_enable="YES" firewall_type="OPEN" # NAT natd_program="/sbin/natd" natd_enable="YES" natd_interface="vr1" natd_flags="-m" sysctl.conf: net.inet.ip.fw.one_pass=0 Fix: echo 'ipdivert_load="YES"' >> /boot/loader.conf causes normal rule execution during startup. How-To-Repeat: Reboot PC.
Responsible Changed From-To: freebsd-bugs->freebsd-ipfw Over to maintainer(s).
The problem seems to be that ipdivert.ko is not loaded prior to the /etc/rc.d/ipfw script being run. /etc/rc.d/natd _does_ load this module so restarting the firewall after boot sequence is complete works. I've fixed this on my own system by adding === cut here 8<=== if checkyesno natd_enable; then required_modules="$required_modules ipdivert" fi === cut here 8<=== at the end of the ipfw_prestart() function in /etc/rc.d/ipfw This appears to be a regression between the "out of the box" states for 8.0-RELEASE and 8.1-RELEASE.
Responsible Changed From-To: freebsd-ipfw->hrs Take.
Attached patch fixes problem (patch is same as solution from Thomas Sandford) -- LEFT-(UANIC|RIPE) JID: levsha@jabber.net.ua PGP fingerprint: 1BCD 7C80 2E04 7282 C944 B0E0 7E67 619E 4E72 9280
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped