Generate esxcli, PowerCLI, and Terraform commands to create vSphere standard or distributed switch port groups.
A VMware port group is a named policy container within a vSwitch or distributed switch that groups VM network adapters with a shared VLAN ID, MTU, and security policy. Standard vSwitch port groups are configured per-host with esxcli. Distributed switch port groups are centrally managed at the vCenter level and replicated to all hosts in the cluster.
VLAN ID 0 means the port group is untagged (native VLAN). VLAN ID 4095 enables trunk mode, passing all VLANs through to the guest OS, typically used for nested hypervisors or network appliances that handle their own tagging. All other IDs (1-4094) tag traffic with that specific VLAN.
Security policy defaults to reject promiscuous mode, MAC changes, and forged transmits. Enable promiscuous mode only for network monitoring tools or packet capture appliances that need to see traffic not addressed to them.