Host is Win 7, VBox 5.0
I have been using host-only networking with several Oracle Linux guests.
The VBox built-in DHCP server is used to allocate IP addresses in the 192.168.56.* range. Everything works great.
Then, I turned off the VBox DHCP server for host-only networking to see what would happen.
I expected some error messages, as the DHCP server would not be allocating addresses this time.
No change, the guests have the same IP address.
Question: Is there a leasing period for host-only addresses allocated by VirtualBox's internal DHCP server?
Host-only DHCP: is there a leasing period?
-
Perryg
- Site Moderator
- Posts: 34369
- Joined: 6. Sep 2008, 22:55
- Primary OS: Linux other
- VBox Version: OSE self-compiled
- Guest OSses: *NIX
Re: Host-only DHCP: is there a leasing period?
Almost all leases have a TTL ( time to live ) so yes. I do not know however the length assigned to the VBox lease.
Re: Host-only DHCP: is there a leasing period?
In the .VirtualBox directory of my home Windows directory, there is a file called NatNetwork.leases.
This contains settings such as:
<Time issued="3516695" expiration="1200"/>
I expected to find a similar file for Host-Only DHCP leases. But I can't find one.
If the lease expiration for Host-Only is a long time, it is impossible to experiment with static Host-Only addresses.
There must be a cache held somewhere. And there must be a way to flush the cache.
This contains settings such as:
<Time issued="3516695" expiration="1200"/>
I expected to find a similar file for Host-Only DHCP leases. But I can't find one.
If the lease expiration for Host-Only is a long time, it is impossible to experiment with static Host-Only addresses.
There must be a cache held somewhere. And there must be a way to flush the cache.
-
Martin
- Volunteer
- Posts: 2562
- Joined: 30. May 2007, 18:05
- Primary OS: Fedora other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: XP, Win7, Win10, Linux, OS/2
Re: Host-only DHCP: is there a leasing period?
Why don't you check the dhcp client log in your guest?
Also you should check the Oracle Linux documentation about the behaviour of the dhcp client when the dhcp server doesn't answer the renew requests.
Also you should check the Oracle Linux documentation about the behaviour of the dhcp client when the dhcp server doesn't answer the renew requests.
Re: Host-only DHCP: is there a leasing period?
Good idea. I was looking for a file on the Windows host.
It looks like the Linux guests drop their DHCP lease after 3 hours.
There is a file: /usr/lib/dhcpd/dhcpd.leases.
And sure enough, I start up one of the guests after getting home from work. The network interface does not start, indicating that it is no longer getting an IP address from a DHCP server.
Thanks for all who replied on this.
It looks like the Linux guests drop their DHCP lease after 3 hours.
There is a file: /usr/lib/dhcpd/dhcpd.leases.
And sure enough, I start up one of the guests after getting home from work. The network interface does not start, indicating that it is no longer getting an IP address from a DHCP server.
Thanks for all who replied on this.