* Redirecting Outbound Port to Internal Server
@ 2010-06-09 20:48 Aaron Clausen
2010-06-09 21:06 ` Jan Engelhardt
2010-06-09 21:16 ` Curby
0 siblings, 2 replies; 6+ messages in thread
From: Aaron Clausen @ 2010-06-09 20:48 UTC (permalink / raw)
To: netfilter
I'm trying to sort out a way to redirect all outgoing traffic destined
for port 8080 to an internal server. I must be having some nasty
brain fart because I just can't get it working.
--
Aaron Clausen
mightymartianca@gmail.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Redirecting Outbound Port to Internal Server
2010-06-09 20:48 Redirecting Outbound Port to Internal Server Aaron Clausen
@ 2010-06-09 21:06 ` Jan Engelhardt
2010-06-09 21:16 ` Curby
1 sibling, 0 replies; 6+ messages in thread
From: Jan Engelhardt @ 2010-06-09 21:06 UTC (permalink / raw)
To: Aaron Clausen; +Cc: netfilter
On Wednesday 2010-06-09 22:48, Aaron Clausen wrote:
>I'm trying to sort out a way to redirect all outgoing traffic destined
>for port 8080 to an internal server. I must be having some nasty
>brain fart because I just can't get it working.
Just directly connect to the target address.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Redirecting Outbound Port to Internal Server
2010-06-09 20:48 Redirecting Outbound Port to Internal Server Aaron Clausen
2010-06-09 21:06 ` Jan Engelhardt
@ 2010-06-09 21:16 ` Curby
2010-06-09 21:24 ` Grant Taylor
1 sibling, 1 reply; 6+ messages in thread
From: Curby @ 2010-06-09 21:16 UTC (permalink / raw)
To: Aaron Clausen; +Cc: netfilter
On Wed, Jun 9, 2010 at 2:48 PM, Aaron Clausen <mightymartianca@gmail.com> wrote:
> I'm trying to sort out a way to redirect all outgoing traffic destined
> for port 8080 to an internal server. I must be having some nasty
> brain fart because I just can't get it working.
Just to clarify, you have a router or gateway machine between the
Internet and an internal network, and all TCP connections from any
internal machine to port 8080 should be DNATed to a proxy-like
machine, also on the internal network? If so, I think the problem is
that a single DNAT rule would cause the request to go through to the
internal proxy, but the proxy would send a reply back to the client,
which rejects it because it's expecting a reply from the router box.
Have you handled that issue? Perhaps seeing your existing rules would
help too. (I know this post isn't too helpful. I'm just trying to
understand your setup and throw out a possible gotcha.)
--Mike
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Redirecting Outbound Port to Internal Server
2010-06-09 21:16 ` Curby
@ 2010-06-09 21:24 ` Grant Taylor
2010-06-09 22:43 ` Curby
0 siblings, 1 reply; 6+ messages in thread
From: Grant Taylor @ 2010-06-09 21:24 UTC (permalink / raw)
To: Mail List - Netfilter
On 06/09/10 16:16, Curby wrote:
> I think the problem is that a single DNAT rule would cause the
> request to go through to the internal proxy, but the proxy would send
> a reply back to the client, which rejects it because it's expecting a
> reply from the router box.
I agree.
If you want to do the redirection this way, you have to SNAT the traffic
from the router to the proxy so that the proxy will reply to the router.
Then when the router receives the reply from the proxy, it will pass
the reply on to the original client.
I have done this before and it works quite well.
Now, I do ask the question, is it not possible to have your clients
communicate directly with the proxy?
I ask because what you want to do can be done and does work, but it
causes all the traffic between clients and the proxy to pass through the
router, thus making your router's NIC & CPU be a potential bottle neck
that can (fairly easily) be avoided.
Grant. . . .
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Redirecting Outbound Port to Internal Server
2010-06-09 21:24 ` Grant Taylor
@ 2010-06-09 22:43 ` Curby
2010-06-10 0:17 ` Grant Taylor
0 siblings, 1 reply; 6+ messages in thread
From: Curby @ 2010-06-09 22:43 UTC (permalink / raw)
To: Grant Taylor; +Cc: Mail List - Netfilter
On Wed, Jun 9, 2010 at 3:24 PM, Grant Taylor <gtaylor@riverviewtech.net> wrote:
> Now, I do ask the question, is it not possible to have your clients
> communicate directly with the proxy?
His later message suggests that the target machine is a web server and
not a proxy. In that case, I wonder if tweaking DNS to have the
relevant requests point directly to the local machine would be easier.
OTOH, he said that all outbound traffic on port 8080 should be sent to
the internal machine, which is odd if it's a simple web server hosting
a site or two.
--Mike
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Redirecting Outbound Port to Internal Server
2010-06-09 22:43 ` Curby
@ 2010-06-10 0:17 ` Grant Taylor
0 siblings, 0 replies; 6+ messages in thread
From: Grant Taylor @ 2010-06-10 0:17 UTC (permalink / raw)
To: Mail List - Netfilter
Curby wrote:
> His later message suggests that the target machine is a web server
> and not a proxy. In that case, I wonder if tweaking DNS to have the
> relevant requests point directly to the local machine would be
> easier.
I don't know if it would be easier or not, but it probably would be
better in the long run.
If there is a local DNS server, there are a number of options to do this.
> OTOH, he said that all outbound traffic on port 8080 should be sent
> to the internal machine, which is odd if it's a simple web server
> hosting a site or two.
Think a small business that is hosting their own web site on an internal
server. Public DNS will likely reflect the external IP and traffic
would be port forwarded in to said server.
What the OP is wanting to do is commonly referred to at NAT loop back /
wrap around.
Grant. . . .
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-06-10 0:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09 20:48 Redirecting Outbound Port to Internal Server Aaron Clausen
2010-06-09 21:06 ` Jan Engelhardt
2010-06-09 21:16 ` Curby
2010-06-09 21:24 ` Grant Taylor
2010-06-09 22:43 ` Curby
2010-06-10 0:17 ` Grant Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).