Jan Vejvalka
2011-May-04 16:08 UTC
[Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
Hi *, having built Xen 4.1.0 and running my Dom0 on Slackware 13.1, I''m trying to assign different physical network interfaces to different DomU guests: vif = [ ''bridge=ethX'' ] in the DomU configuration files. My /etc/xen/scripts/network-bridge script, however, doesn''t create more than one bridge: root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth0 root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth1 only creates the eth0 bridge. There is a check in the script that prevents it from creating more than one bridge: (...) op_start () { (...) if [ `brctl show | wc -l` != 1 ]; then return fi Why ? Is that a bug, a feature, or is it something that came in in the process of building Xen ? Did I miss something somewhere ? Thanks, Jan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Todd Deshane
2011-May-04 21:42 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
On Wed, May 4, 2011 at 12:08 PM, Jan Vejvalka <jan.vejvalka@lfmotol.cuni.cz> wrote:> Hi *, > > having built Xen 4.1.0 and running my Dom0 on Slackware 13.1, I''m > trying to assign different physical network interfaces to different > DomU guests: > > vif = [ ''bridge=ethX'' ] > > in the DomU configuration files. > > My /etc/xen/scripts/network-bridge script, however, doesn''t create more > than one bridge: > > root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth0 > root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth1 > > only creates the eth0 bridge. > > There is a check in the script that prevents it from creating more than > one bridge: > > (...) > op_start () { > (...) > if [ `brctl show | wc -l` != 1 ]; then > return > fi > > Why ? Is that a bug, a feature, or is it something that came in in the > process of building Xen ? Did I miss something somewhere ? >Networking in Xen 4.1+ has changed: http://wiki.xensource.com/xenwiki/MigrationGuideToXen4.1%2B See also: http://wiki.xensource.com/xenwiki/HostConfiguration/Networking http://wiki.xensource.com/xenwiki/Xen4.1 Thanks, Todd> Thanks, > > Jan > > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- Todd Deshane http://www.linkedin.com/in/deshantm http://www.xen.org/products/cloudxen.html http://runningxen.com/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jan Vejvalka
2011-May-05 08:49 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
>> root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth0 >> root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth1 >> >> only creates the eth0 bridge. >> >> There is a check in the script that prevents it from creating more than >> one bridge: >> >> (...) >> op_start () { >> (...) >> if [ `brctl show | wc -l` != 1 ]; then >> return >> fi >> >> Why ? Is that a bug, a feature, or is it something that came in in the >> process of building Xen ? Did I miss something somewhere ? >>> Networking in Xen 4.1+ has changed: > http://wiki.xensource.com/xenwiki/MigrationGuideToXen4.1%2B > > See also: > http://wiki.xensource.com/xenwiki/HostConfiguration/Networking > http://wiki.xensource.com/xenwiki/Xen4.1I see. But I did not upgrade, I installed from fresh. Does it mean that the /etc/xen/scripts/network-bridge script is obsolete ? Is there some info/example on how to set up networking in Xen 4.1 that is not distribution-specific ? So far, the most helpful for me was the diagram in http://libvirt.org/archnetwork.html together with the network-bridge script itself. And one more question: how can I tell which document in xenwiki applies to which version of Xen ? Thanks, Jan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Todd Deshane
2011-May-05 13:32 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
On Thu, May 5, 2011 at 4:49 AM, Jan Vejvalka <jan.vejvalka@lfmotol.cuni.cz> wrote:>>> root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth0 >>> root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth1 >>> >>> only creates the eth0 bridge. >>> >>> There is a check in the script that prevents it from creating more than >>> one bridge: >>> >>> (...) >>> op_start () { >>> (...) >>> if [ `brctl show | wc -l` != 1 ]; then >>> return >>> fi >>> >>> Why ? Is that a bug, a feature, or is it something that came in in the >>> process of building Xen ? Did I miss something somewhere ? >>> > >> Networking in Xen 4.1+ has changed: >> http://wiki.xensource.com/xenwiki/MigrationGuideToXen4.1%2B >> >> See also: >> http://wiki.xensource.com/xenwiki/HostConfiguration/Networking >> http://wiki.xensource.com/xenwiki/Xen4.1 > > I see. But I did not upgrade, I installed from fresh. Does it mean that > the /etc/xen/scripts/network-bridge script is obsolete ? >Yes it is deprecated. It will be much better and more robust to use the network scripts in your distribution. Offhand I can''t seem to find the slackware documentation on creating network bridges. The closest thing I can find is: http://www.slackbook.org/html/book.html#NETWORK-CONFIGURATION-TCPIP-CONF Maybe other Xen Slackware users will have some tips? I''ve asked on the ##slackware IRC channel on freenode and if someone answers I can post more info. A more manual option is to use a tool called brctl (using in a package called something like bridge-utils) brctl can be used to add a bridge device and connect it to your network card (eth0 for example). brctl is well-documented. Let us know if you find good slackware documentation for bridged networking so we can add it to our wiki. Thanks, Todd> Is there some info/example on how to set up networking in Xen 4.1 that > is not distribution-specific ? So far, the most helpful for me was the > diagram in http://libvirt.org/archnetwork.html together with the > network-bridge script itself. > > And one more question: how can I tell which document in xenwiki applies > to which version of Xen ? > > Thanks, > > Jan > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- Todd Deshane http://www.linkedin.com/in/deshantm http://www.xen.org/products/cloudxen.html http://runningxen.com/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Todd Deshane
2011-May-05 13:54 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
On Thu, May 5, 2011 at 9:32 AM, Todd Deshane <todd.deshane@xen.org> wrote:> On Thu, May 5, 2011 at 4:49 AM, Jan Vejvalka > <jan.vejvalka@lfmotol.cuni.cz> wrote: >>>> root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth0 >>>> root@cen:~# /etc/xen/scripts/network-bridge start netdev=eth1 >>>> >>>> only creates the eth0 bridge. >>>> >>>> There is a check in the script that prevents it from creating more than >>>> one bridge: >>>> >>>> (...) >>>> op_start () { >>>> (...) >>>> if [ `brctl show | wc -l` != 1 ]; then >>>> return >>>> fi >>>> >>>> Why ? Is that a bug, a feature, or is it something that came in in the >>>> process of building Xen ? Did I miss something somewhere ? >>>> >> >>> Networking in Xen 4.1+ has changed: >>> http://wiki.xensource.com/xenwiki/MigrationGuideToXen4.1%2B >>> >>> See also: >>> http://wiki.xensource.com/xenwiki/HostConfiguration/Networking >>> http://wiki.xensource.com/xenwiki/Xen4.1 >> >> I see. But I did not upgrade, I installed from fresh. Does it mean that >> the /etc/xen/scripts/network-bridge script is obsolete ? >> > > Yes it is deprecated. It will be much better and more robust to use > the network scripts in your distribution. > > Offhand I can''t seem to find the slackware documentation on creating > network bridges. > > The closest thing I can find is: > http://www.slackbook.org/html/book.html#NETWORK-CONFIGURATION-TCPIP-CONF > > Maybe other Xen Slackware users will have some tips? > > I''ve asked on the ##slackware IRC channel on freenode and if someone > answers I can post more info. >So some responses from the slackware IRC indicate that brctl is in fact a good option and you could put the commands in /etc/rc.local Another person added a diff to rc.inet1 that support bridges: http://connie.slackware.com/~alien/rc_scripts/bridging/ Hope that helps. If we could document a Slackware bridging guide somewhere guide on the wiki that would be helpful for the future. Thanks, Todd> A more manual option is to use a tool called brctl (using in a package > called something like bridge-utils) > > brctl can be used to add a bridge device and connect it to your > network card (eth0 for example). > > brctl is well-documented. > > Let us know if you find good slackware documentation for bridged > networking so we can add it to our wiki. > > Thanks, > Todd > >> Is there some info/example on how to set up networking in Xen 4.1 that >> is not distribution-specific ? So far, the most helpful for me was the >> diagram in http://libvirt.org/archnetwork.html together with the >> network-bridge script itself. >> >> And one more question: how can I tell which document in xenwiki applies >> to which version of Xen ? >> >> Thanks, >> >> Jan >> >> _______________________________________________ >> Xen-users mailing list >> Xen-users@lists.xensource.com >> http://lists.xensource.com/xen-users >> > > > > -- > Todd Deshane > http://www.linkedin.com/in/deshantm > http://www.xen.org/products/cloudxen.html > http://runningxen.com/ >-- Todd Deshane http://www.linkedin.com/in/deshantm http://www.xen.org/products/cloudxen.html http://runningxen.com/ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jan Vejvalka
2011-May-05 16:38 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
>> (...) Does it mean that >> the /etc/xen/scripts/network-bridge script is obsolete ? >> > > Yes it is deprecated. It will be much better and more robust to use > the network scripts in your distribution.I see, thanks.> Offhand I can''t seem to find the slackware documentation on creating > network bridges.I think that I can get around in Slackware with brctl; what I miss is a (distribution-independent ?) information on WHAT to do, not on HOW to do it. Quoting (almost) http://wiki.xensource.com/xenwiki/HostConfiguration/Networking, I need to know what is the appropriate network configuration that administrators are required to set up using the tools provided by their host distribution. For me, so far most useful was the brief info that describes what network-bridge does: # start: # Creates the bridge as tdev # Copies the IP and MAC addresses from pdev to bridge # Renames netdev to be pdev # Renames tdev to bridge # Enslaves pdev to bridge and the diagrams in http://libvirt.org/archnetwork.html#architecture that "illustrate some of the network configurations enabled by the libvirt networking APIs". http://wiki.xensource.com/xenwiki/XenNetworking , on the other hand, seems obsolete: I can''t see any vethX/vif0.X interfaces in my Dom0. Thank you for your help, Jan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Joseph Glanville
2011-May-05 17:19 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
Hi,>From your original post I can gather you wish to create 2 bridges, oneeach for the interfaces eth0 and eth1? This can be achieved by running the following: brctl addbr xenbr0 brctl addif xenbr0 eth0 brctl addbr xenbr1 brctl addif xenbr1 eth1 Slackware doesn''t have a nice way of doing this with it''s internal networking system but adding the above to rc.local accomplishes the job good enough. To make use of a multiple bridge setup effectively you need to specify the bridge in the vif statement of the xen config file (something like bridge=xenbr0) Note, only network-bridge and associated are depreciated. You still require the vif-bridge script to be enabled in /etc/xen/xend-config.xcp When domains are created Xen will create the vif adapters to the following naming convention: vif<domid>.<adapternumber> So for a domid of 5 and a system with 2 adapters the following vif devices will be created in dom0: vif5.0 vif5.1 During device hotplug the vif-script then brings this interface up and adds it to the bridge. Do you have any further questions or need any further clarification on any of the points above? I am considering writing an article on Xen Wiki about how network configuration is carried out in Xen as it seems to be an area alot of people have problems with. Joseph. On 6 May 2011 02:38, Jan Vejvalka <jan.vejvalka@lfmotol.cuni.cz> wrote:>>> (...) Does it mean that >>> the /etc/xen/scripts/network-bridge script is obsolete ? >>> >> >> Yes it is deprecated. It will be much better and more robust to use >> the network scripts in your distribution. > > I see, thanks. > >> Offhand I can''t seem to find the slackware documentation on creating >> network bridges. > > I think that I can get around in Slackware with brctl; what I miss is a > (distribution-independent ?) information on WHAT to do, not on HOW to > do it. > > Quoting (almost) > http://wiki.xensource.com/xenwiki/HostConfiguration/Networking, > I need to know what is the appropriate network configuration that > administrators are required to set up using the tools provided by their > host distribution. > > For me, so far most useful was the brief info that describes what > network-bridge does: > # start: > # Creates the bridge as tdev > # Copies the IP and MAC addresses from pdev to bridge > # Renames netdev to be pdev > # Renames tdev to bridge > # Enslaves pdev to bridge > > and the diagrams in http://libvirt.org/archnetwork.html#architecture > that "illustrate some of the network configurations enabled by the libvirt > networking APIs". > > http://wiki.xensource.com/xenwiki/XenNetworking , on the other hand, > seems obsolete: I can''t see any vethX/vif0.X interfaces in my Dom0. > > Thank you for your help, > > Jan > > > > > > > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- Kind regards, Joseph. Founder | Director Orion Virtualisation Solutions | www.orionvm.com.au | Phone: 1300 56 99 52 | Mobile: 0428 754 846 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Jan Vejvalka
2011-May-06 09:08 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
On 5.5.2011 19:19, Joseph Glanville wrote:> Hi, > >> From your original post I can gather you wish to create 2 bridges, one > each for the interfaces eth0 and eth1? > > This can be achieved by running the following: > brctl addbr xenbr0 > brctl addif xenbr0 eth0 > brctl addbr xenbr1 > brctl addif xenbr1 eth1 > > Slackware doesn''t have a nice way of doing this with it''s internal > networking system but adding the above to rc.local accomplishes the > job good enough.Thanks - that''s simple enough (and that''s what I like on Slack, that it does not create complicated ways to hide simple things).> To make use of a multiple bridge setup effectively you need to specify > the bridge in the vif statement of the xen config file (something like > bridge=xenbr0) > > Note, only network-bridge and associated are depreciated. > You still require the vif-bridge script to be enabled in > /etc/xen/xend-config.xcp > > When domains are created Xen will create the vif adapters to the > following naming convention: > vif<domid>.<adapternumber> > > So for a domid of 5 and a system with 2 adapters the following vif > devices will be created in dom0: > vif5.0 > vif5.1 > > During device hotplug the vif-script then brings this interface up and > adds it to the bridge. > > Do you have any further questions or need any further clarification on > any of the points above?- There are "7 pairs of connected virtual ethernet interfaces for Dom0" mentioned in http://wiki.xensource.com/xenwiki/XenNetworking . Is that still valid ? - Not sure how VLANs are handled by the bridges; two setups come to my mind: either connecting the specific VLAN (e.g. eth0.5) to xenbrX in Dom0 or connecting all eth0 and selecting the right VLAN(s) on the ethernet interface in DomU. Both ways can have their pros and cons, are both possible ? Otherwise it''s clear enough at the moment, thanks :-)> I am considering writing an article on Xen Wiki about how network > configuration is carried out in Xen as it seems to be an area alot of > people have problems with.That would definitely be most useful. Thanks, Jan _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Joseph Glanville
2011-May-06 16:21 UTC
Re: [Xen-users] Xen 4.1.0, multiple network interfaces, network-bridge failing to create multiple bridges
Hi, The Xen networking article is very out of date, one of the reasons I wish to write a new one to better reflect the state of virtual networking with Xen In terms of pairs of network adapters, yes this still holds true. Within the Xen dom0 a virtual "vif" (virtual interface) is created for each network device within each domU. As such the devices are paired in a fashion similar to this: dom0 vif1.0 -> dom1 eth0 dom0 vif4.3 -> dom4 eth3 Working with VLANs is somewhat less trivial. You do however have a number of options. First is creating each of the VLAN attached sub interfaces in dom0 and creating a bridge for each, followed by attaching VMs using the bridging scripts. ie. vconfig add eth0 5 brctl add xenbr0 brctl addif xenbr0 eth0.5 The second however I highly recommend which is utilising Open vSwitch, which can tag packets with VLANs along with a number of other very powerful things. Powered by the OpenFlow syntax it puts you in complete control of your virtual networking infrastructure. On 6 May 2011 19:08, Jan Vejvalka <jan.vejvalka@lfmotol.cuni.cz> wrote:> On 5.5.2011 19:19, Joseph Glanville wrote: >> >> Hi, >> >>> From your original post I can gather you wish to create 2 bridges, one >> >> each for the interfaces eth0 and eth1? >> >> This can be achieved by running the following: >> brctl addbr xenbr0 >> brctl addif xenbr0 eth0 >> brctl addbr xenbr1 >> brctl addif xenbr1 eth1 >> >> Slackware doesn''t have a nice way of doing this with it''s internal >> networking system but adding the above to rc.local accomplishes the >> job good enough. > > Thanks - that''s simple enough (and that''s what I like on Slack, that it > does not create complicated ways to hide simple things). > >> To make use of a multiple bridge setup effectively you need to specify >> the bridge in the vif statement of the xen config file (something like >> bridge=xenbr0) >> >> Note, only network-bridge and associated are depreciated. >> You still require the vif-bridge script to be enabled in >> /etc/xen/xend-config.xcp >> >> When domains are created Xen will create the vif adapters to the >> following naming convention: >> vif<domid>.<adapternumber> >> >> So for a domid of 5 and a system with 2 adapters the following vif >> devices will be created in dom0: >> vif5.0 >> vif5.1 >> >> During device hotplug the vif-script then brings this interface up and >> adds it to the bridge. >> >> Do you have any further questions or need any further clarification on >> any of the points above? > > - There are "7 pairs of connected virtual ethernet interfaces for Dom0" > mentioned in http://wiki.xensource.com/xenwiki/XenNetworking . Is > that still valid ? > > - Not sure how VLANs are handled by the bridges; two setups come to my > mind: either connecting the specific VLAN (e.g. eth0.5) to xenbrX in > Dom0 or connecting all eth0 and selecting the right VLAN(s) on the > ethernet interface in DomU. Both ways can have their pros and cons, > are both possible ? > > Otherwise it''s clear enough at the moment, thanks :-) > >> I am considering writing an article on Xen Wiki about how network >> configuration is carried out in Xen as it seems to be an area alot of >> people have problems with. > > That would definitely be most useful. > > Thanks, > > Jan > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users >-- Kind regards, Joseph. Founder | Director Orion Virtualisation Solutions | www.orionvm.com.au | Phone: 1300 56 99 52 | Mobile: 0428 754 846 _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users