View previous topic :: View next topic |
Author |
Message |
chris_harvey n00b
Joined: 12 Mar 2010 Posts: 42 Location: Ottawa, Canada
|
Posted: Fri Sep 29, 2017 2:13 am Post subject: dhcpcd config for openvswitch |
|
|
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.
Code: |
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:
Code: |
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.255
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 seconds
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 in 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)
|
Notice that the route to the gateway gets deleted. This causes
connectivity hiccups, so I'm very keen on solving this.
Thanks,
Chris |
|
Back to top |
|
|
LIsLinuxIsSogood Veteran
Joined: 13 Feb 2016 Posts: 1179
|
Posted: Fri Sep 29, 2017 9:22 am Post subject: |
|
|
Hey, I'm not totally familiar with this subject, but have you tried going the way of the router and reserving addresses, usually it is an option to do so by MAC addresses. So unless the KVM is actually changing its own MAC address each time that could be a easy non-programming way to attempt a working solution. If this suggestion is not what you have in mind then forgive me, I am just trying to help. |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
Posted: Sat Sep 30, 2017 4:38 pm Post subject: |
|
|
Here's the key part
Code: | 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 |
So dhcpcd is trying to renew the lease, but the server is sending back a reply using a different xid from what dhcpcd originally send (it has to match and the server has to match the client).
As such, dhcpcd expires the lease correctly has it's not been renewed.
dhcpcd will then try and negotiate a new lease - the server at this point replies with a new IP address.
This looks like an issue with your DHCP server. _________________ Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|