* iptables port80 forward and snat
@ 2006-01-13 19:12 J.P. Fischer
2006-01-13 21:36 ` Rob Sterenborg
0 siblings, 1 reply; 4+ messages in thread
From: J.P. Fischer @ 2006-01-13 19:12 UTC (permalink / raw)
To: netfilter
I have a RH ES4 box with 3 eth.ports and safesquid installed.
Safesquid listens on port 8080.
Eth0 = 1.1.1.1 (Internet connection)
Eth1 = 2.2.2.2
Eth2 = 192.168.1.1 (needs to be sNATted)
How do I setup iptables to:
1- Snat traffic coming in on eth2
2- port forward http traffic coming in on eth1 to port 8080 (so it will hit
the safesquid running on the box)
Thanks for any help.
Peter.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: iptables port80 forward and snat
2006-01-13 19:12 iptables port80 forward and snat J.P. Fischer
@ 2006-01-13 21:36 ` Rob Sterenborg
0 siblings, 0 replies; 4+ messages in thread
From: Rob Sterenborg @ 2006-01-13 21:36 UTC (permalink / raw)
To: netfilter
> I have a RH ES4 box with 3 eth.ports and safesquid installed.
> Safesquid listens on port 8080.
> Eth0 = 1.1.1.1 (Internet connection)
> Eth1 = 2.2.2.2
> Eth2 = 192.168.1.1 (needs to be sNATted)
>
> How do I setup iptables to:
>
> 1- Snat traffic coming in on eth2
Via which NIC ? My "magical powers" tell me that it's probably eth0.
$ipt -t nat -A POSTROUTING -i eth2 -s 192.168.1.0/24 \
-j SNAT --to 1.1.1.1
> 2- port forward http traffic coming in on eth1 to port 8080 (so it
> will hit the safesquid running on the box)
$ipt -t nat -A PREROUTING -i eth1 -p tcp --dport 80 \
-j DNAT --to 2.2.2.2:8080
Gr,
Rob
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: iptables port80 forward and snat
@ 2006-01-14 20:23 Gabriel
0 siblings, 0 replies; 4+ messages in thread
From: Gabriel @ 2006-01-14 20:23 UTC (permalink / raw)
To: netfilter
On Fri, 13 Jan 2006 21:12:18 +0200, J.P. Fischer wrote:
> I have a RH ES4 box with 3 eth.ports and safesquid
installed.
> Safesquid listens on port 8080.
> Eth0 = 1.1.1.1 (Internet connection)
> Eth1 = 2.2.2.2
> Eth2 = 192.168.1.1 (needs to be sNATted)
>
> How do I setup iptables to:
>
> 1- Snat traffic coming in on eth2
iptables -t nat -A POSTROUTING -i eth2 -o eth0 -j SNAT
--to-source 1.1.1.1
> 2- port forward http traffic coming in on eth1 to port
8080 (so it will hit
> the safesquid running on the box)
here:
http://iptables-tutorial.frozentux.net/iptables-tutorial.html#REDIRECTTARGET
it says it should look something like this:
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j
REDIRECT --to-ports 8080
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: iptables port80 forward and snat
@ 2006-01-14 20:48 Gabriel
0 siblings, 0 replies; 4+ messages in thread
From: Gabriel @ 2006-01-14 20:48 UTC (permalink / raw)
To: netfilter@lists.netfilter.org
On Sat, 14 Jan 2006 22:23:42 +0200, Gabriel wrote:
> On Fri, 13 Jan 2006 21:12:18 +0200, J.P. Fischer wrote:
>
>> 1- Snat traffic coming in on eth2
>
> iptables -t nat -A POSTROUTING -i eth2 -o eth0 -j SNAT
> --to-source 1.1.1.1
>
>> 2- port forward http traffic coming in on eth1 to port
> 8080 (so it will hit
>> the safesquid running on the box)
>
> here:
>
http://iptables-tutorial.frozentux.net/iptables-tutorial.html#REDIRECTTARGET
> it says it should look something like this:
>
> iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80
-j
> REDIRECT --to-ports 8080
>
Sorry, I haven't read Rob's post before replying.
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-01-14 20:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-13 19:12 iptables port80 forward and snat J.P. Fischer
2006-01-13 21:36 ` Rob Sterenborg
-- strict thread matches above, loose matches on Subject: below --
2006-01-14 20:23 Gabriel
2006-01-14 20:48 Gabriel
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.