Quick dhcp question:

XOR != OR

[H]F Junkie
Joined
Jun 17, 2003
Messages
11,547
It's my understanding that when a client requests an IP ( for the first time, DHCPDISCOVER ), it does so over the broadcast address ( 192.168.0.255 ).

Would this be accurate? I'm trying to write some firewall rules, remotely, that will allow the dhcpd requests through.

Thanks.
 
The client wouldn't use 192.168.0.255 as the dhcp server address since it has no idea of what network it is on until it receives information from the dhcp server. Here is a basic overview of dhcp. It says a client uses 0.0.0.0 as the source address and 255.255.255.255 as the destination.
 
jpmkm said:
The client wouldn't use 192.168.0.255 as the dhcp server address since it has no idea of what network it is on until it receives information from the dhcp server. Here is a basic overview of dhcp. It says a client uses 0.0.0.0 as the source address and 255.255.255.255 as the destination.
Ya, I got to thinking about that. How would it know which address to use?

I think it does use the broadcast in the last two stages of the handshake tho. More reading is required.

Thanks for the link, that should do it!
 
Well using shorewall with iptables you would just tell it which interfaces you want to allow dhcp traffic...or I think it's ports 67 and 68.
 
XOR != OR said:
It's my understanding that when a client requests an IP ( for the first time, DHCPDISCOVER ), it does so over the broadcast address ( 192.168.0.255 ).

Would this be accurate? I'm trying to write some firewall rules, remotely, that will allow the dhcpd requests through.

Thanks.

When you say remotely, how remotely are we talking? Whats the network(s) topology in relation to the firewall?

If there is a router involved then it may take more than a couple of firewall rules to get DHCP working correctly.
 
Nah, I meant I was remote at the time. This is going to be, from the perspective of the dhcpd server, the local network.
 
XOR != OR said:
Nah, I meant I was remote at the time. This is going to be, from the perspective of the dhcpd server, the local network.

Ah understood.... then in that case remember DORA

Discover - Client Broadcasts for any DHCP servers 255.255.255.255
Offer - DHCP server then offers and IP
Request - Client receives the IP and requests for that IP (again a broadcast to 255.255.255.255)
Acknowledge - DHCP Server broadcasts the acknowledgment which includes the assigned IP address and other relevant DHCP information

Clients will use 0.0.0.0 for source address until the DHCP process is completed.

Clients use port 67 and the server will use port 68 for communications.

HTH
 
Back
Top