Real IP under NAT

Blake Darche blake.darche at gmail.com
Mon Jul 18 15:36:13 GMT 2005


Chuck,

pf can do this:

"
Bidirectional Mapping (1:1 mapping)
A bidirectional mapping can be established by using the binat rule. A
binat rule establishes a one to one mapping between an internal IP
address and an external address. This can be useful, for example, to
provide a web server on the internal network with its own external IP
address. Connections from the Internet to the external address will be
translated to the internal address and connections from the web server
(such as DNS requests) will be translated to the external address. TCP
and UDP ports are never modified with binat rules as they are with nat
rules.

Example:

    web_serv_int = "192.168.1.100"
    web_serv_ext = "24.5.0.6"

    binat on tl0 from $web_serv_int to any -> $web_serv_ext
" http://www.openbsd.org/faq/pf/nat.html


Blake

On 7/18/05, DerAlSem <deralsem at deralsem.com> wrote:
> Hello Chuck,
> 
> Monday, July 18, 2005, 7:16:38 PM, you wrote:
> 
> > DerAlSem wrote:
> > [ ... ]
> >> I've 5 external (real) IP, one is assigned on external if. Also there
> >> are 20 internal computers with 192.168.0.* ip's (NAT+IPFW). I need to assign one
> >> of that computer an external ip. Somebody told me, that it can be done
> >> with ARP-proxy, but i couldn't find any info on that. 10x in advance.
> 
> > See "man natd":
> 
> >       -redirect_address localIP publicIP
> >                   Redirect traffic for public IP address to a machine on the
> >                   local network.  This function is known as static NAT.  Nor-
> >                   mally static NAT is useful if your ISP has allocated a small
> >                   block of IP addresses to you, but it can even be used in the
> >                   case of single address:
> 
> >                         redirect_address 10.0.0.8 0.0.0.0
> 
> >                   The above command would redirect all incoming traffic to
> >                   machine 10.0.0.8.
> 
> 
> No, that won't work, because i need an external IP on LAN machine.
> 
> Ext IP adresses - 1.2.3.1-1.2.3.5
> Gate ext_if - 1.2.3.1
> Gate int_if - 192.168.0.1
> LAN (via NAT) machines - 192.168.0.2-20
> Another LAN (via NAT) machine - 1.2.3.2
> 
> How?
> 
> --
> Best regards,
>  DerAlSem                            mailto:deralsem at deralsem.com
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>


More information about the freebsd-questions mailing list