The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 10 of 10

Thread: Different ips for virtual servers?

  1. #1

    Different ips for virtual servers?

    So you know when you create a server, and you use the external ip not the pcs ip but the one for internet... often looks like 86.128.96.8 ...

    Well, how would I assign a different external ip for virtual machines? since I am trying to set up a server cluster thingie mabob and I'm wondering how you would connect to a different one with an assigned ip?

    for example:

    86.128.96.8 goes to Virtual Server One
    86.128.96.9 goes to Virtual Server Two
    86.128.96.10 goes to Virtual Server Three

    and so on...

    any ideas?
    My Photography
    Twitter

    K-Emmys-06: Best "Newbie"

  2. #2
    Wait, are you talking about your home NAT setup?
    Wait, what?

  3. #3
    erm... no I'm talking about dedicated ips for servers so that people outside of my LAN can use to connect to each server... hopefully makes a little more sense.
    Last edited by chrisclick; August 13th, 2009 at 01:16 PM.
    My Photography
    Twitter

    K-Emmys-06: Best "Newbie"

  4. #4
    Well of course, but your server is still in a separate LAN not directly connected to the internet? And you want to have virtual Apache servers on the same physical machine to be accessible by different static IPs, right? Can you describe your network topology?

    Either way, you'll want to read up on IP-based virtual hosts in Apache and some vhost configuration examples.
    Wait, what?

  5. #5
    Thanks for the links ill take a look, I drew up a diagram of how its all connected:

    Name:  Untitled-2.jpg
Views: 20
Size:  12.0 KB
    My Photography
    Twitter

    K-Emmys-06: Best "Newbie"

  6. #6
    Oh sorry, it looks like you're talking about actual virtual machines, not Apache virtual hosts? I guess in that case you'll have to look into the documentation of whatever virtualisation software you're using. That router, is that a full-blown router or the home router kind?
    Wait, what?

  7. #7
    The router is a home router kind.
    My Photography
    Twitter

    K-Emmys-06: Best "Newbie"

  8. #8
    Right, so it probably is a NAT router then (which I'm guessing is also located in your home). For the sake of demonstration, let's say you want to use the 3 example IPs you posted earlier.

    So first of all, you'll want to make sure that you actually have the static IPs at your disposal from your ISP. Next, you'll need the physical machine to have multiple IP addresses assigned to it. You can do that by using multiple physical network interfaces, or by using IP aliasing, which enables a single physical network interface to have multiple IPs associated with it. If your server machine is a *NIX box, you can find a guide on how to set up IP aliasing here; I have no idea how to do the same on Windows.

    Since your server is inside your LAN, you'll want to assign 3 static, local IPs to it. Most NAT routers employ DHCP to spare their clients the trouble of setting up static IPs, so you'll want to take care to assign IPs that fall outside of the DHCP range (or just disable DHCP alltogether and use any IP you like). Also, be careful not to use the local IP used by the router (often the first IP in its network). Let's say the local IPs you've assigned are:

    Code:
    192.168.0.2
    192.168.0.3
    192.168.0.4
    Now would be a good time to configure your virtual machines to each use one of these IPs. I don't know which virtualisation solution you're using and have never done anything like this regardless, so you'll have to dive into its documentation.

    Then, you'll need to configure the firewall on your NAT router to accept and forward requests for each of the external IPs to a corresponding local IP of the physical server. Each external IP should correspond to exactly one local IP. So what you would have is:

    Code:
    86.128.96.8  <--NAT--> 192.168.0.2 <--IP aliasing--> Virtual Server One
    86.128.96.9  <--NAT--> 192.168.0.3 <--IP aliasing--> Virtual Server Two
    86.128.96.10 <--NAT--> 192.168.0.4 <--IP aliasing--> Virtual Server Three
    You can usually allow/disallow ports and protocols at will here; unless you have specific needs, I suggest you keep the allowed traffic to a minimum of maybe SSH, FTP and HTTP(S).

    That should about do it. To test if it works, remember to access the external IPs from outside your LAN.

    *EDIT: I just remembered why I thought you were talking about Apache virtual hosts; because your topic title has "Apache" in front of it. So which is it, are you using actual virtual machines or do you want Apache virtual hosts?
    Wait, what?

  9. #9
    Thanks for the post Very informative and I shall put it to use.

    I am using actual Virtual Machines
    My Photography
    Twitter

    K-Emmys-06: Best "Newbie"

  10. #10
    Right I did some looking around, and to get static ips from my ISP I'll have to go to a buisness plan. Which is actually cheaper than my current plan.
    My Photography
    Twitter

    K-Emmys-06: Best "Newbie"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012