The guest will not release the lease as it does not know it is being moved. I assume that any DHCP will realise that the IP address should match the subnet on which they are connected, automatically.

I think there is a single DHCP process as part of VBox, but I do not know.

Disconnect/connect (ie disable/enable) of the adapter may work so I will test.

Regards

Malcolm


On 19/10/2017 14:41, Kees Nuyt wrote:
On Thu, 19 Oct 2017 11:33:42 +0100, you wrote:

We have met a problem when we move VM from one subnet to a different
subnet, and the DHCP remembers the previous lease and continues to
provide the same IP address to the VM, even though it is now on a
different subnet.

We have a simple set up where we define two NatNetworks with separate IP
address (10.0.2.0/24 and 10.0.3.0/24) we study behaviour of a router
between these networks. We place an Ubuntu guest on each subnet.

If we place a guest on the first network it is allocated IP address (eg)
10.0.2.4. If we then move it to the second network it continues to
receive an IP address from DHCP of 10.0.2.4, and so cannot function on
the second network.
Does the guest release the lease before it is moved?

I agree networks should have independent DHCP leases.
Did you define a separate dhcpserver for each netowrk?

The workaround is to delete the lease file when VB is not running. We
would prefer the DHCP to properly recognise the subnet of a device and
allocate IP address accordingly.
Another workaround might be to change the MAC address of the
guest when it moves to the other subnet. You could even spoof
the MAC from within the guest, if the OS allows that.

Or perhaps define as many network interfaces in the guest as you
have networks, and disconnect/connect to move it to another
network. Not easy thoughm, and pretty ugly.


--

*Malcolm Clarke *BSc (Hons), PhD

Reader in Telemedicine and Data Communication Systems

T+44 (0) 1895 265053

*Brunel University London*

College of Engineering, Design and Physical Sciences

Department of Computer Science

WBB212, Wilfred Brown Building, Kingston Lane, Uxbridge, Middlesex, UB8 3PH

*www.brunel.ac.uk <http://www.brunel.ac.uk/>*

Connect with the university on*Linkedin, Twitter, Facebook*

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
VBox-users-community mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vbox-users-community
_______________________________________________
Unsubscribe:  
mailto:[email protected]?subject=unsubscribe

Reply via email to