News: This forum is now permanently frozen.
Pages: [1]
Topic: Forward according to domain name?  (Read 2861 times)
« on: August 30, 2007, 02:07:43 »
speedar *
Posts: 3

Hello. I am looking for a way to have more servers running on same port but on different domains / sub-domains. I have one static IP, and domain names are redirected to this IP via my selectd ISP's A-records. Ex:

example.com -> 192.168.0.10
backup.example.com -> 192.168.0.11

These servers should be able to contact both via ftp/ssh/www/sql++ so all ports must be redirected. So when I ssh "backup.example.com" I will reach 192.168.0.11 and when I ftp "example.com" I will reach 192.168.0.10

Is this possable with m0n0wall, and how?
« Reply #1 on: August 30, 2007, 17:32:59 »
markb ****
Posts: 331

Simple setup in NAT you are simply wanting to port forward certain ports to certain machines.  The domain name isn't important.  Your DNS record with your isp will simply point it to the static address on the WAN port of your router.  You then need to add the inbound NAT entry to the router to forward the traffic on the specific port e.g. port 21 for ftp to the appropiate server. Don't forget to add the rule to pass the traffic, or check the box to let monowall add it for you.

Hope this helps.

Mark
« Reply #2 on: August 30, 2007, 18:28:28 »
speedar *
Posts: 3

Maby I was not clear enough (My english is not that good) But what I wanna is to be able to have two servers on the same ip witch uses the same ports. Like if I ssh example.com I reach 192.168.0.10 but if I ssh backup.example.com I reach 192.168.0.11 (both on port 22, but with different domain names) and same way with ftp, ssh, sql and so on. Both servers should use standard ports, but different domain names.
« Reply #3 on: August 31, 2007, 09:58:15 »
markb ****
Posts: 331

Ok. Then the answer is no.  you can only forward a port to a single destination.  To have multiple servers using the same ports, you would need additional IP addresses.
« Reply #4 on: August 31, 2007, 16:11:10 »
speedar *
Posts: 3

If any other encounter this problem, I found a "solution". As I said, I put up A-records to redirect to my IP. So all default requests goto my "default" server. And the ones for the aditional onees I set up cloaked www-forwarding to another port, and I run the other webserver on a different port. This way users will not have to specify ports for web atleast, but other services like ssh etc need to run on different ports on each macine.
 
Pages: [1]
 
 
Powered by SMF 1.1.20 | SMF © 2013, Simple Machines