Remote port forwarding with gateway option

From: Steve Jibson (steve_at_jibson.com)
Date: 05/14/04


Date: 14 May 2004 11:36:20 -0700

If I use

"ssh -L80:localhost:80 bob.remote.com"

It will forward connections to my computer on port 80 to
bob.remote.com (also port 80). Now when it binds the listening
socket, it only binds to 127.0.0.1. This means that other computers
can't connect to my computer on port 80 have their connections
forwarded to bob.remote.com.

SSH allows you to change this with the "-g" argument. By specifying
the "-g", ssh binds to all local addresses (not just 127.0.0.1).

Okay, now we get to my question:

If I use

"ssh -R80:localhost:80 bob.remote.com"

Any connections made to port 80 on bob.remote.com are forwarded back
to my computer. Once again, however, it only binds to the loopback
interface on the remote machine. What this means is frank.remote.com
cannot connect to bob.remote.com on port 80 and have his connection
forwarded to my computer.

The "-g" option seems to have no effect on remote port forwarding. Is
there a way I can get remote port forwarding to make the remote
machine "gateway" connections back to my machine?



Relevant Pages

  • Re: Need help with bandwidth management . . .
    ... also be a good time to separate the wired from the wireless parts of ... wired connections. ... QoS lan port settings, and I cannot get anything consistent. ... switch ports and limit the bandwidth per port (the settings are ...
    (alt.internet.wireless)
  • Re: Iptables FTP question
    ... for secondary connections. ... Some ftp servers don't allow passive mode because it is less safe from ... algs that allow port mode for client machines. ...
    (comp.security.firewalls)
  • Re: Need Help on setting up a small home site.
    ... > told me that I have to open that port and forward request to my ... computer is the first network device. ... connections to port 80, so that they can be routed through to something ... > So if U don't consider it rude to post a long config file here, ...
    (comp.infosystems.www.servers.unix)
  • Re: Looking for program that emails me when dhcp addr changes
    ... For SSH all you need forwarded is TCP Port 22... ... >>participate in TCP connections or UDP conversations it initiates but ...
    (comp.security.ssh)
  • RE: Polling For 100 mbps Connections? (Was Re: Freebsd Theme Song)
    ... Polling For 100 mbps Connections? ... TCP port 5001 TCP window size: ... on pci0 pci1: on pcib1 ... 0xd0400000-0xd041ffff,0xd0460000-0xd0460fff irq 10 at device 15.0 on pci0 ...
    (freebsd-questions)