Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am working in a serviced office, where I do not control the DHCP server.

I have more than 3 machines that I need to have the same IP address after they get assigned. How would it be possible for me to "reserve" a few IP address to my own machines?

Let's suppose I boot up VM A and it sends out a DHCP REQ. I get IP abcd assigned to it.

Now I boot up VM B and it receives IP efgh. After I shut these VMs down (longer than the DHCP refresh interval, eg, several weeks), and restart them, in the normal/usual case, they get assigned different IP addresses.

I need "fixed" DHCP IP addresses due to the nature of my applications. In other words, assuming VM A is assigned IP abcd, and VM B, IP efgh. After they're shut down, their IP addresses goes away (assuming the VMs are not restarted within the DHCP refresh interval). What I'm looking for is a DHCP client application that can send out DHCP REQ for VM A with VM A's MAC address, and DHCP REQ for VM B with VM B's Mac address, on my other machine's that are up and running.

Is there any DHCP client program (on Mac OS X, or Windows) that can reserve/renew addresses on behalf of my (shutdown) VMs (on my other up and running machines)?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

Is there any DHCP client program (on Mac OS X, or Windows) that can reserve addresses?

No, because what the DHCP client does is ask for values. It can ask "can I have this IP, pretty please?", but there is no way for a DHCP client to guarantee that you will get a specific IP.

For a fixed IP you either need to:

  • Reserve an IP on the DHCP server (based on the MAC). You stated this is not an option for you.
  • Or set a static IP.

Note that you can use multiple IPs on a single host. Either with multiple network cards or by assigning multiple IPs to the same NIC. How you do that depends on your OS.

Here is a post describing how to assign multiple IP to a single NIC in windows XP and a workaround to do the same for windows 7.

Two more notes:

  1. Not sure how to do that on OS X. Possibly a simple ifconfig en0 alias some_ip netmask and a route add .... will do. But I have no OS X machine to test with.
  2. If you set manual IPs then make sure nothing else uses them. Since you do not control the DHCP server select a different IP range. E.g. if the DHCP server hands out IP in the range 192.168.1.0/24 then use 192.168.2.0/24, or 172.16.0.0/12. (Anything from RFC1918 is fine as long as it is not already in use.)
share|improve this answer
    
Not enough rep to make a "trivial" edit, but that's 192.168.2.0/24 towards the end (not 1992). –  Michael Kjörling Apr 22 '13 at 13:07
    
Fixed the obvious typo. Thanks for noticing. –  Hennes Apr 22 '13 at 13:14

You can just hyper renew the addresses on each system with a rudimentary shell script of varying styles such as this example which renews every minute after stopping the beep driver the necessity will be obvious if trying the instructions with beep enabled

net stop beep
:do
ipconfig /renew
wait 60
got :do

Another method, but requires testing on your part, and assumes the included systems are connected to the same switch or vLAN, usually you can get away with assigning IP addresses from an entirely different address scheme with the understanding the systems won't communicate with the rest of the network but may broadcast to each other while connected to the same physical switch or vLAN configured to forward broadcasts., so in your case, and if the systems are physically connected, assign them a different Class-B or Class-A scheme or an additional Class-B / Class-A if your particular OS version allows it.

share|improve this answer

Some DHCP server software actually check if an IP is in use on the network (with a ping/arp check) before assigning it so you might get away with setting a static IP. Doesn't make you a good "netizen" but you'll probably notice pretty quickly if you're causing a problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.