<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">see analysis in-line below<div><br><div><br><blockquote type="cite"><div>On Jan 6, 2023, at 9:04 AM, Marcos Renato da Silva Junior <marcos.silva@unesp.br> wrote:</div><br class="Apple-interchange-newline"><div>
  
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  
  <div>
    <pre class="tw-data-text tw-text-large tw-ta" data-placeholder="Tradução" id="tw-target-text" style="text-align:left" dir="ltr"><span class="Y2IQFc" lang="en">Context, I was only using one subnet. No duplication. I added two more subnets and configured shared network and the duplication only happens in these two subnets.

I'm using high availability (load-balancing), and lease-update is ok. One lease per update.

I noticed that some leases have a dot after hostname. (</span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"> sltecpc3. / </span></span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">sltecpc4 )</span></span>
</span></pre></div></div></blockquote><div><br></div><div>I’m not seeing the sltecpc4 listed below in the config so I couldn’t guess at what the difference is.  However, if you are trying </div><div>to perform ddns updates using these hostnames you set (which I don’t see in your config below), then you may want to set</div><div><br></div><div>"ddns-qualifying-suffix": “<some domain.com>",</div><div><br></div>so that something comes after the ‘.' (‘.’ being the root zone I think your ddns update would not be functional).</div><div><br></div><div>Or you could not set that and set your hostnames in the reservation to the FQDN which would let you use different domain names, </div><div>if required.</div><div><br><blockquote type="cite"><div><div><pre class="tw-data-text tw-text-large tw-ta" data-placeholder="Tradução" id="tw-target-text" style="text-align:left" dir="ltr"><span class="Y2IQFc" lang="en">

<b>server1#</b> /var/lib/kea/kea-leases4.csv.2

192.168.2.151,00:e1:4c:11:01:d6,,86400,1673091914,2,0,0,sltecpc3.,0,

</span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><b>server1#</b> </span>/var/lib/kea/kea-leases4.csv

</span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">192.168.2.151</span></span>,</span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">00:e1:4c:11:01:d6</span>,,86400,1673096386,2,0,0,administrator.,0,
</span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">192.168.2.151</span>,</span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">00:e1:4c:11:01:d6</span></span>,,86400,1673096386,2,0,0,sltecpc3.,0,

</span>
<span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><b>server2#</b> </span></span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">/var/lib/kea/kea-leases4.csv.2</span>

</span></span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">192.168.2.151</span>,</span></span><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en">00:e1:4c:11:01:d6</span>,,86400,1673091914,2,0,0,sltecpc3.,0,
</span></span><span class="Y2IQFc" lang="en">
</span><b><span class="Y2IQFc" lang="en">server2#</span></b> <span class="Y2IQFc" lang="en"><span class="Y2IQFc" lang="en"></span>/var/lib/kea/kea-leases4.csv</span>

<span class="Y2IQFc" lang="en">192.168.2.151</span>,<span class="Y2IQFc" lang="en">00:e1:4c:11:01:d6</span>,,86400,1673096386,2,0,0,sltecpc3.,0,
</pre></div></div></blockquote><br><div>I would guess that this particular lease was served from server1 so server2 never received the duplication.</div><div><br></div><div>This duplication might actually be normal.  The lease file .csv is appended to by Kea during normal operation.  </div><div>Periodically, a process called 'kea-lfc’ is executed by the 'kea-dhcp4’ process to clean/rotate this leases.csv file.</div><div>It is normal to see many entries in the leases.csv with sort of a history between ‘lfc-interval’.  I was curious </div><div>(as you were) as to why this same lease appeared twice with two different hostnames.</div><div><br></div><blockquote type="cite"><div><div><pre class="tw-data-text tw-text-large tw-ta" data-placeholder="Tradução" id="tw-target-text" style="text-align:left" dir="ltr">
<b><b><span class="Y2IQFc" lang="en">server2#</span></b> </b>/etc/kea/kea-dhcp4.conf

{
"Dhcp4": {
    "interfaces-config": {
        "interfaces": [ "eth0" ]
    },
    "control-socket": {
        "socket-type": "unix",
        "socket-name": "/tmp/kea4-ctrl-socket"
    },
    "lease-database": {
        "type": "memfile",
        "lfc-interval": 3600
    },
    "expired-leases-processing": {
        "reclaim-timer-wait-time": 3600,    
        "flush-reclaimed-timer-wait-time": 25,
        "hold-reclaimed-time": 172800,    
        "max-reclaim-leases": 100,
        "max-reclaim-time": 250,
        "unwarned-reclaim-cycles": 5
    },
    "renew-timer": 43200,
    "rebind-timer": 64800, 
    "valid-lifetime": 86400,
    "hooks-libraries": [
        {
            "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so",
            "parameters": { }
        },
        {
            "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so",
            "parameters": {
                "high-availability": [ {
                    "this-server-name": "server2",
                    "trust-anchor": "/usr/lib/x86_64-linux-gnu/kea/kea-ca.crt",
                    "cert-file": "/usr/lib/x86_64-linux-gnu/kea/kea-client.crt",
                    "key-file": "/usr/lib/x86_64-linux-gnu/kea/kea-client.key", 
                    "mode": "load-balancing",
                    "heartbeat-delay": 10000,
                    "max-response-delay": 60000,
                    "max-ack-delay": 5000,
                    "max-unacked-clients": 0,
                    "sync-timeout": 60000,
                    "delayed-updates-limit": 100,
                    "peers": [
                         {
                             "name": "server1",
                             "url": <a class="moz-txt-link-rfc2396E" href="http://server1:8000/">"http://server1:8000/"</a>,
                             "role": "primary",
                             "auto-failover": true
                         },
                         {
                             "name": "server2",
                             "url": <a class="moz-txt-link-rfc2396E" href="http://server2:8000/">"http://server2:8000/"</a>,
                             "role": "secondary",
                             "auto-failover": true
                         }
                     ]
                 } ]
            }
        }
    ],
    
    "host-reservation-identifiers": [ "hw-address" ],
    
    "match-client-id": false,
    
    "shared-networks": [
        {
            "name": "vlan-2",
    "subnet4": [
        {
            "subnet": "192.168.1.0/24",
            "interface": "eth0",
            "reservations-global": false,
            "reservations-in-subnet": true,
            "reservations-out-of-pool": true,
            "option-data": [
                {
                    "name": "routers",
                    "data": "192.168.1.10"
                },
                {
                    "name": "domain-name-servers",
                    "data": "192.168.1.17, 192.168.1.18"
                },
                {
                    "name": "domain-name",
                    "data": "domain"
                },
                {
                    "name": "domain-search",
                    "data": "domain",
                    "always-send": true
                }
            ],
            "reservations": [
                { "hostname": "sl1pc", "hw-address": "00:00:00:00:00:00", "ip-address": "192.168.1.2" }             
            ]
        },
        {
            <b>"subnet": "192.168.2.0/24",</b>
            "interface": "eth0",
            "reservations-global": false,
            "reservations-in-subnet": true,
            "reservations-out-of-pool": true,
            "option-data": [
                {
                    "name": "routers",
                    "data": "192.168.2.10"
                },
                {
                    "name": "domain-name-servers",
                    "data": "192.168.1.17, 192.168.1.18"
                },
                {
                    "name": "domain-name",
                    "data": "domain"
                },
                {
                    "name": "domain-search",
                    "data": "domain",
                    "always-send": true
                }
            ],
            "reservations": [
<b>                { "hostname": "sltecpc3", "hw-address": "00:e1:4c:11:01:d6", "ip-address": "192.168.2.151” }</b>
</pre></div></div></blockquote><div><br></div>This is what I was looking for.  I think what is happening is Kea is first logging the hostname that the client sent with the lease to the leases.csv</div><div>and then logging the hostname that is assigned by the reservation here.  I don’t think it’s anything to worry about.  Probably wouldn’t happen if</div><div>the client wasn’t sending a hostname (you can confirm with wireshark / tcpdump / or Kea packet log on debug:99 whether client is sending a </div><div>hostname or not)</div><div><br><blockquote type="cite"><div><div><pre class="tw-data-text tw-text-large tw-ta" data-placeholder="Tradução" id="tw-target-text" style="text-align:left" dir="ltr">            ]
        },
        {
            <b>"subnet": "192.168.3.0/24",</b>
            "interface": "eth0",
            "reservations-global": false,
            "reservations-in-subnet": true,
            "reservations-out-of-pool": true,
            "option-data": [
                {
                    "name": "routers",
                    "data": "192.168.3.10"
                },
                {
                    "name": "domain-name-servers",
                    "data": "192.168.1.17, 192.168.1.18"
                },
                {
                    "name": "domain-name",
                    "data": "domain"
                },
                {
                    "name": "domain-search",
                    "data": "domain",
                    "always-send": true
                }
            ],
            "reservations": [
                { "hostname": "sl2nb", "hw-address": "00:00:00:00:00:00", "ip-address": "192.168.3.2" }
            ]
        }
    ]
  }
],
    
    "loggers": [
    {
        "name": "kea-dhcp4",
        "output_options": [
            {
                "output": "/var/log/kea/kea-dhcp4.log",
                "maxsize": 10240000,
                "maxver": 4
            }
        ],
        "severity": "INFO",
        "debuglevel": 0
    }
  ]
}
}


<span class="Y2IQFc" lang="en"></span></pre><div><br class="webkit-block-placeholder"></div>
    <div class="moz-cite-prefix">Em 05/01/2023 21:41, Darren Ankney
      escreveu:<br>
    </div>
    <blockquote type="cite" cite="mid:1F6DB331-7460-4F3D-94B2-87FF6A08C953@gmail.com">
      <pre class="moz-quote-pre" wrap="">can you share any relevant configurations involving an example device that is exhibiting this behavior?

</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">On Jan 5, 2023, at 4:15 PM, Marcos Renato da Silva Junior <a class="moz-txt-link-rfc2396E" href="mailto:marcos.silva@unesp.br"><marcos.silva@unesp.br></a> wrote:

Hi,

I seeing some duplicates leases on my Lease File (kea-leases4.csv), apparently one with device hostname and other with dhcp hostname. After LFC the Previous Lease File (kea-leases4.csv.2) seems ok. Its normal?

/var/lib/kea/kea-leases4.csv

192.168.0.100,00:00:00:00:00:00,,86400,1673038783,3,0,0,device-hostname.,0,
192.168.0.100,00:00:00:00:00:00,,86400,1673038783,3,0,0,dhcp-hostname.,0,

-- 
Marcos Renato da Silva Junior
Universidade Estadual Paulista - Unesp
Faculdade de Engenharia de Ilha Solteira - FEIS
Departamento de Engenharia Elétrica - DEE
15385-000 - Ilha Solteira/SP
(18) 3743-1164

-- 
ISC funds the development of this software with paid support subscriptions. Contact us at <a class="moz-txt-link-freetext" href="https://www.isc.org/contact/">https://www.isc.org/contact/</a> for more information.

To unsubscribe visit <a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a>.

Kea-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kea-users@lists.isc.org">Kea-users@lists.isc.org</a>
<a class="moz-txt-link-freetext" href="https://lists.isc.org/mailman/listinfo/kea-users">https://lists.isc.org/mailman/listinfo/kea-users</a>
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap=""></pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Marcos Renato da Silva Junior
Universidade Estadual Paulista - Unesp
Faculdade de Engenharia de Ilha Solteira - FEIS
Departamento de Engenharia Elétrica - DEE
15385-000 - Ilha Solteira/SP
(18) 3743-1164</pre>
  </div>

-- <br>ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.<br><br>To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.<br><br>Kea-users mailing list<br>Kea-users@lists.isc.org<br>https://lists.isc.org/mailman/listinfo/kea-users<br></div></blockquote></div><br></div></body></html>