Howdy all, 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! Many thanks, Ryan. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Tue, Dec 12, 2006 at 02:33:09PM +0000, Ryan Worsley wrote:> Howdy all, > > 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!Yes, I have. The secret isn''t really in the config files, unfortunately. A quick run-down to what I do: - Modify network-route to add the following line: iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE - Configure xend to use vif-route and network-route as the networking scripts. (and restart xend to pick up the new configuration) - Then bring up your domU, and -- the main problem -- fix the network configuration in the dom0 by taking down the unused vif interface, and configuring the tap interface instead: ifconfig vif1.0 down ifconfig tap0 10.16.0.3 netmask 255.255.255.0 up Your network configuration and devices may be different -- tweak as appropriate. Note that the IP address on tap0 should be in the same network as the domU machine. I use 10.16.0.1 for the tap0 device, and 10.16.0.2 for the domU''s network configuration. Hugo. -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk == PGP key: 1C335860 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- vi: The core of evil. --- _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
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 Craig-Wood <nick@craig-wood.com> -- http://www.craig-wood.com/nick _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Ryan Worsley
2006-Dec-12 22:31 UTC
Re: [Xen-users] NAT and Windows? - figuring out which domain in qemu-ifup!
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? Ryan. _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Nick Craig-Wood
2006-Dec-13 09:19 UTC
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@craig-wood.com> -- http://www.craig-wood.com/nick _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users