Strange SSH question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello all.

I have a strange SSH question.

I have a Linux firewall running an SSH client. I have an account with a SSH
server. Normally, I connect one of the boxes behind the firewall to the SSH
server using F-Secure. Then everything from this box is forwarded to the SSH

What I would like to do is have the Linux box do this for me. That way, the
other machines on the network get the benefit of having the SSH tunnel. I
have checked the terms of service and this is acceptable.

I can do port forwardings from the Linux box, but the traffic that is route
through it does not go through these port forwardings.

Does this make sense? Can anybody suggest a way to get the routed traffic to
go through the port forwardings or is this impossible?

Thank you for any help.

Re: Strange SSH question

Quoted text here. Click to load it

Assuming you have a 2.4 kernel, you can do this with an iptables REDIRECT
rule on your firewall.  From the iptables man page:

  This  target is only valid in the nat table, in the PREROUTING and OUT-
  PUT chains, and user-defined chains which are only  called  from  those
  chains.  It alters the destination IP address to send the packet to the
  machine itself [...]

You redirect connections that would have been routed to a local port
forwarded by ssh.

Darren Tucker (dtucker at
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Site Timeline