<div dir="ltr"><div>Replying to myself...<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 27, 2023 at 12:20 PM Matt Zagrabelny <<a href="mailto:mzagrabe@d.umn.edu">mzagrabe@d.umn.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Greetings Kea Users,</div><div><br></div><div>I am attempting to get Pg based storage working for my first Kea installation.</div><div><br></div><div>I'm using kea-dhcp4-server 2.2.1-1</div><div><br></div><div>I do have leases in the DB:</div><div><br></div><div>z@[local]:kea=# select * from lease4;<br>═[ RECORD 1 ]══╤═════════════════════════════════════════<br>address        │ 178782308<br>hwaddr         │ \x9cebe803e3b9<br>client_id      │ \x019cebe803e3b9<br>valid_lifetime │ 3600<br>expire         │ 2023-09-27 12:45:32-05<br>subnet_id      │ 1<br>fqdn_fwd       │ f<br>fqdn_rev       │ f<br>hostname       │ ziti<br>state          │ 0<br>user_context   │ <br></div><div><br></div><div>and I've added a host entry:</div><div><br></div><div>INSERT INTO hosts (<br>    dhcp_identifier,<br>    dhcp_identifier_type,<br>    ipv4_address<br>)<br>VALUES (<br>    '\x9cebe803e3b9',<br>    0,<br>    178782258<br>);</div><div><br></div><div>which yields:</div><div><br></div><div>z@[local]:kea=# select * from hosts;<br>═[ RECORD 1 ]═════════╤═══════════════<br>host_id               │ 3<br>dhcp_identifier       │ \x9cebe803e3b9<br>dhcp_identifier_type  │ 0<br>dhcp4_subnet_id       │ ¤<br>dhcp6_subnet_id       │ ¤<br>ipv4_address          │ 178782258<br>hostname              │ ¤<br>dhcp4_client_classes  │ ¤<br>dhcp6_client_classes  │ ¤<br>dhcp4_next_server     │ ¤<br>dhcp4_server_hostname │ ¤<br>dhcp4_boot_file_name  │ ¤<br>user_context          │ ¤<br>auth_key              │ ¤</div><div><br></div><div>and my kea config looks like:</div><div><br></div><div>$ cat /etc/kea/kea-dhcp4.conf</div><div>"Dhcp4": {<br>    "interfaces-config": {<br>        "interfaces": [ "eno1" ]<br>    },<br><br>    "control-socket": {<br>        "socket-type": "unix",<br>        "socket-name": "/run/kea/kea4-ctrl-socket"<br>    },<br><br>    "lease-database": {<br>        "type":     "postgresql",<br>        "name":     "kea",<br>        "user":     "kea",<br>        "password": "REDACTED",<br>        "host":     "localhost",<br>        "port":     5432<br>    },<br><br>    "hosts-database": {<br>        "type":     "postgresql",<br>        "name":     "kea",<br>        "user":     "kea",<br>        "password": "REDACTED",<br>        "host":     "localhost",<br>        "port":     5432<br>    },</div><div><br></div><div>    [...]</div><div><br></div><div>       "subnet4": [<br>        {<br>            "subnet": "<a href="http://10.168.0.0/24" target="_blank">10.168.0.0/24</a>",<br><br>            "pools": [ { "pool": "10.168.0.100 - 10.168.0.200" } ],<br>        }<br>    ],</div><div>    [...]<br></div></div></blockquote><div><br></div><div>I've added an "id" to the subnet declaration:</div><div><br></div><div>"id": 1000,</div><div><br></div><div>and updated the entry in the hosts table:</div><div><br></div><div>z@[local]:kea=# select * from hosts;<br>═[ RECORD 1 ]═════════╤═══════════════<br>host_id               │ 3<br>dhcp_identifier       │ \x9cebe803e3b9<br>dhcp_identifier_type  │ 0<br>dhcp4_subnet_id       │ 1000<br>dhcp6_subnet_id       │ ¤<br>ipv4_address          │ 178782258<br>hostname              │ ¤<br>dhcp4_client_classes  │ ¤<br>dhcp6_client_classes  │ ¤<br>dhcp4_next_server     │ ¤<br>dhcp4_server_hostname │ ¤<br>dhcp4_boot_file_name  │ ¤<br>user_context          │ ¤<br>auth_key              │ ¤<br></div><div><br></div><div>and now I get the address that I'm expecting:</div><div><br></div><div>Oct 04 16:13:42 zed kea-dhcp4[5212]: INFO  DHCP4_LEASE_ALLOC [hwtype=1 9c:eb:e8:03:e3:b9], cid=[01:9c:eb:e8:03:e3:b9], tid=0x5c6246b4: lease 10.168.0.50 has been allocated for 3600 seconds</div><div><br></div><div>I'm still having issues getting the subnet moved from the config file to the database, but I've asked about that in a separate email to kea-users (and kea-devel).</div><div><br></div><div>Thanks for any help!</div><div><br></div><div>-m</div></div></div>