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

Re: [Xen-users] NAT and Windows? - figuring out which domain in qemu-ifup!



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


 


Rackspace

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