2018-02-27 16:15 GMT+01:00 Tomek Mrugalski <[email protected]>:

> On 02/27/18 15:38, Stéphane Klein wrote:
> > Do you have example how to insert properly my host in Kea PostgreSQL
> > database?
> Have you read this http://kea.isc.org/wiki/HostReservationsHowTo?
>
>
Thanks

I have written:

DELETE FROM hosts;

INSERT INTO hosts (
  dhcp_identifier,
  dhcp_identifier_type,
  dhcp4_subnet_id,
  ipv4_address,
  hostname,
  dhcp4_next_server,
  dhcp4_server_hostname,
  dhcp4_boot_file_name
)

VALUES (
  DECODE(REPLACE('08-00-27-8e-15-8a', '-', ''), 'hex'),
    (SELECT type FROM host_identifier_type WHERE name='hw-address'),
  1,
  (SELECT ('192.168.0.11'::inet - '0.0.0.0'::inet)),
  'blank_machine',
  (SELECT ('192.168.0.254'::inet - '0.0.0.0'::inet)),
  'blank_machine',
  'pxelinux.0'
);

INSERT INTO hosts (
  dhcp_identifier,
  dhcp_identifier_type,
  dhcp4_subnet_id,
  ipv4_address,
  hostname,
  dhcp4_next_server,
  dhcp4_server_hostname,
  dhcp4_boot_file_name
)

VALUES (
  DECODE(REPLACE('08-00-27-8e-15-8b', '-', ''), 'hex'),
    (SELECT type FROM host_identifier_type WHERE name='hw-address'),
  1,
  (SELECT ('192.168.0.12'::inet - '0.0.0.0'::inet)),
  'test-dhcp-server',
  (SELECT ('192.168.0.254'::inet - '0.0.0.0'::inet)),
  'test-dhcp-server',
  'pxelinux.0'
);
_______________________________________________
Kea-users mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/kea-users

Reply via email to