[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Xen 3.0, setting up a virtual network with NAT

On Fri, Feb 03, 2006 at 05:25:13PM +0000, Richard Jones wrote:
> On Fri, Feb 03, 2006 at 05:15:52PM +0100, CJ van den Berg wrote:
> > What you want is:
> > (network-script network-nat)
> I tried the above, and also:
>   (network-script 'network-nat netdev=dummy0')
> and neither works.  With these I can no longer ping my domU's even.

You don't need the dummy0 interface at all. Just use
(network-script network-nat)

> Can you tell us about your configuration?  It's really unclear what IP
> addresses I should give the domU's, whether I need dummy0 at all, and
> what IP addresses should go into the domU configuration files.

With the NAT scripts Xen assigns the IP addresses. You just need to add
dhcp=1 to the domU config file, which will add IP address configuration
parameters for the Xen assigned IP address to the kernel command line, or
use a dhcp server (which I prefer and have described below).

> It'd be great if you could share the relevant lines from your
> xend-config.sxp and from your domU *-config.sxp files.

Sure. In my xend-config.sxp I have:

(network-script network-nat)
(vif-script 'vif-nat dhcp=yes')

and in my domU configs (I'm not using .sxp files) I just have:

nics=1 (for Xen 3.0.0)


vif = [''] (for Xen 3.0.1)

That's it. Then of course you need a simple dhcp server config. For Debian:

aptitude install dhcp3-server

and then edit /etc/dhcp3/dhcpd.conf and add an empty section for the Xen
allocated addresses like this: (just stick it at the end of the file)

section netmask {

Then let Xen do the rest. Don't worry if your dhcp server refuses to start.
That's because it doesn't have any addresses to serve. Xen will add a
static IP assignment to the dhcpd.conf file for each domU that is created
and restart the dhcp server.

I have also made several enhancements to my local vif-nat so that a dns
server is also updated dynamically for each created domU, which allows me to
use hostnames when communicating from one domU to another. So I never have
to figure out what IP address a domU has.

CJ van den Berg


Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.