Managing vSphere Standard Switch
Esxcli network vswitch command is used to do the networking configuration of a vswitch (Standard or vDS). The available namespace with this command are: standard and dvs as shown below
To list all Standard vSwitch present on the Esxi host
1 |
# esxcli network vswitch standard list |
Add Remove vSphere Standard Switch
We can add/remove new standard switches or create a new portgroup in vswitch or associate uplinks to vswitch using the command
# esxcli network vswitch standard
The namespaces associated with the above command as shown below
Adding a new vSwitch to Esxi host
1 2 3 4 |
# esxcli network vswitch standard add –v=Name of vSwitch Example: # esxcli network vswitch standard add –v=vSwitch5 |
Adding a new vswitch with specific number of ports
1 |
# esxcli network vswitch standard add –v=vSwitch5 - -ports=256 |
Note: By default when a vSwitch is created it is created with 128 ports
Configuring Port Group on Standard Switches
Port groups are configured on vSwitch using the command
# esxcli network vswitch standard portgroup
The associated namespace with this command are as shown below:
Create a new portgroup in a standard vswitch
The following command is used to create a new portgroup on a standard vSwitch
1 2 3 |
# esxcli network vswitch standard portgroup add –p= name of port group –v= Name of vSwitch Example: # esxcli network vswitch standard portgroup add –p=”FT NW” –v=vSwitch6 |
Removing a portgroup from a vSwitch
Below command will delete a portgroup from a standard vswitch
1 |
# esxcli network vswitch standard portgroup remove –p=”FT NW” –v=vSwitch1 |
Configuring CDP on Standard switches
Configuring CDP settings or MTU on a standard vswitch is done using the command :
# esxcli network vswitch standard set
To enable CDP on a vswitch
1 2 3 4 5 6 7 |
# esxcli network vswitch standard set –c= cdp mode –v=vSwitch name The accepted values for CDP is listen, advertise and both Example: # esxcli network vswitch standard set –c=listen –v=vSwitch5 |
To disable CDP on a vswitch
1 |
<span style="color: #000000;"><em># esxcli network vswitch standard set –c=down –v=vSwitch5</em></span> |
Configuring uplinks for Standard vSwitch
The command used to add/remove uplinks to a standard vSwitch is
# esxcli network vswitch standard uplink
Adding an uplink to an existing vSwitch
1 2 3 |
<span style="color: #000000;"><em># esxcli network vswitch standard uplink add –u=uplink name –v=vswitch name</em></span> <span style="color: #000000;">Example</span> <span style="color: #000000;"><em># esxcli network vswitch standard uplink add -u=vmnic1 -v=vSwitch1</em></span> |
The above command will add a new uplink vmnic1 to the vswitch1
Removing an existing uplink from a vSwitch
1 |
<span style="color: #000000;"><em># esxcli network vswitch standard uplink remove -u=vmnic1 -v=vSwitch1</em></span> |
Setting Failover/Security/Traffic shaping policy configuration on a standard vSwitch
The command used to configure the policies on a standard vswitch is
# esxcli network vswitch standard policy
The available namespace with this command are shown below
Checking the configured policy (Failover/Security/Traffic Shaping) on a standard vSwitch
For e.g: command used to check the failover settings on a vSwitch are
1 |
<span style="color: #000000;"><em># esxcli network vswitch standard policy failover -v vSwitch_name</em></span> |
similarly we can check security settings and traffic shaping settings on a vswitch
Configuring failover policy
To set failover settings on a vswitch the command used is
# esxcli network standard vswitch policy failover set
set command is used to apply the configuration settings available under failover policy
To check the failover policies on a Portgroup
get command is used to check the configured failover policy on a port group
1 2 3 |
<span style="color: #000000;"><em># esxcli network vswitch standard portgroup policy failover get –p “Name of the portgroup”</em></span> <span style="color: #000000;">For E.g</span> <span style="color: #000000;"><em># esxcli network vswitch standard portgroup policy failover get -p "Prod NW"</em></span> |
Configuring Security Policy on standard vSwitch
The command used to set security policy on a vSwitch is
# esxcli network vswitch standard policy security
and the available namespace are “set and get”
set command is used to apply the settings available under security option like forged transmit or allowing promiscuous mode
To Set Traffic Shaping Policy
# esxcli network vswitch standard policy shaping set
The associated namespace are as follows
To list all the NICS present in Esxi host
The command used to see all the vmnics present on an Esxi host and their associated properties like link status, duplex speed, MTU value and Mac Address etc is
1 |
<span style="color: #000000;"><em># esxcli network nic list</em></span> |
To check properties of a single vmknic
1 |
<span style="color: #000000;"><em># esxcli network nic get -n vmnic1</em></span> |
For troubleshooting purposes, you can view statistics for a given NIC by running:
1 |
<span style="color: #000000;"><em># esxcli network nic stats get -n vmnic1</em></span> |
The command used for performing operations on a single vmnic is
# esxcli network nic
The associated namespace are
Shutdown a vmnic
To shutdown vmnic on your Esxi host the command is
1 |
<span style="color: #000000;"><em># esxcli network nic down –n=vmnic_name</em></span> |
After running the above command verify from your vCenter server console whether nic is disconnected or not
To reconnect a vmnic
The command used for bringing up a vmnic again is
1 |
<span style="color: #000000;"><em># esxcli network nic up –n=vmnic_name</em></span> |
Checking TCP Segmentation offload and Checksum offload settings of vmnics
TCP segmentation offload and checksum offload are the techniques of network optimization where some of the network related tasks are offloaded to cpu of physical adapter. Not all the adapters support this feature but if it is supporting then we should enable it to get the most out of our physical adapters
The commands used for this purpose are:
1 2 |
<span style="color: #000000;"><em># esxcli network nic tso get</em></span> <span style="color: #000000;"><em># esxcli network nic cso get</em></span> |
Checking DNS server settings, Routing Table, ARP table and firewall settings
The parent command used for all these purpose is:
# esxcli network ip
The associated namespace are as follows:
Checking the ARP table of your Esxi host
The command used for this purpose is
1 |
<span style="color: #000000;"><em># esxcli network ip neighbor list</em></span> |
DNS server settings
The parent command for DNS related settings is
1 |
<span style="color: #000000;"><em># esxcli network ip dns server</em></span> |
And the associated namespace are:
List all the DNS servers configured on your Esxi host
1 |
<span style="color: #000000;"><em># esxcli network ip dns server list</em></span> |
Configuring and Modifying Routing Table of your Esxi host
The parent command used for configuring routing table is
# esxcli network ip route
The associated namespaces are shown as below:
Checking the current status of routing table of your Esxi host
1 |
<span style="color: #000000;"><em># esxcli network ip route ipv4 list</em></span> |
To add a new route to your Esxi host
The command to add a new route in your host is
# esxcli network ip route ipv4 add –n=network_add –g=gateway address
Configuring Esxi firewall settings
The parent command used for configuring firewall related settings is
# esxcli network firewall
Associated namespace are as follows:
To check the current firewall settings
1 |
<span style="color: #000000;"><em># esxcli network firewall ruleset list</em></span> |
This command will list what are the services that are allowed/not allowed to pass through Esxi firewall
For exploring more command line options follow the below links:
vSphere Command-Line Interface Reference
Configuring vSwitch or vNetwork Distributed Switch from the command line
Hit Like and share this post on social media if the above post is informational to you. Happy Learning!!!
Thank you so much for the information and also looking info for vmware logs review
Thanks, Nithin Kotian
I have read so many articles or reviews on the topic of the blogger lovers however this
post is truly a nice piece of writing, keep it up.