{"id":4166,"date":"2021-09-29T12:30:54","date_gmt":"2021-09-29T17:30:54","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4166"},"modified":"2021-09-29T16:59:10","modified_gmt":"2021-09-29T21:59:10","slug":"change-ip-address-for-vmware-esxi-host-from-command-line","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/change-ip-address-for-vmware-esxi-host-from-command-line\/","title":{"rendered":"Change IP Address for VMware ESXI Host from Command Line"},"content":{"rendered":"\n<p>We can use the the built in esxcli command to change the IP address for a server<\/p>\n\n\n\n<p>First we need to get the interface name.  We can get the info with the following command.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">esxcli network ip interface ipv4 get<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Name &nbsp;IPv4 Address &nbsp;&nbsp;IPv4 Netmas&nbsp;&nbsp;&nbsp;IPv4 Broadcast &nbsp;Address Type &nbsp;DHCP DNS \n---- &nbsp;------------ &nbsp;------------- &nbsp;-------------- &nbsp;------------ &nbsp;-------- \n<strong>vmk0<\/strong> &nbsp;192.168.0.4  &nbsp;255.255.255.0 &nbsp;192.168.0.0 &nbsp;&nbsp;  STATIC &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;false<\/code><\/pre>\n\n\n\n<p>The text in bold is our interface name.<\/p>\n\n\n\n<p><strong>Set the interface to pull DHCP<\/strong><\/p>\n\n\n\n<p>The following command will set the interface to use DHCP.  If your interface name is different, then you will want to change that.<\/p>\n\n\n\n<pre id=\"block-7f3559f7-0a4d-47b8-a7fb-7a1b6b10f0d6\" class=\"wp-block-preformatted\">esxcli network ip interface ipv4 set -i vmk0 -t dhcp<\/pre>\n\n\n\n<p><strong>Set a static IP<\/strong><\/p>\n\n\n\n<p>We can set a static IP address with the following command.  Change the IP and Subnet for the appropriate IP address and Subnet.  <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">esxcli network ip interface ipv4 set -i -I IP -N Subnet vmk0 -t static<\/pre>\n\n\n\n<p>Changes take affect immediately so you&#8217;ll need to re ssh into the server.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><a href=\"http:\/\/virtuallystable.com\/2019\/08\/14\/how-to-change-the-ip-address-of-an-esxi-host-via-esx-cli\/\">http:\/\/virtuallystable.com\/2019\/08\/14\/how-to-change-the-ip-address-of-an-esxi-host-via-esx-cli\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can use the the built in esxcli command to change the IP address for a server First we need to get the interface name. We can get the info with the following command. esxcli network ip interface ipv4 get &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/change-ip-address-for-vmware-esxi-host-from-command-line\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[376],"tags":[744,378,619,693,42,377],"class_list":["post-4166","post","type-post","status-publish","format-standard","hentry","category-vmware","tag-dhcp","tag-esxi","tag-ip","tag-static","tag-virtualization-2","tag-vmware"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4166"}],"version-history":[{"count":4,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4166\/revisions"}],"predecessor-version":[{"id":4171,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4166\/revisions\/4171"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}