NAT and Routing

Brian Somers brian at
Sat Nov 9 02:44:21 GMT 2002

On Fri, 8 Nov 2002 23:41:27 -0000, Edmund Craske wrote:
> To save beating around the bush:
> How do you set up NAT to only translate packets that come through the
> LAN interface, rather than packets that go out the external interface?
> Ie, a machine with 3 network cards, one connected to the outside world,
> one connected to a DMZ (local machines with public routable IPs), and
> one connected to a LAN with internal IPs that need NATing. (Stop it from
> NATing DMZ traffic as well?)

Try using natd with ipfw rules something like:

ipfw add 50 divert natd ip from to any out via if0
ipfw add 51 divert natd ip from any to in via if0

where is your private network, if0 is your external interface
and is your external interfaces IP number.

> Thanks,
> Edmund Craske

Brian <brian at>                       <brian.somers at>
      <>                <brian@[uk.]>
Don't _EVER_ lose your sense of humour !       <brian@[uk.]>

More information about the Ukfreebsd mailing list