Get accessible IP address from dhcp server

I have a C # desktop application.

I have an ip camera and I want to assign it a static ipaddress. I should be able to get a “free / accessible” IP address from my dhcp server, reserve it and assign it to my ip camera. I can assign an IP address for my camera quite easily. But how can I get an accessible IP address and reserve it before it is assigned to another device connected to the network?

I have seen api calls to get client ipaddresses, but I can’t see if I can use them for what I want.

I can ping each IP address on the subnet to find out if the address is available, but this seems inefficient as I will wait for a timeout from checking this address. Moreover, he did not “reserve” it.

I hope I explain this clearly?

NB. I want to assign a static IP address for my ip camera. I have sdk to do this. I just need to assign a free ip address that is on the same subnet

+4
source share
3 answers

IP- DHCP IP-. DHCP-, , IP-, IP- , , IP- .

MAC- IP- DHCP. , , IP-, MAC-, IP- DHCP, , IP-.

+2

IP- - . , ip- , ip.

+1

AFAIK, the DHCP request should come with the MAC address that you want to assign. If the camera does not support DHCP, you cannot request an address in its name.

The simplest task for you may be to introduce a bad NAT person between the user's computer and the camera: you send traffic from certain ports of the user computer to the camera and send responses from the camera to the person who asked about it.

+1
source

Source: https://habr.com/ru/post/1540582/


All Articles