Routing Same Port Traffic to Different VMs based on Subdomain?


Recommended Posts

I have a few friends that I help out with testing different web sites / server setups before going live on their own site/server. To do this, I have set up multiple Virtual Machines on a Mac OS X Client Host (using VMware Fusion). The problem I run into is how to ensure traffic is routed to the appropriate Virtual Machine based on the Subdomain used. For example...

post-36528-1234900358_thumb.png

Let's say I have set up the subdomain vm1.domain.com on a Linux Guest Virtual Machine. What I know is that Port 80 would come over the Internet into the Airport Extreme router, where all Port 80 traffic is sent to a DNS Server (I assume) to translate which subdomain needs to be routed which Internal/Private IP Address. In this example, the DNS Server sees vm1.domain.com and knows to send it to 10.0.22.100.

My question is this. Is this the correct process? If so, would it be wise to run a DNS Server on the Mac OS X client or use another Virtual Machine just for DNS routing.

If this process is incorrect, what is the best way to set this up with the equipment that is available to me (as shown in the graphic)?

The DNS server you are talking about is all routed through your internet router (which sends the requests to your ISP DNS servers), which then sends back to the original requester (the pc or vm within the network).

If you wanna use the same port on different vm's to serve some application then you will need more than one static IP from your ISP. As more than likely you will have only 1 IP address assigned to your account.

Once you have more IPS from your ISP, then you can go ahead and assign these IPs to your VM's and the forwarding of ports should be alright (you might need to configure this on your internet router, so that it routes the right ports to the correct device/IP on the network).

Well... poo. I was hoping THAT wouldn't be the answer. Since this is just for testing more than anything, I guess I'll just use different port numbers for each server as there is no way I can afford multiple IPs for just test servers. Real bummer.

Anyone wanna give a second opinion? :)

  Reb0ot said:
The DNS server you are talking about is all routed through your internet router (which sends the requests to your ISP DNS servers), which then sends back to the original requester (the pc or vm within the network).

If you wanna use the same port on different vm's to serve some application then you will need more than one static IP from your ISP. As more than likely you will have only 1 IP address assigned to your account.

Once you have more IPS from your ISP, then you can go ahead and assign these IPs to your VM's and the forwarding of ports should be alright (you might need to configure this on your internet router, so that it routes the right ports to the correct device/IP on the network).

There is no need for other "opinions" that was the correct answer.. To send the same port to muliple IPs behind a nat, you need multiple public IPs.

Now depending on the application that is no big deal, and your private sides can all listen on the same port... Lets say for example it was RDP.

your public IP is 24.1.1.1, your privates are 192.168.1.100, .101, .102

On your router you could forward say 3389 to .100, 3390 to 3389 on .101 and 3391 to 3389 to .103 -- That is if your router supports this, any decent one would. If not you would have to change each vm to listen on the different ports for the application.

So somone on the outside that wanted to connect to machine 1 for rdp could just use normal 3389 port, but if wanted to connect to machine 2 he would go to 24.1.1.1:3390 which the router would send to 192.168.1.101:3389

But wanting to setup multiple machines to provide the same service on the same port to the public.. Sorry You would need multiple public IPs, there is no way to tell DNS anything about what port to connect to, etc.

One option you would be able to use is setting up Apache on the host machine or one of the guests) to proxy the requests to the relevant private IP, open up port 80 to that instance of Apache, and users outside would know no difference.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • You will soon have fewer reasons to open Control Panel in Windows 11 by Taras Buria Good news: more Control Panel bits are making their way to the Settings app, giving you fewer reasons to use the legacy UI that Microsoft buried deep inside its operating system. This time, the company is migrating certain clock-related settings, giving them a more modern look in the Settings app. The upgraded Settings app now lets you enable additional clocks in the notification center and adjust AM/PM indicators. These features work the same as they do in the legacy Control Panel: you can enable up to two additional clocks for two extra time zones and name them as you wish. Thanks to the redesign, the UI for setting up additional clocks supports dark and light themes, bigger UI elements, and improved accessibility. The same goes for the AM/PM indicators: you can customize them in Settings > Time & Language > Language & Region > Regional Format. Other Control Panel bits that recently made their way to the Settings app include some keyboard settings. Microsoft has not confirmed any of those changes yet, so stand by for announcements in future preview builds. Speaking of preview builds, this week, Microsoft released a new Canary build with improved context menus, taskbar changes, new accessibility features, and more. Check out the full release notes here.
    • Everything 1.4.1.1028 by Razvan Serea "Everything" is search engine that locates files and folders by filename instantly for Windows. Unlike Windows search "Everything" initially displays every file and folder on your computer (hence the name "Everything"). You type in a search filter to limit what files and folders are displayed. "Everything" only indexes file and folder names and generally takes a few seconds to build its database. A fresh install of Windows 10 (about 120,000 files) will take about 1 second to index. 1,000,000 files will take about 1 minute. "Everything" will run on Windows XP, Vista, Windows 7, Windows 8, Windows 10 and Windows 11. NTFS indexing requires the Everything service or running "Everything" as administrator. What is the Lite version of "Everything"? The Lite version of Everything is the same as the normal multilingual version of Everything, except it has some features removed: Removed ETP/FTP Server. Removed HTTP Server. Removed IPC. The Command line interface / ES will not work with the Lite version. The SDK will not work with the Lite version. Windows accessibility features and screen readers will not work with the Lite version. Everything 1.4.1.1028 changes: fixed a crash when getting help text from a context menu item that throws an exception. updated localization. "Everything" is Freeware. If you use "Everything" in a commercial environment and find it useful a donation would be appreciated. Download: Everything 1.4.1.1028 64-bit | Portable ~1.0 MB (Freeware) Download: Everything 1.4.1.1028 32-bit | Portable Download: Lite 32-bit | Lite 64-bit View: Everything Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • So you just don't like the statement? That's completely different than the statement not being true. And one doesn't have to be "full of hate" to acknowledge a cow is, in fact, a cow.
    • They are trying to pretend there is demand for this crap. That it's for special, wealthy, niche customers only right now. You know, the Apple marketing model.
  • Recent Achievements

    • Week One Done
      BlakeBringer earned a badge
      Week One Done
    • Week One Done
      Helen Shafer earned a badge
      Week One Done
    • First Post
      emptyother earned a badge
      First Post
    • Week One Done
      Crunchy6 earned a badge
      Week One Done
    • One Month Later
      KynanSEIT earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      669
    2. 2
      ATLien_0
      274
    3. 3
      Michael Scrip
      232
    4. 4
      Steven P.
      163
    5. 5
      +FloatingFatMan
      159
  • Tell a friend

    Love Neowin? Tell a friend!