Skip to content

disabling and then enabling dhcp on ovn network requires instance restart #1737

@gwenya

Description

@gwenya

Setting ipv4.dhcp to false in the settings of an OVN network disables DHCP, but setting it to true again does not properly enable it. Only after an instance is restarted does it get responses to DHCP queries again.

$ ovs-tcpdump -i veth80cd5c04
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
listening on miveth80cd5c04, link-type EN10MB (Ethernet), snapshot length 262144 bytes

# run udhcpc in the instance

13:34:06.388393 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:59:4c:dc (oui Unknown), length 300
13:34:06.389189 IP 0.0.0.0.bootpc > 10.1.2.2.bootps: BOOTP/DHCP, Reply, length 302
13:34:06.389195 IP 10.1.2.1.bootps > 10.1.2.2.bootpc: BOOTP/DHCP, Reply, length 302
13:34:06.408389 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:59:4c:dc (oui Unknown), length 300
13:34:06.408950 IP 0.0.0.0.bootpc > 10.1.2.2.bootps: BOOTP/DHCP, Reply, length 302
13:34:06.408956 IP 10.1.2.1.bootps > 10.1.2.2.bootpc: BOOTP/DHCP, Reply, length 302

# set ipv4.dhcp to false

# run udhcpc in the instance again

13:34:26.517917 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:59:4c:dc (oui Unknown), length 300
13:34:31.996399 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:59:4c:dc (oui Unknown), length 300
13:34:35.021480 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:59:4c:dc (oui Unknown), length 300

# set ipv4.dhcp to true

# run udhcpc in the instance again

13:34:56.044955 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:59:4c:dc (oui Unknown), length 300
13:34:59.071700 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from 00:16:3e:59:4c:dc (oui Unknown), length 300

After rebooting the instance it has a fresh interface and gets dhcp responses again.

I think the issue is that setting dhcp to true creates a row in the OVN DHCP_Options table but doesn't apply those options to any ports, instead they only get applied when the port is created.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions