[Kea-users] mixing raw and udp sockets
Peter Davies
peterd at isc.org
Thu Jun 19 10:27:25 UTC 2025
Hi Jaco,
The "raw" socket type is only applicable to kea-dhcp4. It is not
available
for kea-dhcp6.
"raw" socket support relies on Kea capturing Ethernet frames directly at
Layer 2
of the OSI model; tun0 is a layer three interface.
/Peter
On 19/06/2025 11.16, Jaco Kroon wrote:
> Hi Peter,
>
> Is there an explanation of why when binding to tun0/172.17.0.0 and
> using raw sockets the frame isn't received? Two specific notes for
> this which may be relevant.
>
> 1. tun0 isn't ethernet.
> 2. In this case there are external nodes connecting to the "local"
> node using tinc (not my choice) and then does a dhcp relay already.
>
> Is there a possibility of making it such that if the interface is
> ethernet then to use "raw" otherwise use "udp", even perhaps as
> special "dhcp-socket-type" of say "etherraw" or some other phrase that
> makes sense?
>
> Being the author of dhcpv6relay plugin in pppd, and having seen how
> tricky it can be to receive multicast traffic I get that raw sockets
> may be a "simple" solution, but is there honestly no way to set a udp
> socket to receive broadcast traffic? Even for 0.0 to
> 255.255.255.255? Description for SO_BROADCAST seems to relate more to
> sending rather than receiving, but frankly, it seems odd that raw
> sockets are required for receiving broadcast packets.
>
> Yes, DHCPv6 is multicast not broadcast, so I may well be missing the
> mark completely ...
>
> Kind regards,
> Jaco
>
> On 2025/06/19 10:47, Peter Davies wrote:
>
>> Hi Jaco,
>> I am afraid it is not possible to mix the "udp" and "raw" socket
>> types.
>>
>> The "interfaces-config"."interfaces" contain a list of interfaces
>> with an optional
>> IP address for Kea to listen to.
>>
>> The "interface-config"."dhcp-socket-type" option contains information
>> about the
>> socket type to use.
>>
>> Kea will not load a configuration containing multiple occurrences of
>> "interfaces-config".
>>
>> If you need to mix socket types, you will need to run multiple Kea
>> processes.
>>
>> Alternately, you could investigate the possibility of relaying the
>> local broadcast
>> traffic and using the "udp" socket type.
>>
>> /Peter
>>
>>
>> On 18/06/2025 15.26, Jaco Kroon wrote:
>>> Hi All,
>>>
>>> ISC dhcpd always refused to bind non-ethernet sockets. Which was
>>> fine, but resulted in some issues.
>>>
>>> I'm now in a situation where I've got a setup where I've got a
>>> couple of local interfaces (ethernet), which needs to bind raw, and
>>> then a tun0 interface which is not ethernet, and based on testing
>>> have to use udp sockets else kea-dhcp4 will not receive the incoming
>>> (relayed) DHCP frames.
>>>
>>> Is there any way to mix and match socket types within a single
>>> kea-dhcp4 instance?
>>>
>>> "interfaces": [ "tun0/172.17.0.0", "eth0", "eth1" ]
>>>
>>> Is the current setup, and eth* works when "dhcp-socket-type":"raw",
>>> and "tun0/..." when "dhcp-socket-type":"udp".
>>>
>>> Suggestions and ideas?
>>>
>>> Kind regards,
>>> Jaco
>>
--
Peter Davies
Support Engineer
Internet Systems Corporation
More information about the Kea-users
mailing list