Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to setup a transparent proxy between eth0 and lo,

The reason being during DNS propagation services are being tunneled over a SSH connection between the old and new servers, on the "old" server this is fine for anything running locally connecting to localhost:

However for anything hitting the external address of the "old server" the service is not forward as the ssh tunnel only listens for connections to localhost (lo).

Current setup:

Old server --> SSH Tunnel --> New server

What needs to happen

Client connection (i.e. tcp 8081) --> Old Server --> SSH Tunnel --> New server

I am trying multiple variations on ip table rules, setting -L <service port>:<service port> does not listen on all interfaces only on lo.

The solution must come from iptables alone, there is no time to deploy squid / another proxy service.

So in summary.

  • Assume tcp 8081, is tunneled over SSH connection
  • I need this to work from the eth0 bound address

Thanks In Advance

share|improve this question
up vote 1 down vote accepted

I might be getting you wrong. But why don't you just bind the Endpoint of the SSH Tunnel to eth0 and allow the connection from remote hosts with the -g switch.

To quote from the manpage:

-g      Allows remote hosts to connect to local forwarded ports.
share|improve this answer
Certainly "could not see the wood for the trees", thank you! – Oneiroi Nov 25 '10 at 13:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.