Request a specific IP address from DHCP server from Windows?

One of my lab’s database servers lost its Internet connection over the weekend. Since our campus IT department’s policies on giving out static IP addresses are designed specifically to thwart me at every turn, this server gets a dynamic address from a not-under-my-control DHCP server, and it was assigned a different address. Not a terrible deal, but annoying. And while I was away for the weekend, another machine snagged our old IP address.

Fortunately, now it’s available again, and I’ve taken hold of it with a spare Ethernet card in one of our spare Linux boxes. Which brings me to the meat of my question…

In Linux, if I’m using dhclient to get an (IPv4) IP address, I can put a line in the dhclient.conf’s section for each particular ethernet interface that says:

send dhcp-requested-address xxx.xxx.xxx.xxx;

And most DHCP servers, in my experience, will honor the request and assign you that address if it’s available, and if it isn’t, they’ll just assign you a different one.

Is there a way to do this from a Windows client?

Windows does it automatically and if the address is still available the server will ACK. So in this case you wouldn’t have gotten it with dhclient either.

IT won’t give you a DHCP reservation?

Yes, file a ticket with your IT department asking for a DHCP reservation. Be sure to make things easy for them by specifying the MAC address of the NIC.

If you manually set an IP address, I think Windows will try to get that.

Yes, but is there a way to do it manually? The server has since acquired a different address than the old one. It was, obviously, unable to reserve its old address while it was down over the weekend, and someone else set up a new Netware server somewhere in the biology building over the same weekend, and thus snagged that IP address. Fortunately they didn’t need a static IP address since they weren’t going to run a nameserver off the machine, so they had no problem switching addresses, and I was able to re-reserve the old one with one of our spare Linux machines.

I’m telling you, it’s like they specifically designed their policies to screw me over. :wink:

Essentially, they require that only university-owned systems be assigned static IP addresses, and our lab director doesn’t want to give up ownership of the servers he brought with him from his old university.

Anyway, so IT compromised and gave us one static IP address, but we have four separate servers and eight separate NICs, and ideally they’d all be static.

So anyway, alas, Quartz, your suggestion won’t work. Or at least, it will require a diplomatic and political solution, and I was hoping for a technical solution.

Reply, that’s a good idea – I could try something like, say, manually setting the IP address on the LAN2 interface in the Windows Server 2008 machine, then release the DHCP lease on the Linux box and run an ipconfig /renew LAN2 on the WS2008 box. Maybe if I’m lucky it will request the IP address it’s been set to!

If I’m unlucky, it won’t let me do that if the IP address is set, or it will ignore the manual setting.

Thanks everybody.

How about a router, private local addresses, NAT, and port mapping for external access?

This idea will NOT work, sad to say. I’m not an uber-guru on this, merely a low-ranked guru, but I think you’re SOL, at least with built-in Windows commands up through Win7/Svr08R2.

Clearly the DHCP protocol allows for clients to request a specific lease they don’t already have. If I was stuck in your situation I’d be Googling for some 3rd party app / command line exe which does the equivalent of the Linux dhclient.

The Windows DHCP client will ask for the last address it had - if it’s available you’ll get it, if it’s taken you won’t. No different than asking for a constant IP with dhclient.

I was wrong about this. I thought this had worked for me in the past, but I just tried it and it indeed does NOT work. Thanks for the correction :slight_smile:

To have a chance of making this work, you need to clone the MAC address.

100% True.

But presently he has the “wrong” address issued by DHCP and needs to get back to the “right” one. He can probably persuade the current owner of the “right” address to release it, at least once or twice. But that doesn’t help him be the guy who gets the newly freed “right” address except by luck.