JonasAlfredsson / docker-kea

The ISC Kea DHCP server, Control Agent and DDNS running inside individual Docker containers.
https://hub.docker.com/search?q=jonasal%2Fkea
Mozilla Public License 2.0
82 stars 15 forks source link

DHCP4_PACKET_SEND_FAIL in UDP mode (Permission denied) #6

Closed jeffgoh closed 3 months ago

jeffgoh commented 1 year ago

First off, let me say how lovely this is - thanks to the @isc-projects Kea team for modernizing dhcpd and to @JonasAlfredsson for putting this together. I'm running the container using podman on fedora (root, not rootless). Works fine in raw mode, but udp mode gives me these strange permission denied errors (I do still get the advertisement after the two errors). I'm not actually sure if this is a docker problem vs upstream - will have to try native on host somewhere to determine - but thought I would flag it here regardless.

2022-08-20 02:08:55.000 INFO  [entrypoint] Starting Kea dhcp4 container
2022-12-20 02:08:55.975 INFO  [kea-dhcp4.dhcp4/1.139949311606656] DHCP4_STARTING Kea DHCPv4 server version 2.2.0 (stable) starting
2022-12-20 02:08:55.976 INFO  [kea-dhcp4.hosts/1.139949311606656] HOSTS_BACKENDS_REGISTERED the following host backend types are available: mysql postgresql 
2022-12-20 02:08:55.977 INFO  [kea-dhcp4.dhcpsrv/1.139949311606656] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type udp
2022-12-20 02:08:55.977 INFO  [kea-dhcp4.dhcpsrv/1.139949311606656] DHCPSRV_CFGMGR_ADD_IFACE listening on interface ens2f0
2022-12-20 02:08:55.977 INFO  [kea-dhcp4.dhcpsrv/1.139949311606656] DHCPSRV_CFGMGR_NEW_SUBNET4 a new subnet has been added to configuration: 172.16.12.0/24 with params: t1=1000, t2=2000, valid-lifetime=4000
2022-12-20 02:08:55.977 INFO  [kea-dhcp4.dhcp4/1.139949311606656] DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: added IPv4 subnets: 1; DDNS: disabled
2022-12-20 02:08:55.977 INFO  [kea-dhcp4.dhcpsrv/1.139949311606656] DHCPSRV_MEMFILE_DB opening memory file lease database: type=memfile universe=4
2022-12-20 02:08:55.977 INFO  [kea-dhcp4.dhcpsrv/1.139949311606656] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /usr/local/var/lib/kea/kea-leases4.csv
2022-12-20 02:08:55.977 INFO  [kea-dhcp4.dhcpsrv/1.139949311606656] DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3600 sec
2022-12-20 02:08:55.978 WARN  [kea-dhcp4.dhcp4/1.139949311606656] DHCP4_MULTI_THREADING_INFO enabled: no, number of threads: 0, queue size: 0
2022-12-20 02:08:55.978 INFO  [kea-dhcp4.dhcp4/1.139949311606656] DHCP4_STARTED Kea DHCPv4 server version 2.2.0 started
2022-12-20 02:08:59.705 ERROR [kea-dhcp4.packets/1.139949311606656] DHCP4_PACKET_SEND_FAIL [hwtype=1 00:0e:35:d4:d8:51], cid=[no info], tid=0x1234567: failed to send DHCPv4 packet: pkt4 send failed: sendmsg() returned  with an error: Permission denied
2022-12-20 02:08:59.805 ERROR [kea-dhcp4.packets/1.139949311606656] DHCP4_PACKET_SEND_FAIL [hwtype=1 00:0e:35:d4:d8:51], cid=[no info], tid=0x1234567: failed to send DHCPv4 packet: pkt4 send failed: sendmsg() returned  with an error: Permission denied
2022-12-20 02:08:59.920 INFO  [kea-dhcp4.leases/1.139949311606656] DHCP4_LEASE_ADVERT [hwtype=1 3c:ec:ef:a8:02:a2], cid=[no info], tid=0x3c8fc271: lease 172.16.12.200 will be advertised
JonasAlfredsson commented 1 year ago

Hi jeffgoh,

Thanks for the kind words, it makes me glad you have found it useful :)

I am gonna be honest and say that I have not that much experience with Kea yet and have not run into this error. However, could you perhaps post your configuration and the "docker run" (or podman equivalent) command you used for us to perhaps see something wonky there?

JonasAlfredsson commented 1 year ago

Also: https://github.com/isc-projects/kea/blob/master/src/bin/dhcp4/dhcp4_messages.mes#L761

JonasAlfredsson commented 1 year ago

Are there any updates to this issue?