Hello,
I'm using Linux and version 17.5.2, but I've also seen the following issue going back to version 15, possibly even earlier than that.
Within the Virtual Network Editor there is currently no option to change the VMnet host IP address when editing a Host-only or NAT type interface.
By 'VMnet host IP address' I mean the IP address that is configured on the vmnet1 or vmnet8 interface (using the default names as examples) that show on the Linux host that is running VMware Workstation. It seems that the first available IP of the subnet (whichever subnet was chosen in Virtual Network Editor), for example 172.16.0.1/24 or 192.168.1.129/25, is always automatically the one that is configured on these Host-only or NAT type interfaces (on the host side at least).
Presumably this is why the default Gateway IP of NAT type interfaces is always the second available IP in the subnet, for example 172.16.0.2/24 or 192.168.1.130/25. Because if you set the Gateway IP to the first available IP then you'll find the guest OS can no longer route to other networks (such as the Internet).
The trouble is that there is no warning on the graphical interface about not putting something on the first available IP with Host-only or NAT type interfaces. Perhaps the Virtual Network Editor has had more love with the Windows build of VMware Workstation and looks different? But I haven't noticed any changes with this interface on Linux in many years. This is particularly annoying for NAT type interfaces when the graphical interface actually allows you to set the Gateway IP to the first available IP, despite the fact it clashes with the VMnet host IP address.
With real networks, manufacturers of routers (and people in general) will often use the first or last available IP as the gateway IP (e.g. if 192.168.0.0/24 then this might be either 192.168.0.1 or 192.168.0.254), but overwhelmingly the first IP is the most popular. So if you're using a NAT type VMnet interface to simulate a real network, then using the first available IP as the Gateway IP causes problems without any warnings.
I did find a new option called 'hostIp' in the file '/etc/vmware/vmnet8/nat/nat.conf' with a comment that just says 'VMnet host IP address', and this option doesn't appear in the VMware documentation either. I haven't added this option in to the file myself, it's there by default on a fresh installation of VMware Workstation 17.5.2. However by setting this option to a different IP than the first available, and restarting vmnet-natd... it does not seem to reconfigure the VMnet interfaces to use a different IP address at all.
You can of course set the Gateway IP to the first available and then change the IP address on the VMnet interface manually...
sudo ip a d dev vmnet8 172.16.0.1/24
sudo ip a a dev vmnet8 172.16.0.254/24
Then you'll find things work normally... until you go back in to Virtual Network Editor which will would then trample on your configuration of the vmnet8 interface when it remakes it.
Can VMware please comment on this 'hostIp' option (or document it and actually make it work)... so that we know what this is meant to do and if it can solve this issue? (hopefully adding it to the graphical Virtual Network Editor too)
It would be nice if we didn't need two IP addresses at all when using a NAT type interface. It should be possible to rewrite the network stack so that the Gateway IP can be the same as the VMnet host IP address... and have things still work (and I have a vague memory that this used to work a long time ago... not sure which version).
Thanks
Steven