<Srinivas_G_Gowda@dell.com>
2014-May-20 13:35 UTC
Re: [libvirt-users] Need help with [virt net-create]
Thanks Daniel. Why was I trying to do something like this ? Two reasons 1. I was referring to ( Figure 18.4. Virtual network switch running dnsmasq) https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Virtualization_Administration_Guide/index.html#sect-network-protocols that appears to be two virtual nics sharing the same IP range .. !!! 2. was playing around "Network teaming" in a VM. But this doesnt seem to work. Please dont beat me around the use cases for this :) Do we have support for "Network teaming inside a VM" ? This seems to be well documented for VMware and Hyper-V, could not find related document on this for libvirt. Thanks. G ________________________________________ From: Daniel P. Berrange [berrange@redhat.com] Sent: Tuesday, May 20, 2014 6:31 PM To: Gowda, Srinivas G Cc: libvirt-users@redhat.com Subject: Re: [libvirt-users] Need help with [virt net-create] On Tue, May 20, 2014 at 01:59:42AM -0700, Srinivas_G_Gowda@dell.com wrote:> Is it possible to configure 2 virtual nics in the same ip range ?Nope, that's unsupported. We need to key various things off the IP address + mask used for the NIC, so you can't have multiple nets with the same address + mask.> Here is what I am trying. > > > **** This works **************** > cat nw1.xml > <network> > <name>nw1</name> > <domain name='nw1' /> > <forward mode='nat' dev='eth2'/> > <ip address='192.168.101.1' netmask='255.255.255.0'> > <dhcp> > <range start='192.168.101.128' end='192.168.101.254'/> > </dhcp> > </ip> > </network> > > > [root@localhost nw]# virsh net-create nw1.xml > Network nw1 created from nw1.xml > > [root@localhost nw]# virsh net-list --all > Name State Autostart Persistent > ---------------------------------------------------------- > nw1 active no no > default active yes yes > > > > ****** FAILS when given the same ip address range of an existing virtual interface ******* > [root@localhost nw]# cat nw2.xml > <network> > <name>nw2</name> > <domain name='nw2' /> > <forward mode='nat' dev='eth2'/> > <ip address='192.168.101.1' netmask='255.255.255.0'> > <dhcp> > <range start='192.168.101.128' end='192.168.101.254'/> > </dhcp> > </ip> > </network> > > [root@localhost nw]# virsh net-create nw2.xml > error: Failed to create network from nw2.xml > error: internal error: Network is already in use by interface virbr1 > > > > ****** PASS - on giving diff ip range ******* > [root@localhost nw]# cat nw3.xml > <network> > <name>nw3</name> > <domain name='nw3' /> > <forward mode='nat' dev='eth2'/> > <ip address='192.168.102.1' netmask='255.255.255.0'> > <dhcp> > <range start='192.168.102.128' end='192.168.102.254'/> > </dhcp> > </ip> > </network> > > > [root@localhost nw]# virsh net-create nw3.xml > Network nw3 created from nw3.xml > > [root@localhost nw]# virsh net-list --all > Name State Autostart Persistent > ---------------------------------------------------------- > nw1 active no no > nw3 active no no > default active yes yes > > Any suggestions on what could be wrong here ?Can you instead explain why you're trying to setup multiple networks with the same IP addr/mask in the first place. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
Daniel P. Berrange
2014-May-20 13:49 UTC
Re: [libvirt-users] Need help with [virt net-create]
On Tue, May 20, 2014 at 06:35:54AM -0700, Srinivas_G_Gowda@dell.com wrote:> Thanks Daniel. > > Why was I trying to do something like this ? > Two reasons > > 1. I was referring to ( Figure 18.4. Virtual network switch running dnsmasq) > https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Virtualization_Administration_Guide/index.html#sect-network-protocols > > that appears to be two virtual nics sharing the same IP range .. !!!Hmm, assuming we're both looking at the same diagram, I think your interpretation is wrong. Figure 18.4 (under section 18.3.1) is showing one virtual network (192.168.122.0/24) with two guests attached to it. I don't see any examples there which describe setup for 2 virtual networks.> 2. was playing around "Network teaming" in a VM. But this > doesnt seem to work. Please dont beat me around the use > cases for this :)Ok, so the virtual network NAT feature in libvirt doesn't include network teaming directly. The NAT based setup you've got in the XML causes libvirt to create a linux software bridge and connect guest TAP devices to that. Note that no physical network is enslaved in that bridge - only guest NICs. Traffic from the bridge to the LAN is forwarded at the IP level. So if your host has been configured with bonding, eg you have eth0 and eth1 configured into bond0 and have setup your hosts public IP on bond0, then the NAT routing should automatically go to bond0. So don't think creating multiple virtual networks really does anything useful for network teaming. ie If you've setup your host OS with bonding, then a single libvirt virtual network should suffice. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
<Srinivas_G_Gowda@dell.com>
2014-May-20 14:20 UTC
Re: [libvirt-users] Need help with [virt net-create]
> Hmm, assuming we're both looking at the same diagram, I think > your interpretation is wrong. Figure 18.4 (under section 18.3.1) > is showing one virtual network (192.168.122.0/24) with two guests > attached to it. I don't see any examples there which describe > setup for 2 virtual networks.Yes, I see my mistake now. Thanks for clarifying.> Ok, so the virtual network NAT feature in libvirt doesn't > include network teaming directly. The NAT based setup you've > got in the XML causes libvirt to create a linux software > bridge and connect guest TAP devices to that. Note that no > physical network is enslaved in that bridge - only guestI guess, PCI pass-through is the only mode in which I can truly see the link status of a nic inside a VM ? Thanks, G ________________________________________ From: Daniel P. Berrange [berrange@redhat.com] Sent: Tuesday, May 20, 2014 7:19 PM To: Gowda, Srinivas G Cc: libvirt-users@redhat.coms Subject: Re: [libvirt-users] Need help with [virt net-create] On Tue, May 20, 2014 at 06:35:54AM -0700, Srinivas_G_Gowda@dell.com wrote:> Thanks Daniel. > > Why was I trying to do something like this ? > Two reasons > > 1. I was referring to ( Figure 18.4. Virtual network switch running dnsmasq) > https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Virtualization_Administration_Guide/index.html#sect-network-protocols > > that appears to be two virtual nics sharing the same IP range .. !!!Hmm, assuming we're both looking at the same diagram, I think your interpretation is wrong. Figure 18.4 (under section 18.3.1) is showing one virtual network (192.168.122.0/24) with two guests attached to it. I don't see any examples there which describe setup for 2 virtual networks.> 2. was playing around "Network teaming" in a VM. But this > doesnt seem to work. Please dont beat me around the use > cases for this :)Ok, so the virtual network NAT feature in libvirt doesn't include network teaming directly. The NAT based setup you've got in the XML causes libvirt to create a linux software bridge and connect guest TAP devices to that. Note that no physical network is enslaved in that bridge - only guest NICs. Traffic from the bridge to the LAN is forwarded at the IP level. So if your host has been configured with bonding, eg you have eth0 and eth1 configured into bond0 and have setup your hosts public IP on bond0, then the NAT routing should automatically go to bond0. So don't think creating multiple virtual networks really does anything useful for network teaming. ie If you've setup your host OS with bonding, then a single libvirt virtual network should suffice. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|