From: "John A. Sullivan III" <john.sullivan@nexusmgmt.com>
To: al clethero <aclethero@ihug.co.nz>
Cc: netfilter@lists.netfilter.org
Subject: Re: Newbie - problem with PREROUTING on nat - I'm missing something obvious?
Date: Thu, 18 Mar 2004 06:42:14 -0500 [thread overview]
Message-ID: <1079610133.2009.19.camel@localhost> (raw)
In-Reply-To: <1079605653.5606.14.camel@bluespi.orb.co.nz>
On Thu, 2004-03-18 at 18:27, al clethero wrote:
> Folks
>
> Well I guess I haven't made this too clear :) but I've battled on and
> tried some experimentation and I've found that I can redirect a packet
> to a different port in the nat table with a PREROUTING rule if the
> packet comes through on eth0 from another machine, but NOT if the source
> of the packet is 127.0.0.1 port 80 and the destination is 127.0.0.1 port
> 8080 ( i.e. a browser on my gateway machine connected to the internet
> sends to port 80 and needs to be redirected to port 8080 ).
>
> The reason I'm trying this is so that the browser on the gateway machine
> is forced to use port 8080 whether a proxy server is defined or not in
> the browser.
>
> Is there a reason for 127.0.0.1 not using prerouting? Can anyone confirm
> this for me?
>
> John, I didn't fully understand your final point :
>
> I believe you must ensure that traffic can flow to interface lo on
> the INPUT chain as well as doing the redirect . . . but it has been a
> long time since I configured Squid so I may be wrong
>
> can you elaborate?
>
<snip>
I'm stretching back in my rusty memory here but I believe that when you
redirect the packet to Squid, there is an internal socket connection to
Squid, in other words, the system talks to itself as if it was talking
to another network connection except that then network connection is on
127.0.0.1. If your INPUT chain does not allow traffic to pass on the lo
interface, these internal socket connections will be dropped. Thus, one
must allow these internal socket connections by ACCEPTing traffic from
lo on the INPUT chain.
These were guesses that I made to make it work and I have never looked
at the netfilter code so please believe someone else if they tell you
differently.
I also believe that locally generated packets do not pass through -t nat
PREROUTING but rather through -t nat OUTPUT. Again, this is not a
configuration I usually use so I am not 100% sure. That may explain why
locally generated http connections are not routed through squid. Hope
this helps and is accurate.
My apologies for all the cautious phrasing but I am always very
suspicious that I am being given advice on a mail list from someone who
is well meaning but not authoritative. Thus, I try to make it clear
that I am not authoritative :-)
--
John A. Sullivan III
Chief Technology Officer
Nexus Management
+1 207-985-7880
john.sullivan@nexusmgmt.com
prev parent reply other threads:[~2004-03-18 11:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-17 0:49 Newbie - problem with PREROUTING on nat - I'm missing something obvious? al clethero
2004-03-17 3:13 ` John A. Sullivan III
2004-03-18 10:27 ` al clethero
2004-03-18 11:42 ` John A. Sullivan III [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1079610133.2009.19.camel@localhost \
--to=john.sullivan@nexusmgmt.com \
--cc=aclethero@ihug.co.nz \
--cc=netfilter@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.