ipfw problems using divert and fwd at the same time with 6.3-release

Paul Thornton prt at prt.org
Wed Feb 18 07:36:04 PST 2009


I have found the error of my ways...

For the purposes of the archives, I'm posting what actually made this 
work. It is a very simple fix and I don't quite know how I missed trying 
this out during my frustrations.

Before the "ipfw fwd..." line you need one or more "ipfw skipto..." 
lines to ensure that you don't accidentally match the more specific 
addresses on the fwd.

What's interesting is that I'd had "ipfw allow..." lines before the 
"ipfe fwd..." line doing a similar thing to skipto, and it didn't work.

So I amended the ruleset to the following (other rules stay the same):

> 06000   515  153945 divert 8668 ip from any to me via em0
> 07000    48    5472 skipto 32000 ip from 10.81.0.0/16 to 217.65.161.4 dst-port 80
> 07100     0       0 skipto 32000 ip from 10.81.129.0/24 to any
> 08000    94   10434 fwd 127.0.0.1,8000 tcp from 10.81.0.0/16 to any dst-port 80
> 32000   499  230890 allow ip from any to any

Paul.


More information about the freebsd-net mailing list