<div dir="ltr">Hi,<br><div><br></div><div>  I have a kea kubernetes pod which we need to redeploy in few scenarios. At rare times I have seen following issue:</div><div>2020-07-10 16:11:02.655 WARN  [kea-dhcp6.dhcpsrv/1] DHCPSRV_OPEN_SOCKET_FAIL failed to open socket: Failed to open unicast socket on  interface bond0, reason: Failed to bind socket 15 to fec0:xxxx:yyy:3::17/port=547: Address not available<br>2020-07-10 16:11:02.668 INFO  [kea-dhcp6.dhcp6/1] DHCP6_STARTED Kea DHCPv6 server version 1.7.3 started<br></div><div><br></div><div>when this issue happens kea is running but since bind failed it will get any incoming DHCP packets.</div><div><br></div><div>  The "Address not available" maps to binding error EADDRNOTAVAIL. This particular connection is UDP. However, when I look for this error for TCP I got following explanation in one place:</div><div><br></div><div><br></div><div>```</div><div>After connection close, Connections will go in TIME_WAIT state for some time.<br><br>During this state if any new connections comes with same IP and PORT, if SO_REUSEADDR is not provided during socket creation then socket bind() will fail with error EADDRINUSE.<br><br>But even though after providing SO_REUSEADDR also sockect connect() may fail with error EADDRNOTAVAIL if tcp timestamp is not enable on both side.<br><br>Solution: Please enable tcp timestamp on both side client and server.<br><br>echo 1 > /proc/sys/net/ipv4/tcp_timestamps</div><div>```<br></div><div><br></div><div>However this won't be applicable for us as our scenario is UDP.</div><div>  </div><div>  Please let me know if there are any inputs to handle this scenario in kea. Some options I can think of and need to explore:</div><div>1. Introduce delay in bringing up kea with some value greater than TIME_WAIT. However I need to explore on how to get value of TIME_WAIT </div><div>2. Explore tcp equivalent for UDP which if set in OS will ensure that this scenario will not happen</div><div><br></div><div><br></div><div>  Please let me know your inputs from kea perspective which can solve this problem.</div><div><br></div><div>Thanks and Regards,</div><div>Mayank</div><div><br></div><div><br></div></div>