This question might stem from a fundamental misunderstanding of IP multicast, so please correct me if I'm off base.
I'm trying to write C code to find the IP address of all the DHCP servers on the network. The use case is this:
The problem I'm having is telling the relay agent where the DHCP server(s) is(are). I found that multicast address 224.0.0.12 is reserved by IANA for DHCP servers, so I figured I'd just configure the servers to listen for that multicast traffic. But whenever I configure a linux socket option to IP_ADD_MEMBERSHIP to 224.0.0.12, it uses IGMP, which is an entirely separate protocol which I don't want to have to implement.
Am I just misunderstanding how multicast works? Shouldn't I be able to send a ping from the relay agent to 224.0.0.12 and have it return a ping response from all DHCP servers?
Additional Info:
ifconfig
ip route add 224.0.0.0/4 dev eth0
on all boxesPerhaps you should do what clients do - broadcast (not multicast!) on the target network with a DHCPDISCOVER packet? I have a couple of running, working DHCP servers and none of them are listening on the 224 network.
You'll probably also want to either request your existing address, or send along a DHCPRELEASE for any offers you get back, so as not to tie up addresses in fake reservations on the servers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With