NAT Question

Bill Moran wmoran at
Thu Jun 12 14:10:05 PDT 2003

[Please wrap your lines around 70 chars or so]

Koroush Saraf wrote:
>   Hi all,
>   I'm trying to setup a BSD box to act as a NAT gateway between private
 > net and public Internet.  My requirements is to map the src and destination
 > of the packet according to a set of rules.
>   The BSD box has two public IP addresses. Depending on which interface the
 > packet arrives on it will get routed to a different private destination
 > address.
>   I'm using ipnat with the following mapping on the NAT box.
>   The Nat box has only 1 interface xl0
>   the ip addresses of this interface are: 
>   public  129.197,244.6/24,, 
>   private,

This is not a particularly good setup.  I hope you aren't expecting this to
act as a firewall or provide any security?  You'd probably be better off
setting up the machines with the IP addresses directly, instead of natting.
Otherwise, get a second NIC ... it's the right thing to do.

Please provide the output of "ifconfig".  What you describe above is wrong,
but it's possible that you mistyped it.  If you actually try to have two
IPs on the same NIC that equate to the same network number, your networking
will not work as expected.

>   The servers on the private lan are and on two
 > different subnets.
>   to 
>   List of active MAP/Redirect filters:
>   map xl0 ->
>   map xl0 ->
>   map xl0 ->
>   map xl0 ->
>   However I'm not getting the desired results.

You're using the wrong command.  Use rdr.

Bill Moran
Potential Technologies

More information about the freebsd-questions mailing list