Linux Netfilter discussions
 help / color / mirror / Atom feed
* RE: redirection
@ 2003-04-09 10:03 dhiraj.2.bhuyan
  2003-04-09 10:25 ` redirection xchris
  0 siblings, 1 reply; 19+ messages in thread
From: dhiraj.2.bhuyan @ 2003-04-09 10:03 UTC (permalink / raw)
  To: lyra, netfilter

try one thing - flush all rules and add the rule
iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT
--to-destination x.y.z.2:80

I have a feeling that you are doing something in the POSTROUTING chain which
is why you are not getting the right result. Or maybe you have a rule to
drop the packet defined?

dhiraj

-----Original Message-----
From: xchris [mailto:lyra@fastwebnet.it]
Sent: 09 April 2003 09:14
To: Bhuyan,D,Dhiraj,XVR3A C; netfilter@lists.netfilter.org
Subject: Re: redirection


On Wednesday 09 April 2003 10:40 am, you wrote:
> You do infact need DNAT and not SNAT
>
> iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT
> --to-destination x.y.z.2:80
>
> this should work.


I tried but all connections go in timeout.
I first flushed every chain,set default policy everywhere,and then added
DNAT 
rule...

no result...

The strange thing is :
if i DNAT on another interface everything is ok.
if i DNAT through the incoming connection interface... it fails.

strange...
I think i miss something..
Thank you
Chris


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Redirection
@ 2004-02-27 12:08 Sasa Stupar
  2004-02-27 12:19 ` Redirection Antony Stone
       [not found] ` <008b01c3fd2b$f8910320$2a245cc2@cea05>
  0 siblings, 2 replies; 19+ messages in thread
From: Sasa Stupar @ 2004-02-27 12:08 UTC (permalink / raw)
  To: Netfilter-List

Hi!

I have setup router with iptables. Now I have also setup a squid proxy 
server on another internal machine. What I want is to all http requests 
from internal LAN to send thru proxy.
Since I am new to iptables I am asking here for some help.
How can I do that?

Thanks,
Sasa


^ permalink raw reply	[flat|nested] 19+ messages in thread
* RE: redirection
@ 2003-04-09 13:10 dhiraj.2.bhuyan
  2003-04-09 13:34 ` redirection Christian Cernuschi
  0 siblings, 1 reply; 19+ messages in thread
From: dhiraj.2.bhuyan @ 2003-04-09 13:10 UTC (permalink / raw)
  To: netfilter

note one thing -

when the client tries to connect to port 80 of x.y.z.1, the firewall in
x.y.z.1 redirects the traffic to x.y.z.2:80

so the client will be receiving packets from x.y.z.2:80 - which is not what
it is expecting. It is waiting for packets from x.y.z.1:80 - so it will no
doubt timeout. You should be able to see the packets coming from x.y.z.2:80
by running a sniffer on the client machine.

I think Eric Joe did infact give the right solution - that x.y.z.1 will be
working as a proxy between the client and x.y.z.2 - although you can
question if you are achieving your "loadbalancing" by this.


dhiraj

-----Original Message-----
From: xchris [mailto:lyra@fastwebnet.it]
Sent: 08 April 2003 23:17
To: netfilter@lists.netfilter.org
Subject: Re: redirection



----- Original Message -----
From: "Eric Joe" <sysop@tje1.com>


> I didnt catch the fact that you need the source address. Are you tracking
> this for a reason? You can probably have iptables log the source address.
> This does in fact work, been using it for  about 6 months now. Let me post
> my exact rules (IPs are obsfucated)

i need it because i'm trying to do a simple load balancing between 2 local
servers running opennap.
(and opennap needs to know the IP address otherwise downloads dont start)
thnak you

xchris


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Redirection
@ 2003-04-09 10:15 Simone Sestini
  0 siblings, 0 replies; 19+ messages in thread
From: Simone Sestini @ 2003-04-09 10:15 UTC (permalink / raw)
  To: netfilter

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

Hi all.. i have a situation where i need to use iptables..

I have a public www with some virtual hosts on a machine with public ip 
2.2.2.2.
I have with another provider a second server with public ip 1.1.1.1

On dns server i wrote that intra.pippo.foo has address 1.1.1.1 so all the 
internet request come to machine 1.1.1.1 port 80.
I want that the server 1.1.1.1 redirects all the call on port 80 and 443 to 
the server 2.2.2.2 in transparent mode.. i don't want end user to know that 
datas are over server 2.2.2.2.

Naturally the www server on 2.2.2.2 listen on port 80 for intra.pippo.foo

How can i menage the packets with iptables for do that ?

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Simone Sestini [ SS971-RIPE ]

Plug IT s.p.a. - Technical Office
Via Galileo Ferraris 216
52100 Arezzo

Titles:
System and Network Administrator
Data Transmission Manager

Fax             +39-199-4400-88
E-mail  simone.sestini@plugit.net
Web             http://www.plugit.it

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

[-- Attachment #2: Type: text/html, Size: 1727 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread
* RE: redirection
@ 2003-04-09  8:40 dhiraj.2.bhuyan
  2003-04-09  9:13 ` redirection xchris
  0 siblings, 1 reply; 19+ messages in thread
From: dhiraj.2.bhuyan @ 2003-04-09  8:40 UTC (permalink / raw)
  To: lyra, netfilter

You do infact need DNAT and not SNAT

iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT
--to-destination x.y.z.2:80

this should work.
dhiraj


-----Original Message-----
From: xchris [mailto:lyra@fastwebnet.it]
Sent: 08 April 2003 23:17
To: netfilter@lists.netfilter.org
Subject: Re: redirection



----- Original Message -----
From: "Eric Joe" <sysop@tje1.com>


> I didnt catch the fact that you need the source address. Are you tracking
> this for a reason? You can probably have iptables log the source address.
> This does in fact work, been using it for  about 6 months now. Let me post
> my exact rules (IPs are obsfucated)

i need it because i'm trying to do a simple load balancing between 2 local
servers running opennap.
(and opennap needs to know the IP address otherwise downloads dont start)
thnak you

xchris




^ permalink raw reply	[flat|nested] 19+ messages in thread
* redirection
@ 2003-04-08 18:31 xchris
  2003-04-08 18:44 ` redirection Eric Joe
  0 siblings, 1 reply; 19+ messages in thread
From: xchris @ 2003-04-08 18:31 UTC (permalink / raw)
  To: netfilter

i'd like to do this:

i have 2 pc  
x.y.z.1
x.y.z.2

i would like to redirect connection on port 80 of x.y.z.1 to port 80 of 
x.y.z.2

i tried with DNAT but when someone tries to connect it goes in timeout?

Is there a solution?

Thank you
Chris



^ permalink raw reply	[flat|nested] 19+ messages in thread
* redirection
@ 2003-04-08 16:10 Christian Cernuschi
  2003-04-10 17:45 ` redirection Eric Joe
  0 siblings, 1 reply; 19+ messages in thread
From: Christian Cernuschi @ 2003-04-08 16:10 UTC (permalink / raw)
  To: netfilter

i'd like to do this:

i have 2 pc  
x.y.z.1
x.y.z.2

i would like to redirect connection on port 80 of x.y.z.1 to port 80 of 
x.y.z.2

i tried with DNAT but when someone tries to connect it goes in timeout?

Is there a solution?

Thank you
Chris


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2004-02-27 12:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-09 10:03 redirection dhiraj.2.bhuyan
2003-04-09 10:25 ` redirection xchris
  -- strict thread matches above, loose matches on Subject: below --
2004-02-27 12:08 Redirection Sasa Stupar
2004-02-27 12:19 ` Redirection Antony Stone
     [not found] ` <008b01c3fd2b$f8910320$2a245cc2@cea05>
2004-02-27 12:41   ` Redirection Sasa Stupar
2004-02-27 12:46     ` Redirection Sasa Stupar
2003-04-09 13:10 redirection dhiraj.2.bhuyan
2003-04-09 13:34 ` redirection Christian Cernuschi
2003-04-09 13:38   ` redirection xchris
2003-04-09 10:15 Redirection Simone Sestini
2003-04-09  8:40 redirection dhiraj.2.bhuyan
2003-04-09  9:13 ` redirection xchris
2003-04-08 18:31 redirection xchris
2003-04-08 18:44 ` redirection Eric Joe
2003-04-08 19:40   ` redirection xchris
2003-04-08 22:49     ` redirection Eric Joe
2003-04-08 23:17       ` redirection xchris
2003-04-08 16:10 redirection Christian Cernuschi
2003-04-10 17:45 ` redirection Eric Joe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox