I have a dedicated server where I'm running several web-facing virtual machines on public IP addresses; I pay my hosting provider for each IP.

I would also like to run virtual machines with private addresses. Which addresses can I use: does it depend on my hosting provider or can I just use any Ip address from private address spaces?

  • 4
    Nickolai, just in case you don't know, local etiquette is that when you're happy with an answer to your question, you accept it by clicking the "tick" outline next to it. This drives the SF reputation system for the author, and for you, and it stops the question floating around forever. You've asked a number of questions in your four days here, most of which have answers, none of which you've accepted, so I thought I'd mention it. My apologies if you already know this. – MadHatter Mar 26 '14 at 12:57
  • 2
    @MadHatter Thanks for your reminder! I was waiting to see if I get all the answers I will get for the questions, and then pick and tick the best ones. E.g. I see an answer that looks good to me, but who knows, maybe an even better one is possible? I'll "tick" the answers to my questions soon. – Nickolai Leschov Mar 26 '14 at 13:21
  • Sorry to have hassled you! – MadHatter Mar 26 '14 at 13:22

You can use any addresses in the following ranges:

  • 10.x.x.x
  • 192.168.x.x
  • 172.16.x.x - 172.31.x.x

As mentioned by others, your provider may have certain ranges or addresses reserved.
If that is the case, they would probably let you know, since it would be completely irresponsible not to do so (you could break their network otherwise).

See this wiki article for more information about private networks

  • 3
    In case you didn't notice, I have referenced that same wiki article in the original question. – Nickolai Leschov Mar 26 '14 at 13:24
  • It's still nice to link it, since many people view this site, and might miss the link in your question. – Vasili Syrakis Mar 26 '14 at 22:28

You can use any private addresses you want, that's kind of their definition.

(That said, there are cases like running private networks inside a provider where they may need to set up or give you the private addresses for internal routing/switching reasons)

  • 2
    Yaah. At the end: Ask the provider whether they use any private addresses you should be aware of. – TomTom Mar 26 '14 at 12:55
  • Usually providers don't give good (or any) answers here (in my experience). Most cable modems of my provider are reachable under even though my internal network is a 10.0.*. My modem get an IP 10.201.* while it's gateway is 10.157.*. But apart from the modem I won't be able to reach any of these private addresses behind the modem even if I wouldn't use a 10 network inside. Maybe it wouldn't even be a problem when my router would occupy the modem IP ( aside that I couldn't access the modem anymore. – 2called-chaos Mar 26 '14 at 15:35
  • 1
    @2called-chaos That is an entirely different scenario with no bearing on the question. (Question is about using private addresses on the internal network of a hosting provider.) Please don't confuse things. – Tonny Mar 26 '14 at 15:55
  • Sorry, I was confused :) Should I just remove my comment? (including this one) – 2called-chaos Mar 26 '14 at 16:00

When your virtual machines use in-host virtual networking (they only communicate with the host or other VMs running under the same host) you can assign literally any IP address you want.

But when you would like to communicate with VMs or bare-metal machines running on other servers, you will need to use the network infrastructure of your hosting provider, which means that you can not just assign any IP you like. When you just assign any IP address you like, you might run into address conflicts with other customers in the same datacenter. So each virtual machine needs a LAN IP assigned by the provider.

This, however, assumes that the virtual machines even are on the same LAN. When your hosting provider is large, chances are that their servers are on different LAN networks. Or maybe the physical machines are on a LAN for management purposes, but all the VMs are intentionally isolated from the management LAN for security reasons and can only communicate via their Internet IPs.

You need to consult your hosting provider for details.

When your hosting provider doesn't provide more than one LAN-IP to each of your servers (or doesn't do so for a reasonable price), you could set up a VPN tunnel between the physical servers and bridge the in-host VM networks with that VPN tunnel.

  • Very nice answer. Covers most of of the complications. – Tonny Mar 26 '14 at 15:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.