List all vswif interfaces:

/usr/sbin/esxcfg-vswif -l
Name     Port Group          IP Address       Netmask          Broadcast        Enabled   DHCP
vswif0   Service Console     192.168.5.5     255.255.255.0    192.168.5.255   true      false


Delete a vswif interface:

/usr/sbin/esxcfg-vswif -d vswif0


Add a new vswif interface:

/usr/sbin/esxcfg-vswif -a -p"Service Console" -i192.168.5.5 -n255.255.255.0 vswif0


Command Options:
/usr/sbin/esxcfg-vswif
esxcfg-vswif []
-a|--add                   Add vswif, requires IP parameters.
Automatically enables interface.
-d|--del                   Delete vswif.
-l|--list                  List configured vswifs.
-e|--enable                Enable this vswif interface.
-s|--disable               Disable this vswif interface.
-p|--portgroup             Set the portgroup name of the vswif.
-i|--ip or DHCP  The IP address for this vswif or specify
DHCP to use DHCP for address.
-n|--netmask      The IP netmask for this vswif.
-b|--broadcast    The IP broadcast address for this vswif
(not required if netmask and ip are set).
-c|--check                 Check to see if a virtual NIC exists.
Program outputs a 1 if the given vswif
exists and is enabled, 0 otherwise.
-D|--disable-all           Disable all vswif interfaces.
(WARNING: This may result in a loss of network
connectivity to the Service Console).
-E|--enable-all            Enable all vswif interfaces and bring them up.
-A|--autoNet               Setup one DHCP vswif per vSwitch.
-r|--restore               Restore all vswifs from the configuration.
file (FOR INTERNAL USE ONLY).
-h|--help                  Show this message.
!!!WARNING!!!
Loss of network connectivity may result if invalid parameters are passed to
Add, Delete, Portgroup or IP operations.

Share this blog post on social media:

Social Links

Disclaimer

All advice, installation/configuration how to guides, troubleshooting and other information on this website are provided as-is with no warranty or guarantee. Whilst the information provided is correct to the best of my knowledge, I am not reponsible for any issues that may arise using this information, and you do so at your own risk. As always before performing anything; check, double check, test and always ensure you have a backup.

Copyright ©2008-2021 Andy Barnes - Please do not copy any content including images without prior consent!

Designed and Hosted by Andy Barnes

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.