[Kea-users] Configure a subnet in Kea configuration backend

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Kea-users] Configure a subnet in Kea configuration backend

Duy Vo Khac
Hi Kea developers,

I'm an user of your production.
I setup and install Kea 1.6 + MariabDB cluster.
I inserted a subnet and a pool to database for testing configuration backend.
When I started server and used "config-get" to get configuration, it didn't load the subnet and the pool I inserted before. 
I tried to lease an IP but it responsed "failed to select subnet for the client" in kea log.
What could be the problem there and How to fixed them ?
Part of server's configuration, kea dhcp4 log and lease log is attached

Thank you,
Duy Vo

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users

configuration.txt (2K) Download Attachment
kea-log.txt (16K) Download Attachment
lease-log.txt (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Configure a subnet in Kea configuration backend

Brian Candler
On 05/12/2019 08:11, Duy Vo Khac wrote:
> 2019-12-05 14:46:03.680 DEBUG [kea-dhcp4.mysql-cb-hooks/3946] MYSQL_CB_GET_MODIFIED_SUBNETS4 retrieving modified subnets from: 1970-01-01 00:00:00.000000
> 2019-12-05 14:46:03.683 DEBUG [kea-dhcp4.mysql-cb-hooks/3946] MYSQL_CB_GET_MODIFIED_SUBNETS4_RESULT retrieving: 0 elements
> 2019-12-05 14:46:03.683 INFO  [kea-dhcp4.dhcpsrv/3946] DHCPSRV_CFGMGR_CONFIG4_MERGED Configuration backend data has been merged.
> 2019-12-05 14:46:03.683 INFO  [kea-dhcp4.dhcp4/3946] DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: no IPv4 subnets!; DDNS: disabled

Looks like it found zero subnets in your database.  Perhaps you could
share the contents of the relevant tables?

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Configure a subnet in Kea configuration backend

Brian Candler
On 05/12/2019 09:54, Duy Vo Khac wrote:
I would like to send you the pictures of tables in my database as file attachment

It would be much clearer if you could show the text output of "select * from <table_name>;" for each table.

I don't see an obvious problem, but I don't use mysql_cb.  Maybe you could turn on query logging on the mysql server to see what actual queries it's sending?


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] Configure a subnet in Kea configuration backend

Brian Candler
You can run the queries by hand to see if they return zero results or
not.  The most interesting one might be this:
> SELECT  s.subnet_id,  s.subnet_prefix,  s.4o6_interface,  s.4o6_interface_id,  s.4o6_subnet,  s.boot_file_name,  s.client_class,  s.interface,  s.match_client_id,  s.modification_ts,  s.next_server,  s.rebind_timer,  s.relay,  s.renew_timer,  s.require_client_classes,  s.reservation_mode,  s.server_hostname,  s.shared_network_name,  s.user_context,  s.valid_lifetime,  p.id,  p.start_address,  p.end_address,  p.subnet_id,  p.modification_ts,  x.option_id,  x.code,  x.value,  x.formatted_value,  x.space,  x.persistent,  x.dhcp4_subnet_id,  x.scope_id,  x.user_context,  x.shared_network_name,  x.pool_id,  x.modification_ts,  o.option_id,  o.code,  o.value,  o.formatted_value,  o.space,  o.persistent,  o.dhcp4_subnet_id,  o.scope_id,  o.user_context,  o.shared_network_name,  o.pool_id,  o.modification_ts,  s.calculate_tee_times,  s.t1_percent,  s.t2_percent,  s.authoritative,  s.min_valid_lifetime,  s.max_valid_lifetime,  p.client_class,  p.require_client_classes,  p.user_context,  srv.tag FROM dhcp4_subnet AS s INNER JOIN dhcp4_subnet_server AS a   ON s.subnet_id = a.subnet_id INNER JOIN dhcp4_server AS srv   ON (a.server_id = srv.id) LEFT JOIN dhcp4_pool AS p ON s.subnet_id = p.subnet_id LEFT JOIN dhcp4_options AS x ON x.scope_id = 5 AND p.id = x.pool_id LEFT JOIN dhcp4_options AS o ON o.scope_id = 1 AND s.subnet_id = o.dhcp4_subnet_id WHERE s.modification_ts > ? ORDER BY s.subnet_id, p.id, x.option_id, o.option_id

Replace "?" with date 1970-01-01.  If you get zero rows, then you can
dig down to see why it's not finding the subnets.

However, that's a "Prepare" and I don't see it being executed. These are
the only ones I see executed:

$ grep -v Prepare mysql-log.txt
1059 Query    SET SESSION wait_timeout = 30 * 86400
1059 Query    SET SESSION sql_mode ='STRICT_ALL_TABLES'
1059 Query    set autocommit=1
191205 11:21:53      1059 Execute    SELECT address, hwaddr, client_id,
valid_lifetime, expire, subnet_id, fqdn_fwd, fqdn_rev, hostname, state,
user_context FROM lease4 WHERE state != 2 AND expire <
TIMESTAMP'2019-12-05 11:32:31' ORDER BY expire ASC LIMIT 101
191205 11:22:03      1059 Execute    SELECT address, hwaddr, client_id,
valid_lifetime, expire, subnet_id, fqdn_fwd, fqdn_rev, hostname, state,
user_context FROM lease4 WHERE state != 2 AND expire <
TIMESTAMP'2019-12-05 11:32:41' ORDER BY expire ASC LIMIT 101
191205 11:22:08      1059 Execute    DELETE FROM lease4 WHERE state = 2
AND expire < TIMESTAMP'2019-12-05 10:32:46'

Odd.  Oh well, good luck with further digging.  It might also help to
crank up Kea's logging to maximum (debuglevel 99) if you haven't done so
already:

"Logging":
{
   "loggers": [
     {
       "name": "kea-dhcp4",
       "output_options": [
           {
             "output": "stdout",
             "pattern": "%-5p %m\n"
           }
       ],
       "severity": "DEBUG",
       "debuglevel": 99
     }
   ]
}

Regards,

Brian.


_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users