I’m wondering if I correctly understand the ipv4.dhcp.ranges
logic.
Documentation says: Comma-separated list of IP ranges to use for DHCP (FIRST-LAST format)
. So OVN router should issue address from on of the range in the list. However, my test environment with incus 6.13
and microovn 24.03.2+snapa2c59c105b (667)
issues IP addresses sequential from the beginning of network even if ipv4.dhcp.ranges
set to specific ip range(s).
After looking to OVN config I have an evidence that the incus
configures OVN Logical switches
incorrectly.
Here is an example of configurations:
> incus network show ovnTest-03
config:
bridge.mtu: "1442"
ipv4.address: 10.0.3.254/24
ipv4.dhcp.expiry: 10m
ipv4.dhcp.ranges: 10.0.3.16-10.0.3.31,10.0.3.129-10.0.3.248
ipv4.nat: "true"
ipv6.address: none
network: eth0.90
volatile.network.ipv4.address: 192.168.90.4
description: ""
name: ovnTest-03
type: ovn
used_by:
- /1.0/instances/test-01
- /1.0/instances/test-02
- /1.0/instances/test-03
- /1.0/instances/test-04
managed: true
status: Created
locations:
- vm-01
- vm-02
- vm-03
project: default
> incus ls test-0* -f compact
NAME STATE IPV4 IPV6 TYPE SNAPSHOTS LOCATION
test-01 RUNNING 10.0.3.4 (eth0) CONTAINER 0 vm-01
test-02 RUNNING 10.0.3.2 (eth0) CONTAINER 0 vm-02
test-03 RUNNING 10.0.3.3 (eth0) CONTAINER 0 vm-03
test-04 RUNNING 10.0.3.5 (eth0) CONTAINER 0 vm-01
> ovn-nbctl show incus-net115-ls-int
switch ca4f110d-f279-4712-924d-cdff8922f2fc (incus-net115-ls-int)
port incus-net115-ls-int-lsp-router
type: router
router-port: incus-net115-lr-lrp-int
port incus-net115-instance-09a426e2-5ffe-4739-82bc-9fb0a468d3e4-ovnTest-04
addresses: ["10:66:6a:4a:ec:e8 dynamic"]
port incus-net115-instance-cbec7136-848c-4530-a0bc-c4fd15b9992f-ovnTest-04
addresses: ["10:66:6a:e9:7d:33 dynamic"]
port incus-net115-instance-2e5b1d8e-cac9-45db-a14e-fe8eb422a26c-ovnTest-04
addresses: ["10:66:6a:f2:c1:25 dynamic"]
> ovn-nbctl list logical_switch incus-net113-ls-int
other_config : {exclude_ips="10.0.3.254..10.0.3.15 10.0.3.32..10.0.3.128 10.0.3.249..10.0.3.254", subnet="10.0.3.0/24"}
The exclude_ips
list looks wrong, isn’t it?
After fixing the exclude_ips
list by the command ovn-nbctl set logical_switch incus-net113-ls-int other_config:exclude_ips="10.0.3.1..10.0.3.15 10.0.3.32..10.0.3.128 10.0.3.249..10.0.3.254"
and relaunching containers, the OVN DHCP
issued IP addresses from correct range.
I did not have chance to check for regression yet.