Hi! This is my first contact with xen, and I think it''s great. I''m just having some networking problems. Let me explain how is my server situation. I have a server that act as a gateway with two network interfaces. eth0 is the interface used in the local network (ip: 172.16.10.1, 255.255.255.0) eth1 is the interface connected to the internet modem (dhcp) I have a vpn interface as well (ip: 172.16.10.1, 255.255.0.0) configured with tinc. I share the internet connection with the local network using nat... (route -n && iptables) output below... Everything works great with this configuration. I''ve read a lot of docs about xen networking, but didn''t manage to get it working. What I want to do is to give the VM the IP 172.16.10.50, 255.255.255.0 gw 172.16.10.1, just like any other machine in the local network. First things first. I''ve managed to install a windows xp with xen. I did it without any network configuration, i.e, no vif option at win.cfg file. OK. Now I have an installed windows, but no networking. It makes sense to me the usage of a bridge with eth0. What do you suggest? Here are the things I''ve tried: - vif = [ ''type=ioemu, ip=172.16.10.50'' ] - vif = [ ''bridge=xenbr0'' ] - vif = [ ''type=ioemu, bridge=xenbr0'' ] I''ve tried those with different configurations in /etc/network/interfaces using: auto eth0 iface eth0 inet static address 172.16.10.1 netmask 255.255.255.0 auto xenbr0 iface xenbr0 inet static address 172.16.10.50 netmask 255.255.255.0 bridge_ports eth0 also didn''t work. When I configure the interfaces like this and run /etc/init.d/networking restart, the eth0 looses it IP address, and nothing works anymore... I''m using Ubuntu 12.04 server... xen version 4.1.2 and 3.2.0-30-generic kernel... Thanks a lot for any help with that! Vinicius 8<-------------------------------------------- $ route -n Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface 0.0.0.0 192.168.254.254 0.0.0.0 UG 100 0 0 eth1 172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 vpn 172.16.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 192.168.254.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1 $ iptables -t nat -L Chain PREROUTING (policy ACCEPT) target prot opt source destination Chain INPUT (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain POSTROUTING (policy ACCEPT) target prot opt source destination MASQUERADE all -- 172.16.10.0/24 anywhere
Hello. Approach one issue at time. First thing first, get a stable networking configuration on your Dom0. Read http://wiki.xensource.com/xenwiki/XenNetworking , it has nice pictures. El 13/09/12 13:46, Vinicius Kwiecien Ruoso escribió:> eth0 is the interface used in the local network (ip: 172.16.10.1, 255.255.255.0) > eth1 is the interface connected to the internet modem (dhcp)Good.> I have a vpn interface as well (ip: 172.16.10.1, 255.255.0.0) > configured with tinc.Forget this one for the moment, shut it down while troubleshooting, if possible. Reduce the variables.> What I want to do is to give the VM the IP 172.16.10.50, 255.255.255.0 > gw 172.16.10.1, just like any other machine in the local network.That seems the right setup.> OK. Now I have an installed windows, but no networking. > It makes sense to me the usage of a bridge with eth0.Windows is not a guest system I would start with, but should work anyway.> What do you suggest?#vif = [ ''mac=00:16:3e:XX:XX:XX,bridge=xenbr0'' ] vif = [ ''type=ioemu,mac=00:16:3e:XX:XX:XX,bridge=xenbr0'' ] Us the same valid MAC in both cases. Comment out the second line and uncomment the first, when (and if) you install PV drivers.> I''ve tried those with different configurations in /etc/network/interfaces > > using: > auto eth0 > iface eth0 inet static > address 172.16.10.1 > netmask 255.255.255.0 > > auto xenbr0 > iface xenbr0 inet static > address 172.16.10.50 > netmask 255.255.255.0 > bridge_ports eth0Don''t do that. Do not set up IP address on the eth0 itself AND the bridge, configure only one address once. configure Dom0''s address, leave the VM to deal with it''s IP address on it''s own. You probably started like this: auto eth0 iface eth0 inet static address 172.16.10.1 netmask 255.255.255.0 End like this: #auto eth0 #iface eth0 inet static # address 172.16.10.1 # netmask 255.255.255.0 auto xenbr0 iface xenbr0 inet static address 172.16.10.1 netmask 255.255.255.0 bridge_ports eth0> also didn''t work. When I configure the interfaces like this and run > /etc/init.d/networking restart, the eth0 looses it IP address, and > nothing works anymore...Note, that while you already have VMs running, a "networking restart" is not a good idea: a starting VM will attach it''s network interface to a existing bridge, after a "network restart" this on-the-fly configuration will be broken. If there is no running VM''s, "network restart" should be a valid operation. I am leaving out of this the masquerading setup. It''s complete different matter, approach it once your networking is fine. Cheers. -- Alexandre Kouznetsov
On Fri, Sep 14, 2012 at 1:46 AM, Vinicius Kwiecien Ruoso <vinicius.ruoso@gmail.com> wrote:> I''ve tried those with different configurations in /etc/network/interfaces > > using: > auto eth0 > iface eth0 inet static > address 172.16.10.1 > netmask 255.255.255.0 > > auto xenbr0 > iface xenbr0 inet static > address 172.16.10.50 > netmask 255.255.255.0 > bridge_ports eth0 > > > also didn''t work. When I configure the interfaces like this and run > /etc/init.d/networking restart, the eth0 looses it IP address, and > nothing works anymore...Duh. Your config is wrong. If eth0 is part of the bridge, then you put the IP on the bridge, not on eth0. Examples (both assume you use dhcp, adjust as needed): - http://wiki.xen.org/wiki/Xen_Beginners_Guide#Setup_Linux_Bridge_for_guest_networking - http://wiki.1tux.org/wiki/Ubuntu/Bridge -- Fajar
Hi! Thanks for your responses! Both answers were very helpfull. Everything worked just great: VPN, the nat and the VM LAN. My mistake was that in the interfaces file I was always declaring both the eth0 and the xenbr0 (even with the eth0 with no configurations). Now I just have another question. Assume I''m going to create a new VM, and it will have the same parameters as this one (bridge eth0). I should create another bridge (xenbr1), or it will automatically use the existing bridge (xenbr0)? Also, I''m trying to install windows server 2008 instead of the xp. I get a blue screen with the 0x0...7E error. I''ve checked the list for previous errors like this, and trying the following. - Used 2 different isos (one downloaded from MS) and another from a DVD. - with the DVD iso I get the blue screen just after the "windows loading files" - with the MS iso I get the blue screen a few seconds after the GUI is launched saying "starting windows" - I''ve changed the DVD configuration file from file:/ to tap:aio: - I''ve all acpi,apic and pae = 1 in the config Any ideas? Should I send another email with a different subject? Thanks again for your suggestions. Vinicius 2012/9/13 Fajar A. Nugraha <list@fajar.net>:> On Fri, Sep 14, 2012 at 1:46 AM, Vinicius Kwiecien Ruoso > <vinicius.ruoso@gmail.com> wrote: >> I''ve tried those with different configurations in /etc/network/interfaces >> >> using: >> auto eth0 >> iface eth0 inet static >> address 172.16.10.1 >> netmask 255.255.255.0 >> >> auto xenbr0 >> iface xenbr0 inet static >> address 172.16.10.50 >> netmask 255.255.255.0 >> bridge_ports eth0 >> >> >> also didn''t work. When I configure the interfaces like this and run >> /etc/init.d/networking restart, the eth0 looses it IP address, and >> nothing works anymore... > > Duh. Your config is wrong. > > If eth0 is part of the bridge, then you put the IP on the bridge, not on eth0. > Examples (both assume you use dhcp, adjust as needed): > - http://wiki.xen.org/wiki/Xen_Beginners_Guide#Setup_Linux_Bridge_for_guest_networking > - http://wiki.1tux.org/wiki/Ubuntu/Bridge > > -- > Fajar
Vinicius Kwiecien Ruoso wrote:>Assume I''m going to create a new VM, >and it will have the same parameters as this one (bridge eth0). I >should create another bridge (xenbr1), or it will automatically use >the existing bridge (xenbr0)?Normally you would want to be using the same network setup. So when specifying the VIF entry for the new VM, specify the same xenbr0. It may help to take a step back and consider what all this represents. The bridge is analogous to a physical switch. The VM is analogous to a physical box. And if you don''t do anything special in the Dom0 then that isn''t really analogous to anything - but if doing NAT, then it''s analogous to a standalone router doing NAT. So having got your standalone router doing NAT, and a physical switch allowing devices to be connected to it, you can connect multiple servers to that same switch. In the same way, once you''ve got the Dom0 with NAT and a bridge running, you can connect multiple VMs to the one bridge. -- Simon Hobson Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed author Gladys Hobson. Novels - poetry - short stories - ideal as Christmas stocking fillers. Some available as e-books.
Perfect. Thanks a lot for this explanation Simon! 2012/9/14 Simon Hobson <linux@thehobsons.co.uk>:> Vinicius Kwiecien Ruoso wrote: > >> Assume I''m going to create a new VM, >> and it will have the same parameters as this one (bridge eth0). I >> should create another bridge (xenbr1), or it will automatically use >> the existing bridge (xenbr0)? > > > Normally you would want to be using the same network setup. So when > specifying the VIF entry for the new VM, specify the same xenbr0. > > It may help to take a step back and consider what all this represents. The > bridge is analogous to a physical switch. The VM is analogous to a physical > box. And if you don''t do anything special in the Dom0 then that isn''t really > analogous to anything - but if doing NAT, then it''s analogous to a > standalone router doing NAT. > > So having got your standalone router doing NAT, and a physical switch > allowing devices to be connected to it, you can connect multiple servers to > that same switch. In the same way, once you''ve got the Dom0 with NAT and a > bridge running, you can connect multiple VMs to the one bridge. > > -- > Simon Hobson > > Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed > author Gladys Hobson. Novels - poetry - short stories - ideal as > Christmas stocking fillers. Some available as e-books. > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xen.org > http://lists.xen.org/xen-users