* ip redirection
@ 2006-03-27 15:13 Bruno Nunes
2006-03-27 16:21 ` Mike Wright
0 siblings, 1 reply; 4+ messages in thread
From: Bruno Nunes @ 2006-03-27 15:13 UTC (permalink / raw)
To: netfilter
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ip redirection
2006-03-27 15:13 ip redirection Bruno Nunes
@ 2006-03-27 16:21 ` Mike Wright
0 siblings, 0 replies; 4+ messages in thread
From: Mike Wright @ 2006-03-27 16:21 UTC (permalink / raw)
To: netfilter
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
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* ip redirection
@ 2006-03-28 12:37 Bruno Nunes
2006-03-28 14:52 ` Rob Sterenborg
0 siblings, 1 reply; 4+ messages in thread
From: Bruno Nunes @ 2006-03-28 12:37 UTC (permalink / raw)
To: netfilter
i want all connections incoming from IP1 to be forwarded to the IP2
ip1 is a internet ip
ip2 is a local ip
i only need an ip redirection...so if I use ssh, http or ftp or
anything iptables must route ip1 to ip2 directly
how can i do that with iptables?
thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: ip redirection
2006-03-28 12:37 Bruno Nunes
@ 2006-03-28 14:52 ` Rob Sterenborg
0 siblings, 0 replies; 4+ messages in thread
From: Rob Sterenborg @ 2006-03-28 14:52 UTC (permalink / raw)
To: netfilter
On Tue, March 28, 2006 14:37, Bruno Nunes wrote:
> i want all connections incoming from IP1 to be forwarded to the IP2
> ip1 is a internet ip
> ip2 is a local ip
>
> i only need an ip redirection...so if I use ssh, http or ftp or
> anything iptables must route ip1 to ip2 directly
>
> how can i do that with iptables?
In a previous post "ip redirection and multiport noobish question" (where I
fail to see what the multiport question was) you asked something similar. Did
you actualy look for yourself in the tutorial ?
If you did, you would have been able to construct this :
$ipt -t nat -A PREROUTING -i <if_inet> -d IP1 -j DNAT --to $IP2
However, if you'd ask me then my advice would be not doing this.
Gr,
Rob
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-03-28 14:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-27 15:13 ip redirection Bruno Nunes
2006-03-27 16:21 ` Mike Wright
-- strict thread matches above, loose matches on Subject: below --
2006-03-28 12:37 Bruno Nunes
2006-03-28 14:52 ` Rob Sterenborg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.