{"id":3646,"date":"2025-01-29T22:24:11","date_gmt":"2025-01-29T20:24:11","guid":{"rendered":"https:\/\/vpxd.dc5.cz\/?p=3646"},"modified":"2025-01-29T22:24:11","modified_gmt":"2025-01-29T20:24:11","slug":"how-to-change-vmnic-name-on-an-esxi-host-via-command-line","status":"publish","type":"post","link":"https:\/\/vpxd.dc5.cz\/index.php\/2025\/01\/29\/how-to-change-vmnic-name-on-an-esxi-host-via-command-line\/","title":{"rendered":"How to Change vmnic Name on an ESXi Host via Command Line"},"content":{"rendered":"\n<p>Renaming or reordering vmnics on an ESXi host can be useful in various scenarios, such as standardizing network configurations or aligning network interface names across multiple hosts. This guide will show you how to achieve this using the ESXi command line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Listing Current vmnic Aliases<\/h2>\n\n\n\n<p>Before making changes, it is essential to check the current vmnic assignments. You can do this with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">localcli --plugin-dir \/usr\/lib\/vmware\/esxcli\/int\/ deviceInternal alias list\n<\/pre>\n\n\n\n<p>This command will return a list of all existing vmnic aliases and their corresponding bus addresses.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Bus type  Bus address          Alias\n--------  -------------------  -----\npci       m01000300            vmhba0\npci       m01000b00            vmnic0\npci       p0000:00:07.1        vmhba1\npci       m02001300            vmnic1\nlogical   pci#m01000300#0      vmhba0\nlogical   pci#p0000:00:07.1#0  vmhba1\nlogical   pci#p0000:00:07.1#1  vmhba64\nlogical   pci#m02001300#0      vmnic1\nlogical   pci#m01000b00#0      vmnic0\n<\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>When a nic is controlled by a native driver, then there are actually two aliases associated with the device: a pci alias for the pci device and a logical alias for the uplink logical device.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">[root@fs-vsan-05:~] localcli --plugin-dir \/usr\/lib\/vmware\/esxcli\/int deviceInternal alias list | grep vmnic1<br><br>pci       m02001300            vmnic1<br>logical   pci#m02001300#0      vmnic1<\/pre>\n\n\n\n<p>When the logical alias is present, then both the pci alias and logical alias need to be renamed !<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Changing a vmnic Name<\/h2>\n\n\n\n<p><strong>Make sure you have console access before starting the upcoming steps.<\/strong><\/p>\n\n\n\n<p>To change the name of a specific vmnic, use the following commands. Replace <code>vmnic5<\/code> with the desired new alias and update the <code>bus-address<\/code> accordingly.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">localcli --plugin-dir \/usr\/lib\/vmware\/esxcli\/int deviceInternal alias store --bus-type pci --alias vmnic5 --bus-address m02001300<br><br>localcli --plugin-dir \/usr\/lib\/vmware\/esxcli\/int deviceInternal alias store --bus-type logical --alias vmnic5 --bus-address pci#m02001300#0<\/pre>\n\n\n\n<p>Once the commands have been executed, you need to reboot the ESXi host for the changes to take effect.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">reboot<\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"324\" src=\"https:\/\/vpxd.dc5.cz\/wp-content\/uploads\/2025\/01\/SCR-20250129-sleh.png\" alt=\"\" class=\"wp-image-3647\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Having Some Fun with vmnic Naming<\/h2>\n\n\n\n<p>If you want to experiment and see how ESXi handles long vmnic names, you can try something fun like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">localcli --plugin-dir \/usr\/lib\/vmware\/esxcli\/int deviceInternal alias store --bus-type pci --alias vmnic1234567890 --bus-address m02001300<br><br>localcli --plugin-dir \/usr\/lib\/vmware\/esxcli\/int deviceInternal alias store --bus-type logical --alias vmnic1234567890 --bus-address pci#m02001300#0<br><br>reboot<\/pre>\n\n\n\n<p>While ESXi generally follows a strict naming convention, pushing its limits can be an interesting experiment!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"848\" height=\"169\" src=\"https:\/\/vpxd.dc5.cz\/wp-content\/uploads\/2025\/01\/SCR-20250129-snmh.png\" alt=\"\" class=\"wp-image-3649\" srcset=\"https:\/\/vpxd.dc5.cz\/wp-content\/uploads\/2025\/01\/SCR-20250129-snmh.png 848w, https:\/\/vpxd.dc5.cz\/wp-content\/uploads\/2025\/01\/SCR-20250129-snmh-800x159.png 800w, https:\/\/vpxd.dc5.cz\/wp-content\/uploads\/2025\/01\/SCR-20250129-snmh-768x153.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Renaming vmnics in ESXi via the command line is a straightforward process that requires just a few commands and a reboot. Whether you&#8217;re restructuring network configurations or just having a bit of fun, these steps will help you modify your ESXi network interfaces with ease.<\/p>\n\n\n\n<p>Related KB: <a href=\"https:\/\/knowledge.broadcom.com\/external\/article\/324534\/\">https:\/\/knowledge.broadcom.com\/external\/article\/324534\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Renaming or reordering vmnics on an ESXi host can be useful in various scenarios, such as standardizing network configurations or aligning network interface names across multiple hosts. This guide will show you how to achieve this using the ESXi command line. Listing Current vmnic Aliases Before making changes, it is essential to check the current &hellip; <a href=\"https:\/\/vpxd.dc5.cz\/index.php\/2025\/01\/29\/how-to-change-vmnic-name-on-an-esxi-host-via-command-line\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Change vmnic Name on an ESXi Host via Command Line&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3649,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,39,8],"tags":[12,13,20],"class_list":["post-3646","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","category-esxi","category-vmware","tag-esxcli","tag-esxi","tag-vmware"],"_links":{"self":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts\/3646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/comments?post=3646"}],"version-history":[{"count":1,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts\/3646\/revisions"}],"predecessor-version":[{"id":3650,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/posts\/3646\/revisions\/3650"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/media\/3649"}],"wp:attachment":[{"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/media?parent=3646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/categories?post=3646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpxd.dc5.cz\/index.php\/wp-json\/wp\/v2\/tags?post=3646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}