2

I re-framed my question for better clarity

Automatic allocation(not Dynamic Allocation) on Windows DHCP server

Is there a way to configure dhcp server to give same ip address to NIC cards. i am not asking for static IP. i am fine with any ip being allocated to any NIC but once it is assigned it should assign same ip all the time.

i am looking for a solution where i would not have to add an entry every time i attach a new machine to the subnet. is there a configuration which would make dhcp server remember what ip address was allocated to the NIC for the first time and automatically reserve that IP address for all the times.

Why i need this?

I need to get IP address associated with the MAC address, which i already know. Now one way of doing it is send a broacast ping to the LAN, and then from the ARP table fetch the ip address. however between the time i send a broadcast ping, and read the ARP entry there is a possibility of some machine restarting and getting assigned new IP address.

My objective is to keep everything dynamic with no user intervention, and also robust to prevent swapping of ip addresses.

4
  • Most DHCP servers will do this by default. Are you using a Windows Server for DHCP? Commented Feb 6, 2010 at 1:48
  • 1
    I don't think the Windows one does, I think it prefers the lowest (or highest, but I think it is lowest) currently unassigned pool IP for the pending lease. Commented Feb 6, 2010 at 5:17
  • I'm more interested in why you need to do this. I suspect that if there is an underlying reason why which could be worked around or circumvented entirely, it may be a more viable approach. Commented Feb 6, 2010 at 21:48
  • i answered your question, in the edit Commented Feb 8, 2010 at 18:32

3 Answers 3

4

Perhaps the best way to achieve the results you want is to set a very long lease time on the DHCP leases.

5

Sure - what you want is called a DHCP reservation. The mechanics of creating the reservation differs depending on what DHCP server you're running. In any case, you will need to give the DHCP server the MAC address of the target network card and then tell it what IP address you want it to hand out to that device.

2
  • yeah i am aware of that, but i am looking for a solution where i would not have to add an entry every time i attach a new machine to the subnet. is there a configuration which would make dhcp server remember what ip address was allocated to the NIC for the first time and automatically reserve that IP address for all the times. Commented Feb 6, 2010 at 1:54
  • 3
    You could probably script something with powershell to monitor for new leases and then create a reservation for it. Short of that, though, about the best you can do is just set a really long lease time for your scope. Commented Feb 6, 2010 at 1:58
1

Depends on the DHCP server.

The ISC dhcpd server (which comes with most Linux distributions) seems to keep track of what MACs have been assigned what IPs, and only scavenges from previously-but-not-currently-assigned when there's no other choice.

I don't believe the Microsoft-provided DHCP server does that, you end up having to do reservations or have ridiculously long lease times and risk running out of available addresses.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.