Hello Xen users, i have one question that concerns xen and hvm. I have problem with network-route working with hvm guest machines. Main problem is that interface named in vif isnt the one that routing should go by. The interface is tapx.x, but that interface changes its name with every guest restart. So my question is how to fix this ? Does anyone has some script that will change route with correct new tap interface name , or patch for vif-route? Thanks in advance Zoran _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Sep 2, 2010 at 7:44 PM, Miladin Stojkovic <mikilance@yahoo.com> wrote:> Hello Xen users, > > i have one question that concerns xen and hvm. > I have problem with network-route working with hvm guest machines. Main problem is that interface named in vif isnt the one that routing should go by. The interface is tapx.x, but that interface changes its name with every guest restart. > So my question is how to fix this ? > Does anyone has some script that will change route with correct new tap interface name , or patch for vif-route?I''d actualy suggest you use network-bridge instead. Much easier to manage. Install libvirt (which will help you create virbr0 that provides NAT networking) if needed. That being said, Xen 4.0 should give you persistent device names. If you have something like this on HVM domU config vif = [ ''mac=00:16:3E:63:2E:90, vifname=test-eth0'', ] you''d get two interface on dom0 that represents that vif, one named "test-eth0" (the vif interface, used when domU has PV drivers), and "tap-test-eth0" (the tap interface, recognized as emulated realtek by default on domU). Just make sure you use short-enough vifname (8 chars or so will do). Previously the tap interface (on Xen 3.4.2 anyway) was named tapx.y (x and y are numbers) regardles what you put in vifname. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Sep 2, 2010 at 9:31 PM, Miladin Stojkovic <mikilance@yahoo.com> wrote:> I cant use bridge cause of being able to use only 1 mac per interface. Now question is , can i hide my domU macs if i use bridge somehow ?Does that mean you only have one public IP address as well? If yes, simply using bridged networking and virbr0 bridge will solve your problem, as it does the NAT setup for you.> > I alrdy have the above mentioned setup in domU conf , with mac and vifname , and i get tap1.0 and vifvm101.0 interfaces(my name for static interface for domU).Then the easiest way for you is to use PV drivers on domU, like GPLPV for Windows domUs. It will then route traffic thru the vif (not the tap). Upgrading to Xen 4 on Centos is possible, but not easy (as you have to change the kernel as well) -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
> > I cant use bridge cause of being able to use only 1 > mac per interface. Now question is , can i hide my domU macs > if i use bridge somehow ? > > Does that mean you only have one public IP address as well? > If yes, > simply using bridged networking and virbr0 bridge will > solve your > problem, as it does the NAT setup for you. > > > > > I alrdy have the above mentioned setup in domU conf , > with mac and vifname , and i get tap1.0 and vifvm101.0 > interfaces(my name for static interface for domU). > > Then the easiest way for you is to use PV drivers on domU, > like GPLPV > for Windows domUs. It will then route traffic thru the vif > (not the > tap). > > Upgrading to Xen 4 on Centos is possible, but not easy (as > you have to > change the kernel as well) > > -- > FajarOk First i have public ips for all domUs needed , and i need to use public ips. Is there any chance in that way to use nat for only mac? 2nd. Do you think i should go for xen 4 ? Or xen 4 has same problem with route and bridge ? And finaly , i used PV drivers on 1 centos domU , and it worked , but after first restart , its all back to tap interface again , even thou modprobe.conf is setup to use pv drivers. Tnx for help! Zoran _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
On Thu, Sep 2, 2010 at 9:48 PM, Miladin Stojkovic <mikilance@yahoo.com> wrote:> Ok > First i have public ips for all domUs needed , and i need to use public ips. Is there any chance in that way to use nat for only mac?Possible, but not by using virbr0. You need to create a bridge manually (see ifcfg-br0 example from https://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.5/html/Virtualization_Guide/sect-Virtualization-Network_Configuration-Bridged_networking_with_libvirt.html). Then setup iptables manually to perform NAT on dom0 (or use some tools like fwbuilder). This way, dom0 becomes router/firewall for all domUs, with an "public" interface (eth0) connected to public network and a "private" interface (br0 or whatever bridge you created) connected to domUs. Of course this is just one possible method. You can choose whatever method you feel comfortable best.> > 2nd. Do you think i should go for xen 4 ? Or xen 4 has same problem with route and bridge ?I use bridging. Never have any need to use route. If you use Xen 4, you need to replace the kernel as well (here''s what I use: http://lists.xensource.com/archives/html/xen-users/2010-07/msg00452.html), which might not be so straightforward. If you choose to use Xen 4, I suggest you use it on dev environment first.> > And finaly , i used PV drivers on 1 centos domU , and it worked , but after first restart , its all back to tap interface again , even thou modprobe.conf is setup to use pv drivers.Why did you even use HVM? It''s much easier (and performance will be higher) if you simply use PV domU. Anyway, this thread contains example on how to use PV drivers on RHEL/Centos HVM, and how to convert it to PV if you need to. -- Fajar _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users