* will port forwarding work here?
@ 2005-01-14 15:35 Payal Rathod
2005-01-14 15:55 ` Jason Opperisano
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Payal Rathod @ 2005-01-14 15:35 UTC (permalink / raw)
To: Netfilter ML
Hi,
I have 2 squid proxy on two different machines 192.168.0.10 and
192.168.0.11 All my clients are configured to use 192.168.0.10:3128
Now I want a few specific clients to use 192.168.0.11:3128
Is it possible to write some kind of rule on 192.168.0.10 which will
*properly* redirect traffic from 192.168.0.10:3128 to
192.168.0.11:3128 for those clients. A friend on chat suggested (he
was not sure),
iptables -A PREROUTING -t nat -s 192.168.0.10 --dport 3128 \
-j DNAT --to-destination 192.168.0.11
Is there anything else missing?
With warm regards,
-Payal
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: will port forwarding work here?
2005-01-14 15:35 will port forwarding work here? Payal Rathod
@ 2005-01-14 15:55 ` Jason Opperisano
2005-01-14 17:10 ` Payal Rathod
2005-01-14 16:11 ` Samuel Jean
2005-01-15 22:20 ` Jose Maria Lopez
2 siblings, 1 reply; 8+ messages in thread
From: Jason Opperisano @ 2005-01-14 15:55 UTC (permalink / raw)
To: netfilter
On Fri, Jan 14, 2005 at 10:35:08AM -0500, Payal Rathod wrote:
> Hi,
> I have 2 squid proxy on two different machines 192.168.0.10 and
> 192.168.0.11 All my clients are configured to use 192.168.0.10:3128
> Now I want a few specific clients to use 192.168.0.11:3128
> Is it possible to write some kind of rule on 192.168.0.10 which will
> *properly* redirect traffic from 192.168.0.10:3128 to
> 192.168.0.11:3128 for those clients. A friend on chat suggested (he
> was not sure),
>
> iptables -A PREROUTING -t nat -s 192.168.0.10 --dport 3128 \
> -j DNAT --to-destination 192.168.0.11
>
> Is there anything else missing?
yeah--the same thing that everyone misses when they try and DNAT onto
the same local network:
1) client (192.168.0.100) send TCP SYN to 192.168.0.10 port 3128
2) proxyA (192.168.0.10) DNATs the packet to 192.168.0.11
3) proxyB (192.168.0.11) receives SYN from 192.168.0.100 and replies
directly with SYN/ACK
4) client (192.168.0.100) receives SYN/ACK from 192.168.0.11 and drops
it, as client never sent a SYN to 192.168.0.11.
sound familiar? it feels familiar to me as i type it once again.
options:
1) for the machines that need to proxy to 192.168.0.11, just set their
proxy to be 192.168.0.11. no--it's not h4x0r l33t, but it's really
what you're trying to do, and the "right" way to do it.
2) duct tape it. on 192.168.0.10:
# DNAT requests from some clients to 192.168.0.11
iptables -t nat -A PREROUTING -p tcp -s $SOME_CLIENT --dport 3128 \
-j DNAT --to-destination 192.168.0.11
# make requests from some client look like they came from me to avoid
# asymmetric routing of the DNAT-ed connection
iptables -t nat -A POSTROUTING -p tcp -s $SOME_CLIENT --dport 3128 \
-d 192.168.0.11 -j SNAT --to-source 192.168.0.10
as always--i hate this solution for all the reasons everyone has brought
up every time time this has come up previously--it's horribly
inefficient, it destroys your audit trail, etc...
-j
--
"No jury in the world is going to convict a baby ... Maybe Texas."
--The Simpsons
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: will port forwarding work here?
2005-01-14 15:35 will port forwarding work here? Payal Rathod
2005-01-14 15:55 ` Jason Opperisano
@ 2005-01-14 16:11 ` Samuel Jean
2005-01-15 22:20 ` Jose Maria Lopez
2 siblings, 0 replies; 8+ messages in thread
From: Samuel Jean @ 2005-01-14 16:11 UTC (permalink / raw)
To: Payal Rathod; +Cc: netfilter
On Fri, January 14, 2005 10:35 am, Payal Rathod said:
> Hi,
Hi!
> Is it possible to write some kind of rule on 192.168.0.10 which will
> *properly* redirect traffic from 192.168.0.10:3128 to
> 192.168.0.11:3128 for those clients. A friend on chat suggested (he
> was not sure),
>
> iptables -A PREROUTING -t nat -s 192.168.0.10 --dport 3128 \
> -j DNAT --to-destination 192.168.0.11
>
> Is there anything else missing?
Yes, see NATing on the same network from the Rusty's NAT howto.
Also, please note this will broke HTTP 1.0 which really hates NAT.
What I suggest is configuring both squid in HTTP accel mode (transparent)
and unconfigure your client's browser so they attempt to reach the
world wide web by themself.
Then, make your router silently redirecting packets to whatever the squid
you want.
Read http://www.tldp.org/HOWTO/TransparentProxy.html
Chapter 6 is what you need, I guess.
>
> With warm regards,
> -Payal
>
HTH,
Samuel
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: will port forwarding work here?
2005-01-14 15:55 ` Jason Opperisano
@ 2005-01-14 17:10 ` Payal Rathod
2005-01-14 17:18 ` Jason Opperisano
0 siblings, 1 reply; 8+ messages in thread
From: Payal Rathod @ 2005-01-14 17:10 UTC (permalink / raw)
To: Netfilter ML
On Fri, Jan 14, 2005 at 10:55:49AM -0500, Jason Opperisano wrote:
> yeah--the same thing that everyone misses when they try and DNAT
> onto
> the same local network:
>
> 1) client (192.168.0.100) send TCP SYN to 192.168.0.10 port 3128
> 2) proxyA (192.168.0.10) DNATs the packet to 192.168.0.11
> 3) proxyB (192.168.0.11) receives SYN from 192.168.0.100 and replies
> directly with SYN/ACK
> 4) client (192.168.0.100) receives SYN/ACK from 192.168.0.11 and drops
> it, as client never sent a SYN to 192.168.0.11.
>
> sound familiar? it feels familiar to me as i type it once again.
Will it help, if I move the second squid proxy to the DMZ in
10.10.10.3 ?
With warm regards,
-Payal
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: will port forwarding work here?
2005-01-14 17:10 ` Payal Rathod
@ 2005-01-14 17:18 ` Jason Opperisano
2005-01-14 17:34 ` Payal Rathod
0 siblings, 1 reply; 8+ messages in thread
From: Jason Opperisano @ 2005-01-14 17:18 UTC (permalink / raw)
To: netfilter
On Fri, Jan 14, 2005 at 12:10:08PM -0500, Payal Rathod wrote:
> On Fri, Jan 14, 2005 at 10:55:49AM -0500, Jason Opperisano wrote:
> > yeah--the same thing that everyone misses when they try and DNAT
> > onto
> > the same local network:
> >
> > 1) client (192.168.0.100) send TCP SYN to 192.168.0.10 port 3128
> > 2) proxyA (192.168.0.10) DNATs the packet to 192.168.0.11
> > 3) proxyB (192.168.0.11) receives SYN from 192.168.0.100 and replies
> > directly with SYN/ACK
> > 4) client (192.168.0.100) receives SYN/ACK from 192.168.0.11 and drops
> > it, as client never sent a SYN to 192.168.0.11.
> >
> > sound familiar? it feels familiar to me as i type it once again.
>
> Will it help, if I move the second squid proxy to the DMZ in
> 10.10.10.3 ?
yes, because then the traffic routed through the firewall. just out of
curiosity, is 192.168.0.10 your firewall?
-j
--
"I saw weird stuff in that place last night. Weird, strange, sick,
twisted, eerie, godless, evil stuff. And I want in."
--The Simpsons
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: will port forwarding work here?
2005-01-14 17:18 ` Jason Opperisano
@ 2005-01-14 17:34 ` Payal Rathod
2005-01-14 17:36 ` Jason Opperisano
0 siblings, 1 reply; 8+ messages in thread
From: Payal Rathod @ 2005-01-14 17:34 UTC (permalink / raw)
To: Netfilter ML
On Fri, Jan 14, 2005 at 12:18:00PM -0500, Jason Opperisano wrote:
> > Will it help, if I move the second squid proxy to the DMZ in
> > 10.10.10.3 ?
>
> yes, because then the traffic routed through the firewall. just out of
> curiosity, is 192.168.0.10 your firewall?
Yes. Will that be a problem then?
With warm regards,
-Payal
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: will port forwarding work here?
2005-01-14 17:34 ` Payal Rathod
@ 2005-01-14 17:36 ` Jason Opperisano
0 siblings, 0 replies; 8+ messages in thread
From: Jason Opperisano @ 2005-01-14 17:36 UTC (permalink / raw)
To: netfilter
On Fri, Jan 14, 2005 at 12:34:57PM -0500, Payal Rathod wrote:
> On Fri, Jan 14, 2005 at 12:18:00PM -0500, Jason Opperisano wrote:
> > > Will it help, if I move the second squid proxy to the DMZ in
> > > 10.10.10.3 ?
> >
> > yes, because then the traffic routed through the firewall. just out of
> > curiosity, is 192.168.0.10 your firewall?
>
> Yes. Will that be a problem then?
no--that makes it nice and clean.
-j
--
"I've figured out an alternative to giving up my beer. Basically,
we become a family of traveling acrobats!"
--The Simpsons
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: will port forwarding work here?
2005-01-14 15:35 will port forwarding work here? Payal Rathod
2005-01-14 15:55 ` Jason Opperisano
2005-01-14 16:11 ` Samuel Jean
@ 2005-01-15 22:20 ` Jose Maria Lopez
2 siblings, 0 replies; 8+ messages in thread
From: Jose Maria Lopez @ 2005-01-15 22:20 UTC (permalink / raw)
To: Netfilter ML
El vie, 14 de 01 de 2005 a las 16:35, Payal Rathod escribió:
> Hi,
> I have 2 squid proxy on two different machines 192.168.0.10 and
> 192.168.0.11 All my clients are configured to use 192.168.0.10:3128
> Now I want a few specific clients to use 192.168.0.11:3128
> Is it possible to write some kind of rule on 192.168.0.10 which will
> *properly* redirect traffic from 192.168.0.10:3128 to
> 192.168.0.11:3128 for those clients. A friend on chat suggested (he
> was not sure),
>
> iptables -A PREROUTING -t nat -s 192.168.0.10 --dport 3128 \
> -j DNAT --to-destination 192.168.0.11
>
> Is there anything else missing?
>
> With warm regards,
> -Payal
The easiest way to do this without problems it's just using source
routing, with the iproute2 feature of the kernel. Just use some
"ip" commands to route the traffic to one or the other machine.
--
Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
jkerouac@bgsec.com
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA
The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
-- Jack Kerouac, "On the Road"
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-01-15 22:20 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-14 15:35 will port forwarding work here? Payal Rathod
2005-01-14 15:55 ` Jason Opperisano
2005-01-14 17:10 ` Payal Rathod
2005-01-14 17:18 ` Jason Opperisano
2005-01-14 17:34 ` Payal Rathod
2005-01-14 17:36 ` Jason Opperisano
2005-01-14 16:11 ` Samuel Jean
2005-01-15 22:20 ` Jose Maria Lopez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox