I have an app based on PXEBoot.
I am trying to assign an IP address to an RNDIS device over USB.
Since the device doesn't have an IP address yet and doesn't even show up as a network device until after it is plugged in, I can't bind to anything to listen for DHCP requests.
So I bind my UdpClient to address 0.0.0.0. This allows me to get the DHCP request from the device using its MAC address.
I formulate the DHCP Offset packet and try to send it using the same UdpClient that received it, but nothing seems to be going out.
Currently I am sending on the 0.0.0.0 UdpClient that the request came in on and changing the port to 68 and the TO address to IPAddress.Broadcast, but as I said above it doesn't go out on the RNDIS at all. Probably because that interface doesn't have an IP address at all yet.
I suspect UdpClient doesn't know what interface to send it on. I have WireShark set up to watch all traffic and it is seeing the request, but not the offer I am sending.
Is there a way for me to send the offer using just the MAC address or some kind of broadcast?
I can manually assign the RNDIS a static IP address and then get other DHCP requests on that "ethernet" connection over USB, but I need to be able to plug in more than one of these devices at the same time and give each one their own IP address, so static won't work.
How do I send a DHCP Offer packet to the RNDIS interface when I get the request via UdpClient on 0.0.0.0?