Regarding dhcp server behavior (Simon Hobson)

Simon Hobson dhcp1 at thehobsons.co.uk
Tue Mar 26 13:06:47 UTC 2019


Shweta Jogi <Shweta.Jogi at Sophos.com> wrote:

> >  Can't see packets according to dhcpd logs, or can't see packets when using a packet sniffing tool (eg tcpdump or wireshark) ?
>  
> I am not able to see packets in dhcpd logs, and can see in tcpdump running on enp0s3. Also not able to see packet if tcpdump running on enp0s8.

That sounds correct. You'll see the packets entering on enp0s3 and they'll be handled internally - not appearing on interface enp0s8


> >  I suspect that in your case, you just need to change your relay invocation to send packets to 20.20.20.22 - the dhcp server will be listening on this interface and will see the packet.
>  
> If I configure 20.20.20.22 as Server IP address in relay, then things are working fine.
> If server is running on enp0s3 (20.20.20.22), and it receives packet with destination 30.30.30.30, it should serve that packet ?

As I explained earlier, dhcpd has to do non-standard network operations in order to work. If it were a normal network daemon then yes, it would work regardless of what which address you sent the packet to (subject to daemon config of course).
But with dhcpd, it has to handle packets differently, and I strongly suspect that if you tell it to bind only to enp0s3 then it will look only for dhcp packets addressed to 20.20.20.22 (or broadcast) and ignore packets sent to other IP addresses. This is beyond my knowledge of dhcpd's internals - but the answer is clearly to use the "correct" IP address in your relay agent config OR have the server listen on the other interface as well so the server looks for packets addressed to 30.30.30.30 as well as 20.20.20.22 (you'd need to test this as to whether it works).

> In my case it is serving the relay, and sending offer to the client, in this case server behavior is not predictable.

Actually it is predictable - just not what you were expecting without knowledge of the packet handling differences with the dhcp server.




More information about the dhcp-users mailing list