DeepuDeepuz
DeepuDeepuz

Reputation: 91

Assigning a static ip address to vm machine on esxi host in vcenter

I am new to vmware. I have installed vcenter in a server and also built a cluster. I am having 4 hosts in my cluster. I created vm's on each cluster. I am unable to assign a static ip to vm machine in hosts. How to assign a static ip to a vm machine??

Upvotes: 8

Views: 28202

Answers (2)

stackprotector
stackprotector

Reputation: 13442

In vSphere, you can customize guest IP addresses only during deployment of a VM from a template. If you have already existing VMs, you have to use the tools of the guest OSes to modify their network settings.

But that does not mean you have to access the guest OS directly. If VMware Tools are installed on the guest OS, you can instead use the PowerCLI cmdlet Invoke-VMScript to call guest OS tools that configure your network settings.

Example for Windows with netsh:

Invoke-VMScript -ScriptText 'C:\Windows\system32\netsh.exe interface ip set address "connection name" static 192.168.0.123 255.255.255.0 192.168.0.1 1' -VM MyVM -GuestCredential (Get-Credential)

Upvotes: 1

David
David

Reputation: 329

How do you assign Static IP address to A Physical Server ? same goes for a Virtual Server..

  • Open Network and Sharing Center
  • Click on Change Adapter Settings
  • Right Click on Adapter
  • Select Properties
  • open Internet Protocol Version 4 (TCP/IPv4) if using IPv4
  • Select the Radio Button "User the Following IP address"
  • Do the Same for the DNS if you want Select "Use the Following IP Address"

End Result Static IP within a VM

Upvotes: -6

Related Questions