WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] Xen 3.0, setting up a virtual network with NAT
From: CJ van den Berg <cj@xxxxxxxxxxxxx>
Date: Fri, 3 Feb 2006 22:33:11 +0100
Delivery-date: Fri, 03 Feb 2006 21:43:50 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20060203172513.GB6549@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: xen-users@xxxxxxxxxxxxxxxxxxx
References: <20060203163147.GA6549@xxxxxxxxxxxxxxxxxxx> <20060203161552.GC7325@xxxxxxxxxxxxxxxxxxxxx> <20060203172513.GB6549@xxxxxxxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.11+cvs20060126
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)

or

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 10.0.0.0 netmask 255.255.0.0 {
}

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

mailto:cj@xxxxxxxxxxxxx
  xmpp:cj@xxxxxxxxxxxxx
   sip:8918316@xxxxxxxxxx

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users