Regarding dhcp server behavior

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

Regarding dhcp server behavior

Shweta Jogi

Hi All,

 

I am facing some problem while trying DHCP server.  Following are the details.

 

Topology :

 

Config file :

subnet 20.20.20.0 netmask 255.255.255.0 {

        range 20.20.20.100 20.20.20.200;

}

subnet 10.10.10.0 netmask 255.255.255.0 {

        range 10.10.10.100 10.10.10.200;

}

 

subnet 30.30.30.0 netmask 255.255.255.0 {

}

 

Command to start server :

sudo dhcpd -d enp0s8

Command to start Relay :

sudo dhcrelay -d -i enp0s3 -i enp0s8 30.30.30.30

 

So my server is running on enp0s8, but I am not able to see any packets coming to DHCP Server.

 

If I change my DHCPD Command with following, things started working properly.

sudo dhcpd -d enp0s8 enp0s3

               ‘or’

sudo dhcpd -d enp0s3

 

What can be the reason behind such behavior?

 

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

Eugene Grosbein
23.03.2019 16:41, Shweta Jogi wrote:

> What can be the reason behind such behavior?

When DHCP relay forwards original broadcast of DHCP client to DHCP server,
it modifies the request makeing it unicase and relay additionally inserts
one of its own IP addresses into the request with special DHCP attribute.

DHCP server processes request only if that IP of relay is "known" to the server,
e.g. the IP belongs to one of networks that the server must serve.
So, DHCP server will not process requests from arbitrary DHCP relay.

Just include network containing that IP of the relay to configuration of DHCP server:

subnet X.X.X.X netmask Y.Y.Y.Y {}

Then server needs not "listen" for broadcasts on extra interfaces.

This way you can even run DHCP server not listening on any interfaces at all,
if all requests go through relays only.

_______________________________________________
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
In reply to this post by Shweta Jogi
Shweta Jogi <[hidden email]> wrote:

> Command to start Relay :
> sudo dhcrelay -d -i enp0s3 -i enp0s8 30.30.30.30
>  
> So my server is running on enp0s8, but I am not able to see any packets coming to DHCP Server.

Can't see packets according to dhcpd logs, or can't see packets when using a packet sniffing tool (eg tcpdump or wireshark) ?

By default, the dhcp server uses raw packets because it needs to handle broadcast traffic from clients on local networks. For this reason, packet handling is a bit different from most network connected programs - and I suspect it's just ignoring packets sent to 30.30.30.30 or just not seeing them at all. 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).

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.

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