Avatar of grgur
grgur
 asked on

Port forwarding - one port to many based on url

Situation:
Our office is connected to the Internet with high speed connection. Our ISP opened 5 ports for us. Their CISCO router forwards SMTP, POP3 and HTTP ports to Debian etch web/mail server in our local network. RDP and Kerio Winroute firewall VPN (port 4090) ports are forwarded to another WIn XP computer in our local network.

Problem:
We would like to use more ports. Extra block of 5 ports that our ISP forwards is too expensive. Is it possible to establish some sort of port forwarding/translation so that requests to specified port are forwarded to another port based on domain name or some other query?

Example:
ssh.ourcompany.com:4090  forwards request to   192.168.1.1:22
imap.ourcompany.com:4090  forwards request to   192.168.1.10:143

I thank you for your ingenious answers in advance :). Solutions in windows or linux are fine.
RoutersNetwork ArchitectureNetwork Operations

Avatar of undefined
Last Comment
SyncMaster

8/22/2022 - Mon
SyncMaster

ssh.ourcompany.com:4090 is not an url but a FQDN (Full Qualified Domain Name).

They are only used to translate the to IP-Adresses. Routers don´t care about domainnames in Rule-Sets.
You could just open 1 ssh port to a box and then use this ssh connection as a tunnel.
When using e.g. putty you can easily configure ssh-tunnels.
Example:

You configure a tunnel for port 2222 to 192.168.1.10:143

to connect to the imap-server on 192.168.1.10 you have to connect to localhost:2222 which is then tunnel to the imap-server.

Bad english, I know, I´m not a native speaker.......
grgur

ASKER
I understand that domains just point to IP address. I am interested in rules that distinguish domain names in request.

ssh tunnel is a nice thing, but can I accomplish tunneling that 2222 port to two or more ports on destination host?
ASKER CERTIFIED SOLUTION
SyncMaster

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
grgur

ASKER
Thank you for your answer.

Do you know of a way to create a windows service for putty to create and recreate the tunnel autmatically?

Also, is it possible to do in linux?
Your help has saved me hundreds of hours of internet surfing.
fblack61
SyncMaster

I think putty has some command line options, check them out.

I don´t know of an "automatic service" way.