I have a server with debian that uses the xen kernel. I've successfully created and started 2 xen nodes, lets call them xen1.domain.com and xen2.domain.com. They both have their own internal ip and they can be connected to interally. But the problem is that I only have 1 external ip. Is it possible for them to share the same external ip yet be able to connect to each one of them? I have a domain but I'm not sure how to set up the DNS records to work with this. Does anyone know how to do this?

  • What do you mean "connect" to each one of them? SSH, web, ? – h0tw1r3 Jul 28 '11 at 17:35
  • With SSH, like being able to write in xen1.domain.com and get to that certain node. – Kraffs Jul 28 '11 at 17:48

Yes, you need a load-balancer.

It 'own's the external IP and then uses one of a variety of methods to decide which of the internal servers to send the request to.

These are used everywhere all the time to deal with service outages etc. There are hardware ones such as those made by Cisco and F5 and software ones too (some are free, do some googling around).

  • Can you suggest a good software one? – Kraffs Jul 28 '11 at 17:47
  • I buy hardware ones so I'm not the best person to suggest a software one, though I'm sure someone will help further. – Chopper3 Jul 28 '11 at 17:49

It can't be done seamlessly. You have two options:

  1. Run one of the SSH daemons on a different port (like 122 vs standard 22)
  2. Port forward on the router. Outside port 122 -> port 22 of secondary host.

Then you can connect via ssh if you specify the port number.

  • I can currently connect to them by using their internal ip, but I want to be able to connect with using a subdomain like xen1.domain.com. Problem is that both have the same external ip so they collide. – Kraffs Jul 28 '11 at 19:07
  • That's the whole point of changing ports, so they don't collide. – h0tw1r3 Jul 28 '11 at 20:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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