You can use esxcli network vswitch standard portgroup to check, add, and remove port groups.
Network services connect to vSwitches through port groups. A port group allows you to group traffic and specify configuration options such as bandwidth limitations and VLAN tagging policies for each port in the port group. A virtual switch must have one port group assigned to it. You can assign additional port groups.
Specify one of the options listed in Connection Options for vCLI Host Management Commands in place of <conn_options>
.
- List port groups currently associated with a virtual switch.
esxcli <conn_options> network vswitch standard portgroup list
The command lists the port group name, associated virtual switch, active clients, and VLAN ID. - Add a port group.
esxcli <conn_options> network vswitch standard portgroup add --portgroup-name=<name> --vswitch-name=vSwitch1
- Delete one of the existing port groups.
esxcli <conn_options> network vswitch standard portgroup remove --portgroup-name=<name> --vswitch-name=vSwitch1