Port Forwarding from Remote Computer to Multiple IPs



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?



Relevant Pages

  • Re: Whats a decent modem/router for tech savy user?
    ... It is not possible to route or deny traffic to specific ports based on the source IP address. ... But it wont route back inside the LAN - needs internal DNS server spoofing. ... Normally, this option should be Enabled, so that an Internet connection will be made automatically, whenever Internet-bound traffic is detected. ... Specifying a Default DMZ Server allows you to set up a computer or server that is available to anyone on the Internet for services that you haven't defined. ...
    (uk.telecom.broadband)
  • Re: Cannot connect to RWW from home PC
    ... That would be the address you need a DNS record for. ... You say "And in the router you need to forward to your external nic IP" ... Still can't telnet to any of your ports at your public ip address. ... Heres' the info for our server: ...
    (microsoft.public.windows.server.sbs)
  • Re: Netopia 3347NWG with Remote Desktop and Remote Web Workplace
    ... Glad you're back in business Greg! ... Ports Closed ... Despite this, Remote Web Workplace DOES WORK now, and Connect to Server ... Exchange BPA updates), ...
    (microsoft.public.windows.server.sbs)
  • [opensuse] ssh problem from remote LAN
    ... Set up a SLES 10 server and although I can ssh to it from any box on the ... other box on the local LAN via ssh. ... Nmap results show that the ssh port on the SLES 10 server is appearing as ... Interesting ports on 192.168.0.6: ...
    (SuSE)
  • Solution -> Re: SSH tunnel question.
    ... change IPS and ports around but that is not a big deal. ... telnet/ftp/rsh open on a server including on the Internet facing ports! ... I will go from the corp desktop to a hop ... through the firewall to the hop ...
    (SSH)