Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Apr 2007 08:47:00 +0400
From:      "Andrey V. Semyonov" <wilfre@mail.ru>
To:        freebsd-questions@freebsd.org
Subject:   Re: PF NAt
Message-ID:  <4632D1C4.5000809@mail.ru>
In-Reply-To: <5855700c0704261135m7ddc06dbuc74e501e9bef3ca1@mail.gmail.com>
References:  <5855700c0704261135m7ddc06dbuc74e501e9bef3ca1@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> /etc/pf.conf
> 
> exter_if = "vr0"
               ^^^
> nat on $exter_if from $inter_if  to any -> $exter_if
                                              ^^^^^^^^^
Now look at man page about nat/rdr rule syntax:

      nat-rule       = [ "no" ] "nat" [ "pass" ] [ "on" ifspec ] [ af ]
                       [ protospec ] hosts [ "tag" string ] [ "tagged" 
string ]
                       [ "->" ( redirhost | "{" redirhost-list "}" )
                       [ portspec ] [ pooltype ] [ "static-port" ] ]


Grammar says, that after the "->" keyword there should be specified 
_host(s)_. So, if you want to use a macro, pointing to your interface 
_name_, there's a technique to translate it to it's primary or any 
aliased IP:

($macro)

Your line should look like this:

nat on $exter_if from $inter_if  to any -> ($exter_if)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4632D1C4.5000809>