Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a Citrix XenServer setup, and while I personally lean more towards Dev than Ops, I've got an issue that's been bugging me.

When you provision a new (Linux/Ubuntu) guest, how do you get it to have the correct IP-address? I'd want my application servers to exist in the range of, preferably being .1, .2, etc, so I can keep my sanity.

I guess that the actual IP-address is something set in Linux itself, and Xen can't touch that, but then what's the best practice for getting it done? If you set up DHCP, don't you just move the problem to getting the adapters the "correct" MAC-addresses? Do you just have to hardcode a large table of MAC-addresses to IP-addresses, and then provision new guests always with the correct MAC-address on the virtual ethernet adapter?

What we currently do is have an image of a "app server" that we boot up a new instance of, and then finalize it (with a script) that (among other things) modifies the /etc/networking/interface file to give it the correct IP. But that feels dirty to me, and I feel like surely there must a better way. Please enlighten me?

share|improve this question

The fact that it's virtualised is almost immaterial. You configure the IP address as per best practice for any server on your network. What would you do if you were installing a physical server? If it's set it statically (Almost certainly the right answer) then do this. If it's using reserverations in DHCP (Which is also acceptable) then do that.

With the latter, again, it's the same as a physical server. Yes, you'd need a list of MAC addresses and, yes, those would need to stay the same. With XenServer you can either stick to the generated MAC or define your own - though I'd recommend against this unless you have some specific need.

How you're doing it sounds fine to me, assuming provisioning servers isn't a daily task. If you're trying to completely automate server deployment in a "cloud" style manner, then that's something a little different. There are products out there to help you do this, but nothing really built into vanilla XenServer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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