[Kea-users] Prefix delegation

Mauro Gasparini mjgaspa at cablenet.com.ar
Fri Feb 6 17:27:01 UTC 2015


Perfect.

# /usr/local/sbin/kea-dhcp6 -v
0.9-git

-------------------------------------------------------
# /etc/kea/kea.conf

# Subnets

     "subnet6": [
         { "subnet": "2800:820:1::/52",
           "pools": [ { "pool": "2800:820:1:1::228-2800:820:1:1::254" } 
], "interface": "eth0" ,
           "pools": [ { "pool": "2800:820:1:2::228-2800:820:1:2::254" } 
], "interface": "eth0" ,
             "pd-pools": [ { "prefix": "2800:820:3::", "prefix-len": 48, 
"delegated-len": 56 } ], "interface": "eth0"
         }
     ]

-------------------------------------------------------
# tail /usr/local/var/kea/kea.log

2015-02-06 14:31:47.461 DEBUG [kea-dhcp6.dhcpsrv/27574] 
DHCPSRV_CFGMGR_SUBNET6 retrieved subnet 2800:820:1::/52 for address hint 
2800:820:1:1::1
2015-02-06 14:31:47.461 DEBUG [kea-dhcp6.dhcp6/27574] 
DHCP6_EXTEND_LEASE_SUBNET_SELECTED the 2800:820:1::/52 subnet was 
selected for client extending its lease
2015-02-06 14:31:47.461 DEBUG [kea-dhcp6.dhcpsrv/27574] 
DHCPSRV_MEMFILE_UPDATE_ADDR6 updating IPv6 lease for address 2800:820:3::
2015-02-06 14:31:47.462 DEBUG [kea-dhcp6.dhcp6/27574] 
DHCP6_RESPONSE_DATA responding with packet type 7 data is 
localAddr=[2800:820:1:ff::18]:547 remoteAddr=[2800:820:1:1::1]:547
msgtype=7, transid=0xc0b22a
type=1, len=14: 00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d
type=2, len=14: 00:01:00:01:1c:22:ed:15:00:01:2e:2a:02:fa
type=23 1addr(s): 2800:820:1::18
type=25(IA_PD) iaid=1, t1=1000, t2=2000 1 sub-options:
   type=26(IAPREFIX) prefix=2800:820:3::/56, preferred-lft=3000, 
valid-lft=4000
-------------------------------------------------------


El 06/02/15 a las 07:09, Marcin Siodelski escribió:
> Mauro,
>
> The fix for defining a pool for prefix delegation now on the master
> branch. You can use https://github.com/isc-projects/kea/ to build the
> latest greatest version of Kea and give it a try. It should accept the
> prefix pools which don't match the subnet prefix.
>
> Let me know how it goes...
>
> Marcin
>
> On 02/03/15 18:30, Mauro Gasparini wrote:
>> Thanks Marcin.
>>
>> It works with:
>>      "subnet6": [
>>          { "subnet": "2800:820:1::/52",
>>            "pools": [ { "pool": "2800:820:1:1::228-2800:820:1:1::254" }
>> ], "interface": "eth0" ,
>>            "pools": [ { "pool": "2800:820:1:2::228-2800:820:1:2::254" }
>> ], "interface": "eth0" ,
>>            "pd-pools": [ { "prefix": "2800:820:1:100::", "prefix-len":
>> 56, "delegated-len": 60 } ]
>>          }
>>      ]
>>
>> I'll wait until next code review to test “pool” and “pd-pool” in
>> different subnets.
>>
>> Regards.
>>
>> El 02/02/15 a las 12:27, kea-users-request at lists.isc.org escribió:
>>> Send Kea-users mailing list submissions to
>>>      kea-users at lists.isc.org
>>>
>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>      https://lists.isc.org/mailman/listinfo/kea-users
>>> or, via email, send a message with subject or body 'help' to
>>>      kea-users-request at lists.isc.org
>>>
>>> You can reach the person managing the list at
>>>      kea-users-owner at lists.isc.org
>>>
>>> When replying, please edit your Subject line so it is more specific
>>> than "Re: Contents of Kea-users digest..."
>>>
>>>
>>> Today's Topics:
>>>
>>>      1. Prefix delegation (Mauro Gasparini)
>>>      2. Re: Prefix delegation (Marcin Siodelski)
>>>
>>>
>>> ----------------------------------------------------------------------
>>>
>>> Message: 1
>>> Date: Mon, 02 Feb 2015 12:11:00 -0300
>>> From: Mauro Gasparini <mjgaspa at cablenet.com.ar>
>>> To: kea-users at lists.isc.org
>>> Subject: [Kea-users] Prefix delegation
>>> Message-ID: <54CF9384.8010002 at cablenet.com.ar>
>>> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>>>
>>> Hi,
>>> I would like to know if anyone has successfully configured prefix
>>> delegation in dhcpv6.
>>> In my case I'm trying to delegate network prefixes 2800:820:3::/56 to
>>> customers that require it (without specifying any subnet in particular).
>>>
>>> *My kea setup is as follows:*
>>>
>>> # cat /etc/kea/kea.conf
>>>
>>> {
>>> # DHCPv6 configuration starts on the next line
>>> "Dhcp6": {
>>>
>>> # First we set up global values
>>>        "interfaces": [ "eth0" ],
>>>        "renew-timer": 1000,
>>>        "rebind-timer": 2000,
>>>        "preferred-lifetime": 3000,
>>>        "valid-lifetime": 4000,
>>>
>>>                 "option-data": [
>>>                     {
>>>                         "name": "dns-servers",
>>>                         "code": 23,
>>>                         "space": "dhcp6",
>>>                         "csv-format": true,
>>>                         "data": "2800:820:1:2::18"
>>>                     }
>>>            ],
>>> # Next we specify the type of lease database
>>>        "lease-database": {
>>>            "type": "memfile",
>>>            "persist": true,
>>>        "name": "/usr/local/var/kea/kea-leases6.csv"
>>>        },
>>>
>>> # Finally, we list the subnets from which we will be leasing addresses.
>>>        "subnet6": [
>>>            { "subnet": "2800:820:1:4::/64", "pools": [ { "pool":
>>> "2800:820:1:4::228-2800:820:1:4::254" } ],"interface": "eth0" },
>>>            { "subnet": "2800:820:3::/56",
>>>                "pd-pools": [ { "prefix": "2800:820:3::", "prefix-len": 56,
>>> "delegated-len": 60 } ],"interface": "eth0"
>>>            }
>>>        ]
>>> },
>>> # The following configures logging. It assumes that warning messages
>>> # will be logged to stdout.
>>> "Logging": {
>>>        "loggers": [
>>>            {
>>>                "name": "kea-dhcp6",
>>>                "output_options": [
>>>                    {
>>> #                    "output": "tdout"
>>>                        "output": "/usr/local/var/kea/kea.log"
>>>                    }
>>>                ],
>>>                "severity": "WARN"
>>>            }
>>>        ]
>>> }
>>>
>>> # DHCPv6 configuration ends with the next line
>>> }
>>>
>>> *In logs I see that it delivers a lease of IA_NA but it cannot deliver
>>> IA_PD:*
>>>
>>> # tail /usr/local/var/kea/kea.log
>>>
>>> 2015-02-02 12:18:05.831 DEBUG [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_CFGMGR_SUBNET6_IFACE selected subnet 2800:820:1:4::/64 for
>>> packet received over interface eth0
>>> 2015-02-02 12:18:05.831 DEBUG [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_CFGMGR_SUBNET6_IFACE selected subnet 2800:820:1:4::/64 for
>>> packet received over interface eth0
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_CFGMGR_SUBNET6_IFACE selected subnet 2800:820:1:4::/64 for
>>> packet received over interface eth0
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcp6/30329]
>>> DHCP6_SUBNET_SELECTED the 2800:820:1:4::/64 subnet was selected for
>>> client assignment
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcp6/30329]
>>> DHCP6_PROCESS_IA_NA_REQUEST server is processing IA_NA option
>>> (duid=00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d, iaid=1, hint=(no hint))
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_MEMFILE_GET_IAID_SUBID_DUID obtaining IPv6 leases for IAID 1,
>>> Subnet ID 1, DUID 00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d and lease
>>> type IA_NA
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_MEMFILE_GET_ADDR6 obtaining IPv6 lease for address
>>> 2800:820:1:4::229 and lease type IA_NA
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_MEMFILE_GET_ADDR6 obtaining IPv6 lease for address
>>> 2800:820:1:4::229 and lease type IA_NA
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcp6/30329] DHCP6_LEASE_ADVERT
>>> address lease 2800:820:1:4::229 advertised (client
>>> duid=00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d, iaid=1)
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcp6/30329]
>>> DHCP6_PROCESS_IA_PD_REQUEST server is processing IA_PD option
>>> (duid=00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d, iaid=1, hint=(no hint))
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_MEMFILE_GET_IAID_SUBID_DUID obtaining IPv6 leases for IAID 1,
>>> Subnet ID 1, DUID 00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d and lease
>>> type IA_PD
>>> 2015-02-02 12:18:05.832 ERROR [kea-dhcp6.dhcpsrv/30329]
>>> DHCPSRV_ADDRESS6_ALLOC_ERROR error during attempt to allocate an IPv6
>>> address: No pools defined in selected subnet
>>> 2015-02-02 12:18:05.832 DEBUG [kea-dhcp6.dhcp6/30329]
>>> DHCP6_PD_LEASE_ADVERT_FAIL failed to advertise a prefix lease for client
>>> duid=00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d, iaid=1
>>> 2015-02-02 12:18:05.833 DEBUG [kea-dhcp6.dhcp6/30329]
>>> DHCP6_RESPONSE_DATA responding with packet type 2 data is
>>> localAddr=[ff02::1:2]:547 remoteAddr=[fe80::2e0:4cff:fe0c:19fd]:546
>>> msgtype=2, transid=0x80e1c
>>> type=1, len=14: 00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d
>>> type=2, len=14: 00:01:00:01:1c:22:ed:15:00:01:2e:2a:02:fa
>>> type=3(IA_NA) iaid=1, t1=1000, t2=2000 1 sub-options:
>>>      type=5(IAADDR) addr=2800:820:1:4::229, preferred-lft=3000,
>>> valid-lft=4000
>>>
>>> type=23 1addr(s): 2800:820:1:2::18
>>> type=25(IA_PD) iaid=1, t1=0, t2=0 1 sub-options:
>>>      type=13, len=40, data fields:
>>>        #0 6 ( uint16 )
>>>        #1 Sorry, no prefixes could be allocated. ( string )
>>>
>>> 2015-02-02 12:18:05.833 DEBUG [kea-dhcp6.dhcp6/30329]
>>> DHCP6_RESPONSE_DATA responding with packet type 2 data is
>>> localAddr=[ff02::1:2]:547 remoteAddr=[fe80::2e0:4cff:fe0c:19fd]:546
>>> msgtype=2, transid=0x80e1c
>>> type=1, len=14: 00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d
>>> type=2, len=14: 00:01:00:01:1c:22:ed:15:00:01:2e:2a:02:fa
>>> type=3(IA_NA) iaid=1, t1=1000, t2=2000 1 sub-options:
>>>      type=5(IAADDR) addr=2800:820:1:4::229, preferred-lft=3000,
>>> valid-lft=4000
>>>
>>> type=23 1addr(s): 2800:820:1:2::18
>>> type=25(IA_PD) iaid=1, t1=0, t2=0 1 sub-options:
>>>      type=13, len=40, data fields:
>>>        #0 6 ( uint16 )
>>>        #1 Sorry, no prefixes could be allocated. ( string )
>>>
>>> 2015-02-02 12:18:06.839 DEBUG [kea-dhcp6.dhcp6/30329]
>>> DHCP6_PACKET_RECEIVED REQUEST packet received
>>> 2015-02-02 12:18:06.840 DEBUG [kea-dhcp6.dhcp6/30329] DHCP6_QUERY_DATA
>>> received packet length 3, data length 0, data is localAddr=[ff02::1:2]:0
>>> remoteAddr=[fe80::2e0:4cff:fe0c:19fd]:546
>>> msgtype=3, transid=0x22c8ee
>>> type=1, len=14: 00:01:00:01:1c:47:92:c6:00:19:21:78:c6:8d
>>> type=2, len=14: 00:01:00:01:1c:22:ed:15:00:01:2e:2a:02:fa
>>> type=3(IA_NA) iaid=1, t1=4294967295, t2=4294967295 1 sub-options:
>>>      type=5(IAADDR) addr=2800:820:1:4::229, preferred-lft=3000,
>>> valid-lft=4000
>>>
>>> type=6, len=2:
>>> type=8, len=2:
>>> type=25(IA_PD) iaid=1, t1=4294967295, t2=4294967295 0 sub-options:
>>>
>>> *Server IP conf is:*
>>>
>>> # ip -6 addr list
>>> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436
>>>        inet6 ::1/128 scope host
>>>           valid_lft forever preferred_lft forever
>>> 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qlen 1000
>>>        inet6 2800:820:1:4::1/64 scope global
>>>           valid_lft forever preferred_lft forever
>>>        inet6 fe80::201:2eff:fe2a:2fa/64 scope link
>>>           valid_lft forever preferred_lft forever
>>>
>>>
>> _______________________________________________
>> Kea-users mailing list
>> Kea-users at lists.isc.org
>> https://lists.isc.org/mailman/listinfo/kea-users




More information about the Kea-users mailing list