Production and testing server on a single ip address

I have a single external ip address which comes in through a modem to my production server. There are also several other computers connecting to the modem. One of those computers I want to run a virtual machine with a ubuntu/virtualmin server on it for testing. I have a separate registration that I can use.

Is there a way to have both a production and testing server on a single ip address connected to the internet?

If yes how?

Well, not a simple or reliable one :slight_smile:

Your best bet would be to have two separate IP’s, one IP pointing to live server, the other IP pointing to the test server.

Barring that – you could always forward some non-standard port on your one IP to another server. Something like port 81.

But that will only work if your websites all use relative URL’s. If they use any absolute URL’s, that would break.

You’d have to access your domains on the test server using something like this:

http://my_domain.tld:81

I’m a bit confused as to the network setup there. If you have multiple computers connecting to the Internet, but only one external IP address, that modem should in fact be a router, and you’re using LAN IP addresses for your computers?

It is generally impossible to operate multiple machines with the same IP address on the same network. That’s like having two houses with the same number next to each other… Which tends to understandably confuse the postman. :slight_smile:

Hi Eric thanks for the response.

Hi Locutus

My explanation was a bit brief so I will try to clarify incase anyone knows how to do what I want.

I have an external ip address lets call it 55.55.55.55 which is connected to a wireless modem/router. Attached to the modem via cables are 3 computers on internal ip addresses 192.168.0.2 (the production server) with all necessary ports forwarded to it. There are also two desktop computers 192.168.0.4 and 192.168.0.6. and two laptops are connected wirelessly on ip addresses 192.168.0.8 and 192.168.0.10 respectively.

So 192.168.0.2 is the production server and I want to set up a virtual machine on the 192.168.0.10 computer and because of the way virtual machines are setup, the virtual machine will have its own internal ip address 192.168.0.12.

What I want to do is have both the production server 192.168.0.2 and the virtual machine testing server 192.168.0.12 accessible to the internet and all necessary ports. However the virtual machine 192.168.0.12 could have some sort of relaying or forwarding to it because it is strictly for testing and will not be on all the time.

Any suggestions will be appreciated.

AllanIT

Howdy,

Well, generally what you’re after requires one public/external IP address for each server you want to be accessible on the Internet.

Once you forward a port to your production server, that port is used – it can’t be later used for your test server.

So if you forward ports 21 (FTP), 22 (SSH), 25 (SMTP), 80 (HTTP), and Webmin (10000) – those ports can no longer be used for your test server.

The only way to accomplish what you’re after with a single IP address would be to forward different ports in to that test server, and access those alternate ports when testing. So, instead of forwarding port 80 for HTTP, forward port 81. Instead of port 10000 for Webmin, forward 10001.

That’s not really an ideal setup though – you might find it simpler to either ask your ISP for an additional IP address, or to buy a cheap VPS, and use that VPS for your testing.

-Eric

Yep, Eric said it all, I agree and can’t add anything else right now. :slight_smile:

Oh, maybe one thing, we can all just wait for IPv6 to become fully spread, then there won’t be any lack of IP addresses for anyone, anymore. :wink: