Re: Port Forwarding from Remote Computer to Multiple IPs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Have you checked the ssh manpage?

---snip---
-R [bind_address:]port:host:hostport

Specifies that the given port on the remote (server) host is to be
forwarded to the given host and port on the local side.  This works by
allocating a socket to listen to port on the remote
side, and whenever a connection is made to this port, the connec‐
tion is forwarded over the secure channel, and a connection is
made to host port hostport from the local machine.

Port forwardings can also be specified in the configuration file.
Privileged ports can be forwarded only when logging in as root on
the remote machine.  IPv6 addresses can be specified by enclosing
the address in square braces or using an alternative syntax:
	[bind_address/]host/port/hostport.

By default, the listening socket on the server will be bound to
the loopback interface only.  This may be overridden by specify‐
ing a bind_address.  An empty bind_address, or the address ‘*’ indicates
that the remote socket should listen on all interfaces.

Specifying a remote bind_address will only succeed if the
server’s GatewayPorts option is enabled (see sshd_config(5)).
---snip---

In addition, you can simply string multiple -R (and -L) options to
specify additional ports to forward..

HTH
~k
--

On Fri, 2009-04-24 at 10:35 -0500, Dean Shavit wrote:
> I would like to be able to forward ports from remote computers to  
> different IP addresses on my ssh server.
> 
> For example,
> 
> I forward port 443 like so:
> 
> ssh user@xxxxxxxxxx -R 443:127.0.0.1:44300
> 
> and the server listens on:
> 
> tcp4       0      0  127.0.0.1.46312        *.*                     
> LISTEN
> tcp6       0      0  ::1.46312              *.*                     
> LISTEN
> 
> If I turn gateway ports on, and forward like so:
> 
> ssh user@xxxxxxxxxx -R 443:server.com:44300
> 
> then netstat -an shows:
> 
> cp4       0      0  *.46312        *.*                    LISTEN
> tcp6      0      0  *.46312              *.*                    LISTEN
> 
> 
> I have multiple IP addresses on  my server, and I'd like sshd to  
> listen like this:
> 
> cp4       0      0  10.0.0.1.46312        *.*                    LISTEN
> tcp6       0      0  10.0.0.2.46312               
> *.*                    LISTEN
> 
> In other words, I'd like to have two ranges of ports, completely  
> separated (doubling the number of available ports for forwarding) on  
> two separate IPs.
> 
> Is this possible with OpenSSH?
> 
> If so, how does one configure it?
> 
> 
> 



[Index of Archives]     [Open SSH Unix Development]     [Fedora Users]     [Fedora Desktop]     [Yosemite Backpacking]     [KDE Users]     [Gnome Users]

  Powered by Linux