I just created my first pentesting lab (VirtualBox setup using metasploitable2/ kali linux etc) and I have set the network to be 'host-only'.

I'm sure I've noticed that my local IP's have been changing slightly - just the last few digits so at first my vulnerable testing box was but on the next boot is was .101 - that all ok and normal? I guess that the answer is yes because of DHCP - i.e. Dynamic Host Configuration Protocol

  • tcpipguide.com/free/… It depends on the configuration of the DHCP server – Farhan.K Aug 26 '16 at 12:53
  • Questions about basic DHCP behavior are not directly related to IT Security. – 700 Software Aug 26 '16 at 13:33

Does DHCP change IP addresses with each boot?

(This does not appear to be a security question).

No, maybe, sometimes.

It depends on the implementation of the DHCP server, its configuration and the usage. Not the protocol itself.

Usually, a DHCP server maintains a set of IP addresses which it will lend out to clients on request. When it lends out an address, it will set a time limit after which the client must renew. As long as the client renews within the time limit they will receive the same address (because it's already assigned to them). If the previous lease has expired when a client asks for an IP address then the next address allocated by the server is dependent on the method chosen the server implementation/policy. It may allocate the first available address from its pool. It may use a round robin cursor on the available ip address list.

The virtualbox DHCP server is relatively crude - AFAIK it does not allow for static mappings nor configuration of lease times. If you want consistent adresses then you'll need to configure a dedicated DHCP server or use static IP addresses.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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