I am relatively new to VMWare products and I am developing a software solution for a client that requires us to add either
1. Default Gateway to the Virtual Machines.
2. Static route to the Virtual Machines
The solution we need requires us to do this without logging in to the Virtual Machine.
A networking expert has suggested us to look into 3 possibilities:
1. Using some VMWare tool to achieve the above task
2. Writing directly to the Virtual Machine image file and editing it's Windows registry to add default gateway or static route
3. Use an Api/SDK to do the above.
Can this be done suing VMWare workstation tools or vSphere Web services SDK.
We can modify NIC settings using Set-VMGuestNetworkInterface PowerCLI cmdlet, but it still requires Guest credentials (i.e. logging is required). This is like running any guest based tool to configure routing. That is indeed desirable, to prevent host side hacking of a Guest VM. Will continue to look for more options.
Option 2 should work. Like running post install scripts after the OS is installed and Network is configured.
Could you not use DHCP & DHCP reservations with the VM clients? (The MAC address is on listed on the NIC properties on ESX.)
Alternative you could use a login script to configure these settings when you deploy the windows VM.
Hope this helps.