Re: Regarding dhcp server behavior (Simon Hobson)

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Regarding dhcp server behavior (Simon Hobson)

Shweta Jogi

Thanks Simon for your reply.

 

>  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.

 

>  You can change this by turning off a setting (something related to "use raw packets") and recompiling - then the server will just use the normal IP stack (but won't be able to handle local, ie not relayed, clients).

 

This solution is not feasible as server is also handling broadcast packets.

 

>  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 ?

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

 

Regards,

Shweta Jogi

 




Sophos Technologies Private Limited Regd. Office: Sophos House, Saigulshan Complex, Beside White House, Panchvati Cross Road, Ahmedabad - 380006, Gujarat, India CIN: U72200GJ2006PTC047857

Sophos Ltd, a company registered in England and Wales number 2096520, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: Regarding dhcp server behavior (Simon Hobson)

Simon Hobson
Shweta Jogi <[hidden email]> 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.


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Regarding dhcp server behavior (Simon Hobson)

Shweta Jogi
In reply to this post by Shweta Jogi

Thanks Simon for your explanation.

 

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

True, What I mean by not predictable is, if DHCP Server is running on enp0s3, it will process/serve all the local packets which comes on enp0s3.

 

 




Sophos Technologies Private Limited Regd. Office: Sophos House, Saigulshan Complex, Beside White House, Panchvati Cross Road, Ahmedabad - 380006, Gujarat, India CIN: U72200GJ2006PTC047857

Sophos Ltd, a company registered in England and Wales number 2096520, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users