In order to create a virtual standard switch (vSS) we can use the vSphere Web Client or alternatively we can use the esxcli namespace to achieve this. In this example I will create a single vSS by connecting to the console session of an ESXi host with the following requirements:
- Create a vSS named vSwitch1 with 128 configured ports
- Allow the vSS to enter promiscuous mode.
- Add uplink vmnic1
- Add the portgroup ‘Test’ with a VLAN id of ’10’.
Firstly, we will create the vSS named ‘vSwitch 1′ with a total of ‘128′ ports and allow the vSS to enter promiscuous mode.
esxcli network vswitch standard add -P 128 -v vSwitch1 esxcli network vswitch standard policy security set -p true -v vSwitch1
Now we will add the uplink ‘vmnic1‘ to the vSS.
esxcli network vswitch standard uplink add -u vmnic1 -v vSwitch1
Finally we will create a port group named ‘Test‘ and set a VLAN id of ‘10‘ for the vSS.
esxcli network vswitch standard portgroup add -p Test -v vSwitch1 esxcli network vswitch standard portgroup set -p Test -v 10
We can view the vSS we have just created by invoking ‘esxcli network vswitch standard list -v vSwitch1‘ and confirm the security policy configuration by invoking ‘esxcli network vswitch standard policy security get -v vSwitch1‘.
vSwitch1 Name: vSwitch1 Class: etherswitch Num Ports: 1536 Used Ports: 1 Configured Ports: 128 MTU: 1500 CDP Status: listen Beacon Enabled: false Beacon Interval: 1 Beacon Threshold: 3 Beacon Required By: Uplinks: vmnic1 Portgroups: Test
Allow Promiscuous: true Allow MAC Address Change: true Allow Forged Transmits: true