VMware Cloud Community
AlbertWT
Virtuoso
Virtuoso

Clone vNIC1 IP address setting to vNIC2 and then remove vNIC1 ?

People,

Not sure if this is achievable using Powershell on Windows Server core 2016 and 2019 guest OS, to achieve the below task:

1. Strip out the IP address, Subnet Mask, Default Gateway and both DNS servers setting on old vNIC1. Preferably if there is uninstall or remove the vNIC1 that'd be great.

IP address: 192.168.200.135
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.254
DNS Server: 10.1.1.1 and 10.2.2.2


2. Reconfigure the same IP address, Subnet Mask, Default Gateway and both DNS servers setting on new vNIC2.

Thank you in advance.

/* Please feel free to provide any comments or input you may have. */
0 Kudos
4 Replies
LucD
Leadership
Leadership

Can you use Invoke-VMScript?
In other words, are VMware Tools installed?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

AlbertWT
Virtuoso
Virtuoso

Hi @LucD, yes it is installed with VMware tools.
/* Please feel free to provide any comments or input you may have. */
0 Kudos
LucD
Leadership
Leadership

Then you should be able to use Invoke-VMScript, and with the Get-NetIPAddress, Remove-NetIPAddress, and Set-NetIPAddress cmdlets you can move the IP settings from 1 NIC to another NIC.

Once done and the Invoke-VMScript returns, you can use the Remove-NetworkAdapter cmdlet to remove the original NIC.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
AlbertWT
Virtuoso
Virtuoso

Hi @LucD,

Yes, all of the VMs are windows with various VMware tools versions ranging from 9.5 to v11.

Those VMs are still wrongly configured with 1x vNIC with e1000e, so if I wanted to perform the changes to update those VMs with 1x vNIC VMXNet3 while maintaining the same IP settings, which script should I use?

/* Please feel free to provide any comments or input you may have. */
0 Kudos