BBVA/kvm

Some guest OS don't get IP address

Closed this issue · 2 comments

Some guest OS are not getting the IP address offered by dnsmasq in container service.
If IP address is configured manually, network connectivity works properly.

Guest OS tested:

Good news and bad news:

According to this bug report from Debian, and this other from Centos it seems that:

This is due to dhclient checking the checksum of udp packets it receives, but checksums are not computed if the packets don't leave through a physical interface.

Adding this to the Centos KVM container before launching the startvm script:

iptables -A POSTROUTING -t mangle -p udp --dport bootpc -j CHECKSUM 
--checksum-fill

makes that guest VM gets the IP address served by dhclient in the KVM container. (Hurray!)

Also, in a Vagrant bug report regarding the same issue, someone cites a Xen Networking Wiki with another solution:

ethtool -K <IFACE> tx off

But this doesn't seem to work with this KVM Centos container. I have run the command with all the ethX interfaces, with no success within a Debian guest. It doesn't work with macvlan/macvtap devices either.

The problem here is that with Alpine container there is no iptables, so the solution is not possible. Adding this package to Alpine is an option, but seems very ugly to me.

Any ideas? cc/ @panchoh @rodrigofuente ?

Meanwhile I will do more test with several guest OSes.

Fix tested with:

  • CentOS 6.8 (Nuage VSD)
    • kvm:latest (centos) ✅
    • kvm:alpine ❌
  • CentOS-7-x86_64-GenericCloud-1608.qcow2c
    • kvm:latest (centos) ✅
    • kvm:alpine ❌
  • Cirros-0.3.4-x86_64-disk.img
    • kvm:latest (centos): ✅ (qcow doesn't work, img does)
    • kvm:alpine: :x:
  • Debian Wheezy (qcow2)
    • kvm:latest (centos): ✅
    • kvm:alpine: :x: getting debian-amd64 dhclient: No DHCPOFFERS received.