<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Tim,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
   I notice that you are using "subnet id"s in the "shared network" example whereas in your non "shared network example there appears to be no "subnet id"s.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Also the "subnet id"s returned in "stat-lease4-get" call don't seem to match your config?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If you are seeing relayed "offers" being sent from Kea but no "requests" being received then either</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<ol>
<li>The offers are not getting through to the client</li><li>The requests from the client are not get back to Kea</li><li>The client doesn't like the offer and does not send a request or it has received an offer from some other source that it requests. If the reason is that the client for some reason does not like the offer then you should be seeing multiple discoveries from
 the client </li></ol>
</div>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Clients that already have leases should be unicasting renewal requests directly to Kea.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
/Peter</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
Sent from <a href="http://aka.ms/weboutlook">Outlook</a></div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kea-users <kea-users-bounces@lists.isc.org> on behalf of Tim Požár <pozar@lns.com><br>
<b>Sent:</b> 14 November 2020 02:05<br>
<b>To:</b> Kea-users@lists.isc.org <Kea-users@lists.isc.org><br>
<b>Subject:</b> [Kea-users] Moving to implementing shared-networks</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">I am working with a small ISP that got a /22 of v4 space and is using
<br>
kea 1.6.2 in HA mode on two VMs.  From the /22 they use a /23 for DHCP <br>
customers.  The rest is for statics, loopbacks, etc.<br>
<br>
The servers are sitting behind a Juniper MX104 using subscriber services <br>
so the stanard, get a dhcp packet with a particular DHCP Agent info of <br>
double tag, start to build the demux interface, look the customer up in <br>
Radius and assign them an IP address via DHCP and finish the demux <br>
interface on the last DHCP ACK.<br>
<br>
They have nearly exhausted the /23 so they would like to add another <br>
small prefix (/26) to get them another 60 addresses or so to tied them <br>
over until the can pick up another /22 or so to move their dhcp <br>
customers too.<br>
<br>
Working REDACTED config...<br>
---<br>
{<br>
     "Dhcp4": {<br>
         "interfaces-config": {<br>
             "interfaces": [ "eth0", "eth1", "eth2" ]<br>
         },<br>
[...]<br>
         "valid-lifetime": 4000,<br>
         "renew-timer": 1000,<br>
         "rebind-timer": 2000,<br>
         "reservation-mode": "disabled",<br>
         "control-socket": {<br>
             "socket-type": "unix",<br>
             "socket-name": "/tmp/kea-dhcp4-ctrl.sock"<br>
         },<br>
         "lease-database": {<br>
             "type": "memfile",<br>
             "persist": true,<br>
             "name": "/var/lib/kea/kea-leases4.csv",<br>
             "lfc-interval": 3600<br>
         },<br>
[...]<br>
         "option-data": [<br>
             {<br>
                 "name": "domain-name-servers",<br>
                 "data": "9.9.9.9, 8.8.8.8"<br>
             }<br>
         ],<br>
[...]<br>
         // For a list of available hook libraries, see <br>
<a href="https://gitlab.isc.org/isc-projects/kea/wikis/Hooks-available">https://gitlab.isc.org/isc-projects/kea/wikis/Hooks-available</a><br>
         "hooks-libraries": [<br>
             {<br>
                 "library": "/usr/lib64/kea/hooks/libdhcp_ha.so",<br>
                 "parameters": {<br>
                     "high-availability": [<br>
                         {<br>
                             "this-server-name": "dhcp01",<br>
                             "mode": "load-balancing",<br>
                             "peers": [<br>
                                 {<br>
                                     "name": "dhcp01",<br>
                                     "url": "<a href="http://10.1.9.2:8080/">http://10.1.9.2:8080/</a>",<br>
                                     "role": "primary"<br>
                                 },<br>
                                 {<br>
                                     "name": "dhcp02",<br>
                                     "url": "<a href="http://10.1.9.3:8080/">http://10.1.9.3:8080/</a>",<br>
                                     "role": "secondary"<br>
                                 }<br>
                             ]<br>
                         }<br>
                     ]<br>
                 }<br>
             }<br>
         ],<br>
         "subnet4": [<br>
             {<br>
                 // "name": "Networks",<br>
                 "option-data": [<br>
                     {<br>
                         "data": "1.2.3.1",<br>
                         "name": "routers"<br>
                     }<br>
                 ],<br>
                 "pools": [{"pool": "1.2.3.2 - 1.2.4.254"}],<br>
                 "reservations": [],<br>
                 "subnet": "1.2.3.0/23",<br>
                 "relay": {<br>
                     "ip-addresses": [ "1.2.3.1","1.2.5.1" ]<br>
                 }<br>
             },<br>
[...]<br>
<br>
I moved the subnet4 stanza for the 1.2.3.1/23 pool to a shared-network <br>
stanza and added a new /26 that looks like:<br>
[...]<br>
         "shared-networks": [<br>
             {<br>
                 "name": "BNG-Users1",<br>
                 "relay": {<br>
                     "ip-addresses": [ "1.2.3.1","1.2.5.1" ]<br>
                  },<br>
                 "subnet4": [<br>
                     {<br>
                         // "name": "Customer Network Prefix #2",<br>
                         "option-data": [<br>
                             {<br>
                                 "data": "1.2.5.1",<br>
                                 "name": "routers"<br>
                             }<br>
                         ],<br>
                         "pools": [{"pool": "1.2.5.2 - 1.2.5.62"}],<br>
                         "reservations": [],<br>
                         "subnet": "1.2.5.0/26",<br>
                         "id": 5<br>
                     },<br>
                     {<br>
                         // "name": "Customer Network Prefix #1",<br>
                         "option-data": [<br>
                             {<br>
                                 "data": "1.2.3.1",<br>
                                 "name": "routers"<br>
                             }<br>
                         ],<br>
                         "pools": [{"pool": "1.2.3.2 - 1.2.4.254"}],<br>
                         "reservations": [],<br>
                         "subnet": "1.2.3.0/23",<br>
                         "id": 110<br>
                     }<br>
                 ]<br>
             }<br>
         ],<br>
[...]<br>
<br>
In starting this up, it hands out the /26 pool and then doesn't assign <br>
much (6 to 12) from the old /23 pool.  Reversing the prefixes will mean <br>
it will only assign perhaps a dozen leases and then stops.<br>
<br>
Running TCPDUMP on the Kea VMs I see a bunch of broken DHCP handshakes <br>
where I see:<br>
<br>
DHCP Discover<br>
DHCP Offer<br>
<br>
and not the full handshake of:<br>
DHCP Discover<br>
DHCP Offer<br>
DHCP Request<br>
DHCP ACK<br>
<br>
Or I will see a number of Discover/Offer exchanges and after some time a <br>
Discover/Offer/Request/ACK.<br>
<br>
If I look at the API with something like:<br>
<br>
curl -X POST -H "Content-Type: application/json" -d '{ "command": <br>
"stat-lease4-get","service": [ "dhcp4" ]}' <a href="http://127.0.0.1:8080/">http://127.0.0.1:8080/</a> |
<br>
python3 -m json.tool<br>
[<br>
     {<br>
         "arguments": {<br>
             "result-set": {<br>
                 "columns": [<br>
                     "subnet-id",<br>
                     "total-addreses",<br>
                     "assigned-addreses",<br>
                     "declined-addreses"<br>
                 ],<br>
                 "rows": [<br>
                     [<br>
                         1,<br>
                         509,<br>
                         499,<br>
                         0<br>
                     ],<br>
                     [<br>
                         2,<br>
                         967,<br>
                         0,<br>
                         0<br>
                     ],<br>
                     [<br>
                         3,<br>
                         1013,<br>
                         219,<br>
                         0<br>
                     ],<br>
                     [<br>
                         4,<br>
                         1013,<br>
                         0,<br>
                         0<br>
                     ]<br>
                 ],<br>
                 "timestamp": "2020-11-13 06:08:34.067055"<br>
             }<br>
         },<br>
         "result": 0,<br>
         "text": "stat-lease4-get[all subnets]: 4 rows found"<br>
     }<br>
]<br>
<br>
This is an example of a working dhcp server.  If I try the <br>
shared-networks, the pools always show 0 assigned-addresses.<br>
<br>
Is shared-networks pretty stable on 1.6.2?  Any suggestion on why only a <br>
small percent or none of these handshakes work?  Any suggestion on <br>
debugging this further?  I did create some rather large kea logs with <br>
logging set to DEBUG and debug set to 99 if that can be of help.<br>
<br>
Tim Pozar<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
ISC funds the development of this software with paid support subscriptions. Contact us at
<a href="https://www.isc.org/contact/">https://www.isc.org/contact/</a> for more information.<br>
<br>
To unsubscribe visit <a href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a>.<br>
<br>
Kea-users mailing list<br>
Kea-users@lists.isc.org<br>
<a href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a><br>
</div>
</span></font></div>
</body>
</html>