ipfw fwd on FreeBSD 8.1, does it work?

Fabian Wenk fabian at wenks.ch
Tue Jul 5 14:00:17 UTC 2011


Hello Unga

On 05.07.2011 12:47, Unga wrote:

> Following ipfw rule develop error indicated:
> ipfw add 100 fwd 127.0.0.1,1234 tcp from any to any 1234 out via wlan0
>
> Error:
> ipfw: getsockopt(IP_FW_ADD): Invalid argument

Does your kernel have 'options IPFIREWALL_FORWARD' (if this is 
needed for 8.1, I still run at 7.x)?

Else try the rule like this:
ipfw add 100 fwd 127.0.0.1 ip4 from me to any 1234 out via wlan0
or:
ipfw add 100 fwd 127.0.0.1 tcp from me to any 1234 out via wlan0

The fwd rule does only match the packets which match the rule 'ip4 
from me to any 1234 out via wlan0' (me = alias for local IP 
addresses), so they will be directed to 127.0.0.1 on the same 
destination port. Other packets not for destination port 1234 will 
just go out as usual.


bye
Fabian


More information about the freebsd-ipfw mailing list