2

I'm on Windows and created three Ubuntu 18.04 Desktop virtual machines using VMware Workstation. This is my NAT and custom host-only network configuration.

enter image description here

This is my guest VM's network adapters. As you can see, the three VMs each has a NAT adapter as well as a host-only adapter.

enter image description here

I've set static IPs for the host-only adapters and for the NAT adapter I use DHCP. The netplan configuration is:

horton@c1master1:~$ sudo cat /etc/netplan/01-network-manager-all.yaml
[sudo] password for horton:
network:
  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: yes
    ens38:
      dhcp4: no
      addresses: [192.168.0.100/24]
horton@c1master1:~$

The problem is that the DHCP always assign the same IP addresses. As you can see in below image, the network interface cards have different MAC addresses.

enter image description here

Why this happen and how can I fix this? I know I can use dhclient -r and dhclient to get a new IP address and I confirmed this really works. But every time I shut the VMs down and restart them, they always get the same IP address.

  • dhclient essentialy requests for a dynamic IP from the DHCP server, i think when the server boots the system does not request for the IP and running the dhclient grabs an available IP from the pool, i observed my VM is also doing the same. I added dhclient to run at every boot to overcome this. – Atul Feb 27 at 11:16

Your Answer

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

Browse other questions tagged or ask your own question.