[ovs-discuss] proper dhcpcd configuration on host machine

Christopher Harvey cwh at eml.cc
Fri Sep 29 02:04:46 UTC 2017


I think I have a fairly simple/typical setup. I have a desktop PC
running OVS for a couple of VMs. Without OVS installed the PC would get
an IP address via dhcp. When running OVS I setup my PC to not run dhcpcd
on the physical NIC (enp0s31f6) which worked well. My dhcpcd process
only acquires leases for "kvm-bridge", which is also good. The problem
is that my home router has a DHCP lease time of 2 hours. Every 2 hours
my dhcpcd process will re-negotiate and get a different ip address. It
seems to always acquire the next one in the ip pool range. For example,
if I have 192.168.1.105, after 2 hours that lease expires and dhdpcd
will acquire 192.168.1.106. This is very annoying. None of my other
devices have this problem. They all renegotiate the same address. 

Tool ~ # ls /var/lib/dhcpcd/
dhcpcd-kvm-bridge.lease
Tool ~ # ps -ef | grep dhcpcd
root      2547     1  0 Sep27 ?        00:00:00 /sbin/dhcpcd -q
Tool ~ # ovs-vsctl show
6c40b323-8d75-4d5b-84e5-b2e9c9f3512f
    Bridge kvm-bridge
        Port "enp0s31f6"
            Interface "enp0s31f6"
        Port kvm-bridge
            Interface kvm-bridge
                type: internal
        Port "vnet0"
            Interface "vnet0"
                error: "could not open network device vnet0 (No such
                device)"

Here is a typical syslog snippet from the problematic computer:

Aug 24 23:32:21 Tool dhcpcd[27422]: ovs-system: sending DISCOVER (xid
0xfc236506), next in 64.3 seconds
Aug 24 23:32:21 Tool ovs-vswitchd:
ovs|00335|ofproto_dpif_upcall(handler38)|INFO|received packet on unass
ociated datapath port 0
Aug 24 23:32:36 Tool dhcpcd[27422]: kvm-bridge: sending REQUEST (xid
0x2233f94), next in 64.6 seconds
Aug 24 23:32:43 Tool dhcpcd[27422]: enp0s31f6: sending DISCOVER (xid
0x4e00054a), next in 63.6 seconds
Aug 24 23:32:44 Tool dhcpcd[27422]: kvm-bridge: wrong xid 0x4e00054a
(expecting 0x2233f94) from 192.168.1
.1
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: DHCP lease expired
Aug 24 23:32:45 Tool dhcpcd[27422]: enp0s31f6: adding default route
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: deleting route to
192.168.1.0/24
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: deleting default route
via 192.168.1.1
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: deleting IP address
192.168.1.129/24
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: executing
`/lib/dhcpcd/dhcpcd-run-hooks' EXPIRE
Aug 24 23:32:45 Tool dnsmasq[2975]: started, version 2.77 cachesize 150
Aug 24 23:32:45 Tool dnsmasq[2975]: overflow: 22 log entries lost
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: soliciting a DHCP lease
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: sending DISCOVER (xid
0xcce16ab7), next in 3.2 seconds
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: offered 192.168.1.130
from 192.168.1.1
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: sending REQUEST (xid
0xcce16ab7), next in 5.0 seconds
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: acknowledged
192.168.1.130 from 192.168.1.1
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: probing address
192.168.1.130/24
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: probing for
192.168.1.130
Aug 24 23:32:45 Tool dhcpcd[27422]: kvm-bridge: ARP probing
192.168.1.130 (1 of 3), next in 1.5 seconds
Aug 24 23:32:46 Tool dhcpcd[27422]: kvm-bridge: ARP probing
192.168.1.130 (2 of 3), next in 1.9 seconds
Aug 24 23:32:48 Tool dhcpcd[27422]: kvm-bridge: ARP probing
192.168.1.130 (3 of 3), next in 2.0 seconds
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: DAD completed for
192.168.1.130
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: leased 192.168.1.130 for
7200 seconds
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: renew in 3600 seconds,
rebind in 6300 seconds
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: writing lease
`/var/lib/dhcpcd/dhcpcd-kvm-bridge.lease'
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: adding IP address
192.168.1.130/24 broadcast 192.168.1.25
5
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: adding route to
192.168.1.0/24
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: adding default route via
192.168.1.1
Aug 24 23:32:50 Tool dhcpcd[27422]: enp0s31f6: deleting default route
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: ARP announcing
192.168.1.130 (1 of 2), next in 2.0 second
s
Aug 24 23:32:50 Tool dhcpcd[27422]: kvm-bridge: executing
`/lib/dhcpcd/dhcpcd-run-hooks' BOUND
Aug 24 23:32:50 Tool dnsmasq[2975]: reading /etc/resolv.conf
Aug 24 23:32:50 Tool dnsmasq[2975]: using nameserver 192.168.1.1#53
Aug 24 23:32:52 Tool ovs-vswitchd:
ovs|00018|ofproto_dpif_upcall(handler36)|INFO|Dropped 8 log messages i
n last 5 seconds (most recently, 1 seconds ago) due to excessive rate
Aug 24 23:32:52 Tool ovs-vswitchd:
ovs|00019|ofproto_dpif_upcall(handler36)|INFO|received packet on
unassociated datapath port 0
Aug 24 23:32:52 Tool dhcpcd[27422]: kvm-bridge: ARP announcing
192.168.1.130 (2 of 2)
Aug 24 23:33:25 Tool dhcpcd[27422]: ovs-system: sending DISCOVER (xid
0xfc236506), next in 63.3 seconds
Aug 24 23:33:46 Tool dhcpcd[27422]: enp0s31f6: sending DISCOVER (xid
0x4e00054a), next in 63.2 seconds
Aug 24 23:34:29 Tool dhcpcd[27422]: ovs-system: sending DISCOVER (xid
0xfc236506), next in 64.2 seconds
Aug 24 23:34:29 Tool ovs-vswitchd:
ovs|00336|ofproto_dpif_upcall(handler38)|INFO|Dropped 11 log messages in
last 96 seconds (most recently, 64 seconds ago) due to excessive rate

Notice that the route to the gateway gets deleted. This causes
connectivity hiccups, so I'm very keen on solving this.

Thanks,
Chris


More information about the discuss mailing list