VMware Cloud Community
gagbsh
Contributor
Contributor

Add Static route or Default Gateway without logging into VM

Hi,

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.

Or

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.

Please suggest.

Regards,

Gagan

Reply
0 Kudos
3 Replies
prasannag6
Enthusiast
Enthusiast

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.

----------If you found this or any other answer helpful, please consider to award points (use Correct or Helpful buttons). Regards, Prasanna----------
azler
Contributor
Contributor

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.

Rob

Reply
0 Kudos
gagbsh
Contributor
Contributor

Thanks for suggesting the Power CLI cmdlet.

Is there any equivalent api in VSphere web Service SDK.

I tried to find this out but haven't met with success as yet.

Regards,

Gagan

Reply
0 Kudos