Sunday, November 20, 2022

Virtualbox - NatNetwork - 2 VMs - same IP!!!!!

 Dears,

When we setup VMs using virtualbox or vagrant, we tend to clone a virtual machine. It results in copying the MAC address too!

When MAC is same, even if you choose to use NatNetwork, you will see same ip address for your machines (more than 1), ideally this shouldnt be the case.

So your expected to see the ip as 10.0.2.15 in all the machines!!!

If you refresh the mac address (to generate a unique MAC) using virtualbox or in vagrant you assign a different mac for each machine, you wont face this issue.

Post fixing the issue... you will see something like below on each machine. In my case I had 2 VMs and they are...

Machine 1:

   Link-local IPv6 Address . . . . . : fe80::a912:eb77:1d9d:8b23%6(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.0.2.4(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Sunday, November 20, 2022 4:01:14 AM
   Lease Expires . . . . . . . . . . : Sunday, November 20, 2022 4:11:10 AM
   Default Gateway . . . . . . . . . : 10.0.2.1
   DHCP Server . . . . . . . . . . . : 10.0.2.3
   DHCPv6 IAID . . . . . . . . . . . : 101187623
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2B-0B-CF-45-08-00-27-18-F7-A7
   DNS Servers . . . . . . . . . . . : 192.168.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Machine 2:

   Link-local IPv6 Address . . . . . : fe80::bdcf:6576:eb04:41e%6(Preferred)
   IPv4 Address. . . . . . . . . . . : 10.0.2.5(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Lease Obtained. . . . . . . . . . : Sunday, November 20, 2022 4:11:11 AM
   Lease Expires . . . . . . . . . . : Sunday, November 20, 2022 4:21:11 AM
   Default Gateway . . . . . . . . . : 10.0.2.1
   DHCP Server . . . . . . . . . . . : 10.0.2.3
   DHCPv6 IAID . . . . . . . . . . . : 101187623
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2B-0C-42-2B-08-00-27-85-52-F1
   DNS Servers . . . . . . . . . . . : 192.168.0.1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Note that we have 2 IPv4 addresses now for 2 machines.

Thanks

No comments:

Post a Comment

Flashback data archive steps

 Objective: Ways to track DML changes in a table Detailed objective: We should be able to track the changes in the table at any point in tim...