List Info

Thread: ip redirection




ip redirection
user name
2006-03-27 15:13:35
this is what the dns server does:

 intranet.xxxxxxxxx.com.br --> AAA.AAA.AAA.AAA

 requests to intranet... goes to AAA....A  (the router)

 this is what i want:

 AAA.AAA.AAA.AAA (router) --> BBB.BBB.BBB.BBB (webserver)

 BBB...B is an IP address inside a private network like
192.168.1.x
 AAA...A is a worldwide ip address like 139.82.x.x

 How can I do this redirection with iptables?

 thanks!

 bruno

ip redirection
user name
2006-03-27 16:21:05
Bruno Nunes wrote:
> this is what the dns server does:
> 
>  intranet.xxxxxxxxx.com.br --> AAA.AAA.AAA.AAA
> 
>  requests to intranet... goes to AAA....A  (the router)
> 
>  this is what i want:
> 
>  AAA.AAA.AAA.AAA (router) --> BBB.BBB.BBB.BBB
(webserver)
> 
>  BBB...B is an IP address inside a private network like
192.168.1.x
>  AAA...A is a worldwide ip address like 139.82.x.x
> 
>  How can I do this redirection with iptables?

It's called Network Address Translation.  (man iptables)

iptables -t nat -A PREROUTING -d AAA.AAA.AAA.AAA \
          -p tcp -m tcp --dport 80 \
          -j DNAT --to-destination BBB.BBB.BBB.BBB

> 
>  thanks!
> 
>  bruno
> 
> 
> 

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )