[Kea-users] Kea server - ipv6 allocations based on interface-id & remote-id

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

[Kea-users] Kea server - ipv6 allocations based on interface-id & remote-id

nathiya
Hi,

Need help in configuring kea dhcp6 server to allocate ip address based on Interface-id (option 18) and Remote-id (option 37) sent by the relay agent

We tried configuring the server with the below configs,

 

"Dhcp6": {

    "subnet6": [

        {

            "subnet": "99::0/64",

            "pools": [

                 {

                     "pool": "99::1-99::20"

                 }

             ],

            "interface-id": "BLUEE"

        }

    ],

}

 

  1. Kea dhcp6 server gives ipv6 address with or without  interface id string match. Need help to understand, if we are missing something for interface-id configuration.
  2. Also a sample server configuration for remote-id based ip allocation will help.


kea-dhcp6 logs are pasted below for the above interface-id case:

204 16:51:05.837 kea-dhcp6.packets DHCP6_BUFFER_RECEIVED received buffer from 88::2:546 to 88::1:0 over interface e101-002-0
204 16:51:05.837 kea-dhcp6.options DHCP6_BUFFER_UNPACK parsing buffer received from 88::2 to 88::1 over interface e101-002-0
204 16:51:05.838 kea-dhcp6.packets DHCP6_PACKET_RECEIVED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: REQUEST (type 3) received from 88::2 to 88::1 on interface e101-002-0
204 16:51:05.838 kea-dhcp6.packets DHCP6_QUERY_DATA duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0, packet details: localAddr=[88::1]:0 remoteAddr=[88::2]:546
msgtype=3(REQUEST), transid=0xecbed0
type=00001, len=00014: 00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1
type=00002, len=00014: 00:01:00:01:26:aa:e3:ee:3e:90:9e:cd:cf:66
type=00003(IA_NA), len=00040: iaid=2177023393, t1=3600, t2=5400,
options:
  type=00005(IAADDR), len=00024: address=99::6, preferred-lft=7200, valid-lft=7500
type=00008, len=00002: 0 (uint16)
1 relay(s):
relay[0]: msg-type=12(RELAY_FORWARD), hop-count=0,
link-address=99::2, peer-address=fe80::4407:81ff:fec2:bda1, 2 option(s)
type=00018, len=00004: 42:4c:55:45
type=00037, len=00021: 808859444 (uint32) 61613A61613A61613A61613A61613A6161 (binary)

204 16:51:05.838 kea-dhcp6.dhcpsrv DHCPSRV_CFGMGR_SUBNET6 retrieved subnet 99::/64 for address hint 99::2
204 16:51:05.838 kea-dhcp6.packets DHCP6_SUBNET_SELECTED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], t

204 16:51:05.838 kea-dhcp6.dhcpsrv DHCPSRV_CFGMGR_SUBNET6 retrieved subnet 99::/64 for address hint 99::2
204 16:51:05.838 kea-dhcp6.packets DHCP6_SUBNET_SELECTED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: the subnet with ID 1 was selected for client assignments
204 16:51:05.838 kea-dhcp6.packets DHCP6_SUBNET_DATA duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: the selected subnet details: 99::/64
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv6 reservation for subnet id 1, identified by hwaddr=61613A61613A61613A61613A61613A6161
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: hwaddr=61613A61613A61613A61613A61613A6161
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier hwaddr=61613A61613A61613A61613A61613A6161, found 0 host(s)
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 1 and identifier hwaddr=61613A61613A61613A61613A61613A6161
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv6 reservation for subnet id 1, identified by duid=0001000126AB2AF7460781C2BDA1
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: duid=0001000126AB2AF7460781C2BDA1
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier duid=0001000126AB2AF7460781C2BDA1, found 0 host(s)
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 1 and identifier duid=0001000126AB2AF7460781C2BDA1
204 16:51:05.838 kea-dhcp6.dhcp6 DHCP6_CLASS_ASSIGNED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: client packet has been assigned to the following class(es): UNKNOWN
204 16:51:05.839 kea-dhcp6.leases DHCP6_PROCESS_IA_NA_REQUEST duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: server is processing IA_NA option with iaid=2177023393 and hint=99::6
204 16:51:05.839 kea-dhcp6.dhcpsrv DHCPSRV_MEMFILE_GET_IAID_DUID obtaining IPv6 leases for IAID 2177023393 and DUID 00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1 and lease type IA_NA
204 16:51:05.839 kea-dhcp6.alloc-engine ALLOC_ENGINE_V6_ALLOC_UNRESERVED no static reservations available - trying to dynamically allocate leases for client duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0
204 16:51:05.839 kea-dhcp6.dhcpsrv DHCPSRV_MEMFILE_GET_ADDR6 obtaining IPv6 lease for address 99::6 and lease type IA_NA
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6 get one host with reservation for subnet id 1 and including IPv6 address 99::6
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_SUBNET_ID_ADDRESS6 get all hosts with reservations for subnet id 1 and IPv6 address 99::6
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_SUBNET_ID_ADDRESS6_COUNT using subnet id 1 and address 99::6, found 0 host(s)
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6_NULL host not found using subnet id 1 and address 99::6
204 16:51:05.839 kea-dhcp6.dhcpsrv DHCPSRV_MEMFILE_ADD_ADDR6 adding IPv6 lease with address 99::6
204 16:51:05.839 kea-dhcp6.leases DHCP6_LEASE_ALLOC duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: lease for address 99::6 and iaid=2177023393 has been allocated for 3600 seconds
204 16:51:05.839 kea-dhcp6.leases DHCP6_LEASE_DATA duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: detailed lease information for iaid=2177023393: Type:          IA_NA(0)
Address:       99::6
Prefix length: 128
IAID:          2177023393
Pref life:     3600
Valid life:    3600
Cltt:          1595436665
DUID:          00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1
Hardware addr: 61:61:3a:61:61:3a:61:61:3a:61:61:3a:61:61:3a:61:61
Subnet ID:     1
State:         default

204 16:51:05.839 kea-dhcp6.packets DHCP6_PACKET_SEND duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: trying to send packet REPLY (type 7) from [88::1]:547 to [88::2]:547 on interface e101-002-0
204 16:51:05.839 kea-dhcp6.packets DHCP6_RESPONSE_DATA responding with packet type 7 data is localAddr=[88::1]:547 remoteAddr=[88::2]:547
msgtype=7(REPLY), transid=0xecbed0
type=00001, len=00014: 00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1
type=00002, len=00014: 00:01:00:01:26:aa:e3:ee:3e:90:9e:cd:cf:66
type=00003(IA_NA), len=00040: iaid=2177023393, t1=1800, t2=2700,
options:
  type=00005(IAADDR), len=00024: address=99::6, preferred-lft=3600, valid-lft=3600
1 relay(s):
relay[0]: msg-type=13(RELAY_REPLY), hop-count=0,
link-address=99::2, peer-address=fe80::4407:81ff:fec2:bda1, 1 option(s)
type=00018, len=00004: 42:4c:55:45



Regards,

Nathiya.


_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

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] Kea server - ipv6 allocations based on interface-id & remote-id

Joelson Vendramin
Hi Nathiya!

Here is a piece of my KEA config that worked for the case of assigning IPv4 and IPv6 based on Interface-ID:

(...)
  "subnet4": [
     { "subnet": "192.0.2.0/29",
       "option-data": [
         { "name": "routers",
           "code": 3,
           "csv-format": true,
           "data": "192.0.2.1"
         }
       ],
       "reservations": [
         { "circuit-id": "'Eth-Trunk6.2:333.0 router-name'", "ip-address": "192.0.2.2" },
         { "circuit-id": "'Eth-Trunk6.2:334.0 router-name'", "ip-address": "192.0.2.3" },
         { "circuit-id": "'Eth-Trunk6.2:335.0 router-name'", "ip-address": "192.0.2.4" },
         { "circuit-id": "'Eth-Trunk6.2:336.0 router-name'", "ip-address": "192.0.2.5" },
         { "circuit-id": "'Eth-Trunk6.2:337.0 router-name'", "ip-address": "192.0.2.6" }
       ]
     },

     
(...)          
# client A
     { "subnet": "2001:0db8:bd00::119:2/128",
       "interface-id": "router-name eth 0/6:333",
       "pools": [ { "pool": "2001:0db8:bd00::119:2/128" } ],
       "pd-pools": [ { "prefix": "2001:0db8:bd01::", "prefix-len": 48, "delegated-len": 48 } ]
     },
# client B
     { "subnet": "2001:0db8:bd00::119:3/128",
       "interface-id": "router-name eth 0/6:334",
       "pools": [ { "pool": "2001:0db8:bd00::119:3/128" } ],
       "pd-pools": [ { "prefix": "2001:0db8:bd02::", "prefix-len": 48, "delegated-len": 48 } ]
     },

I remember that I used a 'wireshark/tcpdump' to get exactly the string sent by the router to match "interface-id".

Hope it helps!

Regards,
--
Joelson Vendramin


Em quarta-feira, 22 de julho de 2020 14:00:08 BRT, nathiya dayalan <[hidden email]> escreveu:


Hi,

Need help in configuring kea dhcp6 server to allocate ip address based on Interface-id (option 18) and Remote-id (option 37) sent by the relay agent

We tried configuring the server with the below configs,

 

"Dhcp6": {

    "subnet6": [

        {

            "subnet": "99::0/64",

            "pools": [

                 {

                     "pool": "99::1-99::20"

                 }

             ],

            "interface-id": "BLUEE"

        }

    ],

}

 

  1. Kea dhcp6 server gives ipv6 address with or without  interface id string match. Need help to understand, if we are missing something for interface-id configuration.
  2. Also a sample server configuration for remote-id based ip allocation will help.


kea-dhcp6 logs are pasted below for the above interface-id case:

204 16:51:05.837 kea-dhcp6.packets DHCP6_BUFFER_RECEIVED received buffer from 88::2:546 to 88::1:0 over interface e101-002-0
204 16:51:05.837 kea-dhcp6.options DHCP6_BUFFER_UNPACK parsing buffer received from 88::2 to 88::1 over interface e101-002-0
204 16:51:05.838 kea-dhcp6.packets DHCP6_PACKET_RECEIVED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: REQUEST (type 3) received from 88::2 to 88::1 on interface e101-002-0
204 16:51:05.838 kea-dhcp6.packets DHCP6_QUERY_DATA duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0, packet details: localAddr=[88::1]:0 remoteAddr=[88::2]:546
msgtype=3(REQUEST), transid=0xecbed0
type=00001, len=00014: 00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1
type=00002, len=00014: 00:01:00:01:26:aa:e3:ee:3e:90:9e:cd:cf:66
type=00003(IA_NA), len=00040: iaid=2177023393, t1=3600, t2=5400,
options:
  type=00005(IAADDR), len=00024: address=99::6, preferred-lft=7200, valid-lft=7500
type=00008, len=00002: 0 (uint16)
1 relay(s):
relay[0]: msg-type=12(RELAY_FORWARD), hop-count=0,
link-address=99::2, peer-address=fe80::4407:81ff:fec2:bda1, 2 option(s)
type=00018, len=00004: 42:4c:55:45
type=00037, len=00021: 808859444 (uint32) 61613A61613A61613A61613A61613A6161 (binary)

204 16:51:05.838 kea-dhcp6.dhcpsrv DHCPSRV_CFGMGR_SUBNET6 retrieved subnet 99::/64 for address hint 99::2
204 16:51:05.838 kea-dhcp6.packets DHCP6_SUBNET_SELECTED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], t

204 16:51:05.838 kea-dhcp6.dhcpsrv DHCPSRV_CFGMGR_SUBNET6 retrieved subnet 99::/64 for address hint 99::2
204 16:51:05.838 kea-dhcp6.packets DHCP6_SUBNET_SELECTED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: the subnet with ID 1 was selected for client assignments
204 16:51:05.838 kea-dhcp6.packets DHCP6_SUBNET_DATA duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: the selected subnet details: 99::/64
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv6 reservation for subnet id 1, identified by hwaddr=61613A61613A61613A61613A61613A6161
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: hwaddr=61613A61613A61613A61613A61613A6161
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier hwaddr=61613A61613A61613A61613A61613A6161, found 0 host(s)
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 1 and identifier hwaddr=61613A61613A61613A61613A61613A6161
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER get one host with IPv6 reservation for subnet id 1, identified by duid=0001000126AB2AF7460781C2BDA1
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER get all hosts with reservations using identifier: duid=0001000126AB2AF7460781C2BDA1
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_IDENTIFIER_COUNT using identifier duid=0001000126AB2AF7460781C2BDA1, found 0 host(s)
204 16:51:05.838 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_IDENTIFIER_NULL host not found using subnet id 1 and identifier duid=0001000126AB2AF7460781C2BDA1
204 16:51:05.838 kea-dhcp6.dhcp6 DHCP6_CLASS_ASSIGNED duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: client packet has been assigned to the following class(es): UNKNOWN
204 16:51:05.839 kea-dhcp6.leases DHCP6_PROCESS_IA_NA_REQUEST duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: server is processing IA_NA option with iaid=2177023393 and hint=99::6
204 16:51:05.839 kea-dhcp6.dhcpsrv DHCPSRV_MEMFILE_GET_IAID_DUID obtaining IPv6 leases for IAID 2177023393 and DUID 00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1 and lease type IA_NA
204 16:51:05.839 kea-dhcp6.alloc-engine ALLOC_ENGINE_V6_ALLOC_UNRESERVED no static reservations available - trying to dynamically allocate leases for client duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0
204 16:51:05.839 kea-dhcp6.dhcpsrv DHCPSRV_MEMFILE_GET_ADDR6 obtaining IPv6 lease for address 99::6 and lease type IA_NA
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6 get one host with reservation for subnet id 1 and including IPv6 address 99::6
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_SUBNET_ID_ADDRESS6 get all hosts with reservations for subnet id 1 and IPv6 address 99::6
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ALL_SUBNET_ID_ADDRESS6_COUNT using subnet id 1 and address 99::6, found 0 host(s)
204 16:51:05.839 kea-dhcp6.hosts HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS6_NULL host not found using subnet id 1 and address 99::6
204 16:51:05.839 kea-dhcp6.dhcpsrv DHCPSRV_MEMFILE_ADD_ADDR6 adding IPv6 lease with address 99::6
204 16:51:05.839 kea-dhcp6.leases DHCP6_LEASE_ALLOC duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: lease for address 99::6 and iaid=2177023393 has been allocated for 3600 seconds
204 16:51:05.839 kea-dhcp6.leases DHCP6_LEASE_DATA duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: detailed lease information for iaid=2177023393: Type:          IA_NA(0)
Address:       99::6
Prefix length: 128
IAID:          2177023393
Pref life:     3600
Valid life:    3600
Cltt:          1595436665
DUID:          00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1
Hardware addr: 61:61:3a:61:61:3a:61:61:3a:61:61:3a:61:61:3a:61:61
Subnet ID:     1
State:         default

204 16:51:05.839 kea-dhcp6.packets DHCP6_PACKET_SEND duid=[00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1], tid=0xecbed0: trying to send packet REPLY (type 7) from [88::1]:547 to [88::2]:547 on interface e101-002-0
204 16:51:05.839 kea-dhcp6.packets DHCP6_RESPONSE_DATA responding with packet type 7 data is localAddr=[88::1]:547 remoteAddr=[88::2]:547
msgtype=7(REPLY), transid=0xecbed0
type=00001, len=00014: 00:01:00:01:26:ab:2a:f7:46:07:81:c2:bd:a1
type=00002, len=00014: 00:01:00:01:26:aa:e3:ee:3e:90:9e:cd:cf:66
type=00003(IA_NA), len=00040: iaid=2177023393, t1=1800, t2=2700,
options:
  type=00005(IAADDR), len=00024: address=99::6, preferred-lft=3600, valid-lft=3600
1 relay(s):
relay[0]: msg-type=13(RELAY_REPLY), hop-count=0,
link-address=99::2, peer-address=fe80::4407:81ff:fec2:bda1, 1 option(s)
type=00018, len=00004: 42:4c:55:45



Regards,

Nathiya.

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

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

_______________________________________________
ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

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