December 31

ESXi: Esxcfg-vswitch Commands

Delete a Port Group:
esxcfg-vswitch -D “Service Console” vSwitch1

Add a nic (vmnic2) to a vswitch (vswitch1):
esxcfg-vswitch -L vmnic2 vswitch1

Remove a pnic (vmnic3) from a vswitch (vswitch0):
esxcfg-vswitch -U vmnic3 vswitch0

Create a portgroup (VM Network3) on a vswitch (vswitch1):
esxcfg-vswitch -A “VM Network 3” vSwitch1

Assign a VLAN ID (3) to a portgroup (VM Network 3) on a vswitch (vswitch1):
esxcfg-vswitch -v 3 -p “VM Network 3” vSwitch1

Change your Service Console (vswif0) IP and Subnet Mask:
esxcfg-vswif -i 172.20.20.5 -n 255.255.255.0 vswif0

Add a Service Console (vswif0):
esxcfg-vswif -a vswif0 -p “Service Console” -i 172.20.20.40 -n 255.255.255.0

Add Vlan to a Port Group:
esxcfg-vswitch “vSwitch name” -p “portgroup name” -v “vlan ID”

List the existing config so you can get your vswitch and portgroup name:
esxcfg-vswitch -l

By Paquin


Copyright 2021. All rights reserved.

Posted December 31, 2021 by Timothy Conrad in category "Virtualization

About the Author

If I were to describe myself with one word it would be, creative. I am interested in almost everything which keeps me rather busy. Here you will find some of my technical musings. Securely email me using - PGP: 4CB8 91EB 0C0A A530 3BE9 6D76 B076 96F1 6135 0A1B