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.
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.
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.
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.