Linux Netfilter discussions
 help / color / mirror / Atom feed
* REDIRECT to localhost
@ 2004-08-16  8:24 Попов Игорь Николаевич 
  2004-08-16 11:15 ` Ted Kaczmarek
  0 siblings, 1 reply; 10+ messages in thread
From: Попов Игорь Николаевич  @ 2004-08-16  8:24 UTC (permalink / raw)
  To: netfilter

Hi All,
I have server, that connects my localnet to inet, clients connects to me via PPPoE (ppp[1-9]). I want to run squid on localhost and I want my clients to connect to it.

Can somebody help me with redirect rules?



Igor Popov <igorpopov@newmail.ru>
icq 241601876
__________
www.newmail.ru -- бесплатная почта, бесплатный хостинг.


^ permalink raw reply	[flat|nested] 10+ messages in thread
* REDIRECT to localhost
@ 2004-08-16 11:23 igorpopov
  0 siblings, 0 replies; 10+ messages in thread
From: igorpopov @ 2004-08-16 11:23 UTC (permalink / raw)
  To: netfilter

Hi All,
I have server, that connects my localnet to inet, clients connects to me via PPPoE (ppp[1-9]). I want to run squid in transparent mode on localhost and I want my clients to connect to it.

Can somebody help me with redirect rules?

-----
This message was forwarded to you courtesy of the NoSPAM Crusade.
Visit us on the web at: http://nospam.arix.com



^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: REDIRECT to localhost
@ 2004-08-16 14:17 Jason Opperisano
  0 siblings, 0 replies; 10+ messages in thread
From: Jason Opperisano @ 2004-08-16 14:17 UTC (permalink / raw)
  To: netfilter

> iptables -t nat -A PREROUTING -i "name of interface" -p tcp -m tcp --
> dport 80 -j REDIRECT --to-ports 3129
>
> If your default policy is to DROP all INPUT/FORWARD as is it should be.
>
>
> iptables -A INPUT -i "name of interface" -p tcp -m tcp --dport 80 -j
> ACCEPT

in this case--where you have ppp[0-9], you can also use the "+" notation to avoid having 10 rules that do the same thing; i.e., 

  iptables -t nat -A PREROUTING -i ppp+ -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 3129

will match any ppp interface.

> You can also use -s "ip address" instead of -i  "name of interface".

or both...

-j


^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: REDIRECT to localhost
@ 2004-08-18 12:37 Jason Opperisano
  2004-08-18 13:41 ` Cedric Blancher
  0 siblings, 1 reply; 10+ messages in thread
From: Jason Opperisano @ 2004-08-18 12:37 UTC (permalink / raw)
  To: netfilter

> > As I know, REDIRECT target redirects to the same iface, but on another port.
>
> Nope.
> REDIRECT target redirects to lo interface, on the port you want.

hmmm...i'm not so sure i agree with that.  my belief is that REDIRECT redirects to the IP address of the receiving interface of the netfilter machine on the specified port.

i do transparent proxying w/ REDIRECT and squid, and i see all the redirected connections on the IP of the internal interface, not on lo or 127.0.0.1.

i actually just recently learned here that packets arriving on lo that don't have a source and dest of 127.0.0.1 get dropped by the linux kernel's "martian" code (thanks for pointing that out to me)--so i don't see how a redirect of this nature could work.

-j


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

end of thread, other threads:[~2004-08-18 13:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-16  8:24 REDIRECT to localhost Попов Игорь Николаевич 
2004-08-16 11:15 ` Ted Kaczmarek
2004-08-17 11:02   ` Igor Popov
2004-08-18  1:21     ` Cedric Blancher
2004-08-18 12:22       ` Ted Kaczmarek
  -- strict thread matches above, loose matches on Subject: below --
2004-08-16 11:23 igorpopov
2004-08-16 14:17 Jason Opperisano
2004-08-18 12:37 Jason Opperisano
2004-08-18 13:41 ` Cedric Blancher
2004-08-18 13:47   ` Cedric Blancher

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