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] NAT and Windows? - figuring out which domain in qemu-ifu

To: Ryan Worsley <R.C.Worsley@xxxxxxxxxxxx>
Subject: Re: [Xen-users] NAT and Windows? - figuring out which domain in qemu-ifup!
From: Nick Craig-Wood <nick@xxxxxxxxxxxxxx>
Date: Wed, 13 Dec 2006 09:19:06 +0000
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 13 Dec 2006 01:23:45 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <457F2DD8.2070202@xxxxxxxxxxxx>
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>
References: <457EBDA5.7030608@xxxxxxxxxxxx> <20061212183512.GA27730@xxxxxxxxxxxxxx> <457F2DD8.2070202@xxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.13 (2006-08-11)
On Tue, Dec 12, 2006 at 10:31:52PM +0000, Ryan Worsley wrote:
> Nick Craig-Wood wrote:
> >On Tue, Dec 12, 2006 at 02:33:09PM +0000, Ryan Worsley wrote:
> >  
> >>Has anyone got xen NAT and a windows guest setup correctly?  If so could 
> >>I have a look at your config file?  If it's not possible could someone 
> >>tell me how it should be done!
> >>    
> >
> >It is broken I think (same problem as vif-route) under HVM.
> >
> >  http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=584
> >
> >Put commands in /etc/xen/qemu-ifup to set up the interface manually.
> >
> >  
> Nick you're a legend!  This is exactly my problem, actually that's a 
> lie, I have a tap adapter - but same difference.  I dearly want to 
> follow your advice and make the qemu-ifup script tear down the vif 
> adapter - problem is the vif adapter is named something like vifX.0 
> where X is the domain number.  I don't know how I can figure out the 
> correct domain number in qemu-ifup, to perform the correct tear down - 
> anyone got any ideas?

This is what I do.  It is a bit of a cheat!

Note that the qemu-ifup script is passed the interface name as $1 and
the bridge name as $2, so you can set the bridge name different in
each of your HVM domains, eg

  vif = [ 'type=ioemu, bridge=YOURDATA' ]

Then use $2 in qemu-ifup to configure different stuff according to the
bridge name.

For instance you could make YOURDATA be the ip address that you
require for the interface, or make it the domain name and use a case
statement in the qemu-ifup script to work out what to do.

Eg something like this in the config file

  vif = [ 'type=ioemu, bridge=192.168.0.10' ]

Then something like this in the /etc/xen/qemu-ifup should work for
plain routing.

#!/bin/sh

main_ip=192.168.0.1
if=$1
ip=$2

ifconfig ${if} ${main_ip} netmask 255.255.255.255 broadcast ${main_ip} up
ip route add ${ip} dev ${if} src ${main_ip}
echo 1 >/proc/sys/net/ipv4/conf/${if}/proxy_arp
echo 1 >/proc/sys/net/ipv4/conf/${if}/rp_filter

I haven't actually tested exactly that - I do something a bit more
complicated since I rename the interfaces also.

-- 
Nick Craig-Wood <nick@xxxxxxxxxxxxxx> -- http://www.craig-wood.com/nick

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

<Prev in Thread] Current Thread [Next in Thread>