[libvirt-users] vms doesn't coomunicate via network

Laine Stump laine at redhat.com
Wed Dec 19 02:49:55 UTC 2018


On 12/15/18 9:54 AM, daggs wrote:
> Greetings,
> 
> I have two vms, one is a router and the other one is a client, for some reason, the client vm is unable get ip via dhcp from the router vm.
> here are outputs:
> vm1.xml:
>      <interface type='bridge'>
>        <mac address='52:54:00:54:78:be'/>
>        <source bridge='virbr0'/>
>        <model type='virtio'/>
>        <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
>      </interface>
> 
> router.xml:
>      <interface type='bridge'>
>        <mac address='52:54:00:f9:bd:fb'/>
>        <source bridge='virbr0'/>
>        <target dev='vnet1'/>
>        <model type='virtio'/>
>        <alias name='net1'/>
>        <address type='pci' domain='0x0000' bus='0x0a' slot='0x00' function='0x0'/>
>      </interface>
> 
> ifconfig > $ busybox ifconfig -a
> dummy0    Link encap:Ethernet  HWaddr CE:2E:DD:15:8A:0C
>            BROADCAST NOARP  MTU:1500  Metric:1
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
> 
> lo        Link encap:Local Loopback
>            inet addr:127.0.0.1  Mask:255.0.0.0
>            inet6 addr: ::1/128 Scope:Host
>            UP LOOPBACK RUNNING  MTU:65536  Metric:1
>            RX packets:21428 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:21428 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:1039176 (1014.8 KiB)  TX bytes:1039176 (1014.8 KiB)
> 
> virbr0    Link encap:Ethernet  HWaddr 52:54:00:7E:27:AF
>            inet6 addr: fe80::5054:ff:fe7e:27af/64 Scope:Link
>            inet6 addr: fdab:9802:eb52:0:5054:ff:fe7e:27af/64 Scope:Global
>            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>            RX packets:530861 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:85 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:591914339 (564.4 MiB)  TX bytes:4042 (3.9 KiB)
> 
> virbr0-dummy Link encap:Ethernet  HWaddr 52:54:00:7E:27:AF
>            UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
>            RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:141357 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:0 (0.0 B)  TX bytes:32288355 (30.7 MiB)
> 
> vnet0     Link encap:Ethernet  HWaddr FE:54:00:8B:66:C1
>            inet addr:10.0.0.3  Bcast:10.0.0.255  Mask:255.255.255.0
>            inet6 addr: fdab:9802:eb52:0:fc54:ff:fe8b:66c1/64 Scope:Global

How did vnet0 get IP addresses? They aren't in the domain xml, and the 
guest has no visibility to change the IP of the tap interface on the 
host side. That means that you have "something else" messing around with 
the networking config. I can't say what it is, but this is definitely a 
red flag that needs investigating - the host side of tap devices should 
not have an IP address except in special cases when you're routing 
directly from host to guest using the tap and *not* using a bridge.


>            inet6 addr: fe80::fc54:ff:fe8b:66c1/64 Scope:Link
>            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>            RX packets:261801 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:438289 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:42370344 (40.4 MiB)  TX bytes:895415306 (853.9 MiB)
> 
> vnet1     Link encap:Ethernet  HWaddr FE:54:00:F9:BD:FB
>            inet6 addr: fe80::fc54:ff:fef9:bdfb/64 Scope:Link
>            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>            RX packets:531064 errors:0 dropped:0 overruns:0 frame:0
>            TX packets:262 errors:0 dropped:0 overruns:0 carrier:0
>            collisions:0 txqueuelen:1000
>            RX bytes:599366518 (571.5 MiB)  TX bytes:27088 (26.4 KiB)
> 
> /etc/network/interface:
> $ cat /etc/network/interfaces
> # This file describes the network interfaces available on your system
> # and how to activate them. For more information, see interfaces(5).
> 
> source /etc/network/interfaces.d/*
> 
> # The loopback network interface
> auto lo
> iface lo inet loopback
> 
> # The primary network interface
> #allow-hotplug enx503eaa4f9dcd
> #iface enx503eaa4f9dcd inet dhcp
> #allow-hotplug enp0s31f6
> #iface enp0s31f6 inet dhcp
> 
> allow-hotplug vnet0
> iface vnet0 inet dhcp

Ah. Why are you doing this^^^ ?? It makes no sense at all. The tap 
devices should not be listed at all in the host's network config; they 
are created and configured by libvirt directly.

> 
> auto virbr0-dummy
> iface virbr0-dummy inet manual
>      pre-up /sbin/ip link add virbr0-dummy type dummy
>      up /sbin/ip link set virbr0-dummy address 52:54:00:7e:27:af
> 
> auto virbr0
> iface virbr0 inet manual
>     hwaddress ether 19:7c:3b:92:ec:ee
>     bridge_ports virbr0-dummy

Likewise for both of these. The bridge created by libvirt for its 
default network is usually named virbr0. You don't have both a libvirt 
default network that uses virbr0 *and* this manual configuration of 
virbr0 in your interfaces file too, do you? That would be a recipe for 
disaster.

> 
> any ideas what cen be the issue?

1) You haven't shown anything to indicate your guest named "router" 
actually has a dhcp server running.

2) Based on the oddities I've mentioned above, it sounds like you may 
have conflicting/nonsensical config that isn't shown in this email.

> Thanks,
> 
> Dagg.
> 
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users
> 




More information about the libvirt-users mailing list