No networking connectivity in KVM guests / VPS

Issues related to configuring your network
ringmany
Posts: 1
Joined: 2017/08/11 11:57:08

No networking connectivity in KVM guests / VPS

Postby ringmany » 2017/08/11 12:06:44

Hi everyone,

I'm setting up KVM host on my Centos 6 Dedicated server. I've managed to get the VPS / guests built and running, but they have no connectivity. The IP's have been raised on the guests, they're using my bridge on the KVM (br0) but the IP's aren't being pinged and they can't ping externally. The KVM and the guest are able to ping each other, but the guests can't connect outside the KVM. 100% packet loss. The KVM is able to make and receive external connections.

The command being used to create the guest is:

Code: Select all

virt-install --name=vps2 --disk path=/var/lib/libvirt/images/vps2.img,size=8 --ram=512 --os-type=linux --network bridge:br0 --nographics --extra-args='console=tty0 console=ttyS0,115200n8 serial' --location '/tmp/CentOS-6.9-x86_64-minimal.iso' --boot cdrom


Here's my networking settings for the KVM host:

/etc/sysconfig.network

Code: Select all

NETWORKING=yes
HOSTNAME=****
NOZEROCONF=yes
GATEWAY="91.***.***.254"


virsh net-list

Code: Select all

Name                 State      Autostart     Persistent
--------------------------------------------------
default              active     yes           yes


ifconfig

Code: Select all

br0       Link encap:Ethernet  HWaddr D0:***:***:7C
          inet addr:91.***.***.216  Bcast:91.***.***.255  Mask:255.255.254.0
          inet6 addr: fe80::d267:***:***:47c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2342975 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18077 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:112401012 (107.1 MiB)  TX bytes:3782581 (3.6 MiB)

eth0      Link encap:Ethernet  HWaddr D0:***:***:7C
          inet6 addr: fe80::d267:***:***:47c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:214922 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6170 errors:7 dropped:0 overruns:0 carrier:7
          collisions:28 txqueuelen:1000
          RX bytes:14366872 (13.7 MiB)  TX bytes:1286723 (1.2 MiB)

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:6 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:672 (672.0 b)  TX bytes:672 (672.0 b)

virbr0    Link encap:Ethernet  HWaddr 52:***:***:5E
          inet addr:192.***.***.1  Bcast:192.***.***.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  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:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

vnet0     Link encap:Ethernet  HWaddr FE:***:***:E7
          inet6 addr: fe80::fc54:***:***:96e7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:135 errors:0 dropped:0 overruns:0 frame:0
          TX packets:137374 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:6725 (6.5 KiB)  TX bytes:8448525 (8.0 MiB)

vnet1     Link encap:Ethernet  HWaddr FE:***:***:66
          inet6 addr: fe80::fc54:***:***:6666/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:786 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2103722 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:33539 (32.7 KiB)  TX bytes:129504050 (123.5 MiB)

vnet2     Link encap:Ethernet  HWaddr FE:***:***:66
          inet6 addr: fe80::fc54:***:***:6666/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:35627 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:0 (0.0 b)  TX bytes:1852760 (1.7 MiB)


eth0

Code: Select all

DEVICE="eth0"
HOSTNAME=****
HWADDR="D0:***:***:7C"
NM_CONTROLLED="no"
ONBOOT="yes"
TYPE="Ethernet"
UUID="19***:***d3"
BRIDGE=br0


br0

Code: Select all

DEVICE=br0
TYPE=Bridge
BOOTPROTO="static"
DNS1="8.8.8.8"
DNS2="8.8.4.4"
GATEWAY="91.***.***.254"
HWADDR="D0:***:***:7C"
IPADDR="91.***.***.216"
NETMASK="255.255.254.0"
ONBOOT="yes"
NM_CONTROLLED="no"


/etc/sysctl.conf

Code: Select all

net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0


route -n

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.***.***.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
91.***.***.0      0.0.0.0         255.255.254.0   U     0      0        0 br0
0.0.0.0         91.***.***.254    0.0.0.0         UG    0      0        0 br0


brctl show

Code: Select all

bridge name     bridge id               STP enabled     interfaces
br0             8000.d067e5e7047c       no              eth0
                                                        vnet0
                                                        vnet1
virbr0          8000.52540098305e       yes             virbr0-nic
                                                        vnet2


The VPS / guest

ifconfig

Code: Select all

eth0      Link encap:Ethernet  HWaddr 52:***.***:E7
          inet addr:91.***.***.217  Bcast:91.***.***.255  Mask:255.255.254.0
          inet6 addr: fe80::***.***:96e7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3372 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:160593 (156.8 KiB)  TX bytes:1440 (1.4 KiB)
          Interrupt:11 Base address:0x4000

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:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


ip addr show

Code: Select all

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 52:***.***:e7 brd ff:ff:ff:ff:ff:ff
    inet 91.***.***.217/23 brd 91.***.***.255 scope global eth0
    inet6 fe80::***.***:96e7/64 scope link
       valid_lft forever preferred_lft forever


I've tried adding the IP's via the default.xml in the host:

/etc/libvirt/qemu/networks/default.xml

Code: Select all

<network>
  <name>default</name>
  <uuid>e0***:***45</uuid>
  <forward mode='nat'/>
  <bridge name='virbr0' stp='on' delay='0' />
  <mac address='52:***:***:5E'/>
  <ip address='192.***.***.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.***.***.2' end='192.***.***.254' />
      <host mac='52:***:***:e7' name='vps1' ip='91.***.***.217' />
      <host mac='52:***:***:bc' name='vps2' ip='91.***.***.219' />
    </dhcp>
  </ip>
</network>


I've created various rules within IP tables to allow traffic between the 2 servers, but no luck. I've disabled SElinux and iptables, but still no connectivity.

The IP appears to be raised on my guest, it's using the bridge, it's using Googles nameservers, yet there's no connectivity and I'm unable to ping the guest IP's. My though that was the KVM wasn't allowing bridged traffic between the guests and the outside world, but even with IP tables disabled, there's still nothing.

The guests aren't able to ping the gateway:

Code: Select all

ping 91.***.***.254
PING 91.***.***.254 (91.***.***.254) 56(84) bytes of data.

--- 91.***.***.254 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3889ms


But I can arping the KVM itself from the guest:

Code: Select all

arping 91.***.***.216
ARPING 91.***.***.216 from 91.***.***.216 eth0
Unicast reply from 91.***.***.216 [D0:67:**:E7:04:7C]  1.172ms
Unicast reply from 91.***.***.216 [D0:67:**:E7:04:7C]  1.523ms
Sent 2 probes (1 broadcast(s))
Received 2 response(s)



Do you believe it may be related to a failure between the bridge and the guest? If you need any further info, let me know. Thanks.

User avatar
jlehtone
Posts: 1881
Joined: 2007/12/11 08:17:33
Location: Finland

Re: No networking connectivity in KVM guests / VPS

Postby jlehtone » 2017/08/12 11:34:55

Who has vnet2? Why is the virbr0 in use at all?