Fixing Renumbered vmnics

Posted by : on

Category : esx   vmnic   commandline   vmware


I’ve been in a situation where I’ve installed a new NIC and it renumbered the vmnics within an ESX host. The reason this became an issue was that the Service Console vmnic was one of the vmnics that was affected. Thus I lost my access to the ESX host. Thankfully, I could just drive over to the Datacenter and fix it via the commandline. It was just inconvenient to do so. A quick google for instructions and I was off.

So apparently there are multiple ways to fix this. For me, Method 1 got me up and running within a few minutes with little to no fuss.

Method 1 – Editing the esx.conf file • Login to the Service Console • Check your existing NIC numbering by typing ‘esxcfg-nics –l’ • Type ‘cd /etc/vmware’ to change to the correct directory • Type ‘cp esx.conf esx.con.bak’ to make a backup of this file as it is a critical configuration file for ESX • Type ‘nano esx.conf’ to open the file for editing • Type CTRL-W and then enter ‘vmnic2’ to search for the new first NIC • Change ‘vmnic2’ to ‘vmnic0’ • Change the subsequent NIC’s from ‘vmnic3’ to ‘vmnic1’, ‘vmnic4’ to ‘vmnic2’ and ‘vmnic5’ to ‘vmnic3’ • Type CTRL-O to save the file • Type CTRL-X to exit the Nano editor • Type esxcfg-boot -b to rebuild the config files • Shutdown and restart the ESX server, when the server comes back up the NIC’s will be numbered vmnic0 – vmnic3, verify this by typing ‘esxcfg-nics –l

Method 2 – Modify your vswitch configuration • Login to the Service Console • Check your existing NIC numbering by typing ‘esxcfg-nics –l’ • Check your current vswitch configuration by typing ‘esxcfg-vswitch –l’ , note which NIC’s are assigned to which vswitches (uplink column) • Remove the old NIC’s that have been renamed by typing ‘esxcfg-vswitch –U vmnic# vswitch_name’, ie. esxcfg-vswitch –U vmnic0 vSwitch1 • Add the new NIC’s with the correct names by typing ‘esxcfg-vswitch –L vmnic# vswitch_name’, ie. esxcfg-vswitch –L vmnic2 vSwitch1 • Repeat this process for any additional NIC’s. Once you have the vswitch that contains the Service Console corrected you can also log in via the VI Client and correct the other vswitches that way • Your newly renamed NIC’s should now be assigned to the original vswitches and your networking should now work again

This information was found within the VMware Knowledge Base. (Awesome!) How To Configure Networking from the Service Console Command Line VI Client loses connectivity to the ESX Server Host after you add a new network adapter


About Sam Aaron
Sam Aaron

Father, Husband, Geek. Workaholic.

Email : mail@micronauts.us

Website : http://micronauts.us

About Sam Aaron

Father. Husband. Geek. Workaholic. US Marine Corps Veteran.

Sam Aaron is a Senior Consultant in the Professional Services Organization for Entelligence, bringing over a decade of expertise in enterprise cloud automation and infrastructure. Sam has spent almost eleven years at VMware leading cloud automation initiatives using VCF Automation (formerly Aria Automation & vRA) and designing scalable, multi-tenant environments with VMware Cloud Director (vCD).

Sam holds multiple certifications including VCF-Architect 2024, VCIX-CMA, and dual VCPs (DCV & CMA), and is a recognized contributor to VMware’s certification exams. As a VMware Hands-On Lab (HOL) Captain and content author from 2015-2025, Sam played a key role in educating and mentoring the global VMware community. He helped to create and develop the automation challenge and troubleshooting labs for VMworld and global virtual forums.

When Sam is not working, he has several hobbies, among these are 3D printing Star Wars robots and turning them into animatronics.

Launched in April 2010, micronauts is Sam's online presence. Here, he has been blogging and sharing knowledge with the virtualization community. This blog acts as a central repository to retain the resolutions and other trivial knowledge that Sam has discovered.

** No information provided here was reviewed or endorsed by VMware by Broadcom, Microsoft, or anyone else for that matter. All information here are opinions based on Sam's personal experience. Use this knowledge at your own risk. **

Star
Useful Links