SlideShare a Scribd company logo
How to Configure VMware vSwitchfrom ESX/ ESXi Command Line
by KAR TH I KEY AN SAD H ASI VAM on JANUARY 8, 2015
In both VMware ESX and ESXi host, vSwitches can be
configured either from the GUI or from the command line.
vSwitch is also known as vSphere standard switch.
The CLI configuration are very helpful when you are installing
multiple ESX servers and planning to script the vSwitch
configuration.
This article explains how to configure vSwitch from CLI using
esxcfg-vswitch command examples.
List all vSwitches
On ESX: To view all the current vSwitches in ESX server, use
the -l option as shown below. This will display both the switch
and portgroup information.
# esxcfg-vswitch -l
Switch Name Num Ports Used Ports Configured Ports
MTU Uplinks
vSwitch0 128 3 128
1500 vmnic0
PortGroup Name VLAN ID Used Ports Uplinks
Management Network 0 1 vmnic0
On ESXi: Instead of esxcfg-vswitch, you can also use esxcli
command to list vSwitches in ESXi as shown below. By
default, each ESXi host has one virtual switch called
vSwitch0.
# esxcli network vswitch standard list
Add a new vSwitch
To add a new vswitch, use the -a option as shown below. In
this example, a new virtual switch vswitch1 is created:
# esxcfg-vswitch -a vSwitch1
If you are on ESXi host, you can also use esxcli command as
shown below to add a new switch.
# esxcli network vswitch standard add -v vSwitch1
The default number of logical ports on vswitch is 56.
The maximum number of vSwithces that can be created on a
single ESXi host is 127.
When two or more virtual machines connected to the same
vswitch the traffic between them is routed locally and
whenever it needs to connect to the outside world, the traffic
is routed through the uplink adapter basically a NIC port
attached to the virtual switch.
Add a Port to vSwitch
On ESX: We just created the virtual switch. But, in order to
associate a network port (add a uplink) to this virtual switch,
use the following syntax:
esxcfg-vswitch –L <primary NIC> <vswitch name>
For example:
# esxcfg-vswitch -L vmnic1 vSwitch1
# esxcfg-vswitch -l
Switch Name Num Ports Used Ports Configured Ports
MTU Uplinks
vSwitch0 128 3 128
1500 vmnic0
PortGroup Name VLAN ID Used Ports Uplinks
Management Network 0 1 vmnic0
Switch Name Num Ports Used Ports Configured Ports
MTU Uplinks
vSwitch1 128 2 128
1500 vmnic1
PortGroup Name VLAN ID Used Ports Uplinks
On ESXi, execute the following command to add uplink:
# esxcli network vswitch standard uplink add -u vmnic1 -v
vSwitch1
Create Port Groups
Next we will see how to create port groups. Port groups are
nothing but a group a ports on vSwitch. It is also logical
segmentation of vSwitch. Every Port group has a name called
Network label. This is the endpoint network for your virtual
machines.
In the following example, you will see how to create the port
groups and assign the VLAN to the portgroups. In general,
VLAN ID 0 disables the VLAN tagging on port group.
The syntax to add a new port group is:
esxcfg-vswitch –A <Port Group Name> <vSwitch name>
The syntax to assign a VLAN to the port group is:
esxcfg-vswitch <vSwitch name> –v <VLAN ID> -p <Port
groupname>”
On ESX, do the following to create port groups:
# esxcfg-vswitch -A VM_Traffic_on_VLAN120 vSwitch1
# esxcfg-vswitch vSwitch1 -v 120 -p
"VM_Traffic_on_VLAN120"
# esxcfg-vswitch -A VM_Traffic_on_VLAN100 vSwitch1
# esxcfg-vswitch vSwitch1 -v 100 -p
"VM_Traffic_on_VLAN100"
View the portgroups that were just created above:
# esxcfg-vswitch -l
Switch Name Num Ports Used Ports Configured Ports
MTU Uplinks
vSwitch0 128 3 128
1500 vmnic0
PortGroup Name VLAN ID Used Ports Uplinks
Management Network 0 1 vmnic0
Switch Name Num Ports Used Ports Configured Ports
MTU Uplinks
vSwitch1 128 2 128
1500 vmnic1
PortGroup Name VLAN ID Used Ports Uplinks
VM_Traffic_on_VLAN100 100 0 vmnic1
VM_Traffic_on_VLAN120 120 0 vmnic1
On ESXi, do the following to create port groups using esxcli
command:
# esxcli network vswitch standard portgroup add -p
VM_Traffic_on_VLAN120 -v vSwitch1
Verify if vSwitch Exists
To check if a virtual switch already exists, use the -c option as
shown below.
The return code 1 indicates that vSwitch0 already exists:
# esxcfg-vswitch -c vSwitch1
1
The return code 0 indicates that vSwitch5 is not present.
# esxcfg-vswitch -c vSwitch5
0
Verify if Port Group Exists
To check if the port group already exists on the vSwitch use
the following commands:
The return code 1 indicates that VM_Traffic_on_VLAN100
portgroup already exists:
# esxcfg-vswitch -C VM_Traffic_on_VLAN100
1
The return code 0 indicates that VM_Traffic_on_VLAN100
portgroup does not exist:
# esxcfg-vswitch -C VM_Traffic_on_VLAN505
0
Add vMotion Network
To add vMotion network & assigning a VMkernel IP to handle
the vMotion traffic, follow the steps below:
# esxcfg-vswitch -A "vMotionNetwork" vSwitch1
# esxcfg-vmknic -a -i 19.86.100.199 -n 255.255.255.0 -m
9000 "vMotionNetwork"
# vim-cmd hostsvc/vmotion/vnic_set vmk1
View the vMotion configurations:
# esxcfg-vmknic -l
Interface Port Group/DVPort IP Family IP Address
Netmask
Broadcast MAC Address MTU TSO MSS
Enabled Type
vmk0 Management Network IPv4 19.86.101.99
255.255.255.0
19.86.101.255 64:31:50:51:84:6a 1500 65535 true
STATIC
vmk1 vMotionNetwork IPv4 19.86.100.199
255.255.255.0
19.86.100.255 00:50:56:6b:cb:d3 9000 65535 true
STATIC
Set MTU for vSwitch
On ESX, to set the MTU for any vswitch do the following:
# esxcfg-vswitch -m 9000 vSwitch1
Alternatively, only on ESXi, you can also do the following to
set MTU.
# esxcli network vswitch standard set --mtu=9000 --
vswitch-name=vSwitch1
Remove Port Group from vSwitch
To remove a port group from vswitch use the following
command:
# esxcfg-vswitch -D VM_Traffic_on_VLAN100 vSwitch1
To unlink a primary NIC from the virtual switch do the
following:
# esxcfg-vswitch -U vmnic1 vSwitch1
View vSwitch Network Policy Settings
The following commands list the network policy settings for a
vSwitch.
The network policy settings are security policy, traffic policy
and failover policies.
# esxcli network vswitch standard policy security get -v
vSwitch1
Allow Promiscuous: false
Allow MAC Address Change: true
Allow Forged Transmits: true
# esxcli network vswitch standard policy failover get -v
vSwitch1
Load Balancing: srcport
Network Failure Detection: link
Notify Switches: true
Failback: true
Active Adapters:
Standby Adapters: vmnic1
Unused Adapters:
# esxcli network vswitch standard policy shaping get -v
vSwitch1
Enabled: false
Average Bandwidth: -1 Kbps
Peak Bandwidth: -1 Kbps
Burst Size: -1 Kib
Change vSwitch Network Policy Settings
You can also change network policy settings for security
policy, or traffic policy, or failover policies from the command
line using esxcli command as shown below.
In the following example, we are changing the standard
policy, and changing the “Allow MAC Address Change” from
the default value of true to false.
# esxcli network vswitch standard policy security set --
allow-mac-change=false -v vSwitch1
# esxcli network vswitch standard policy security get -v
vSwitch1
Allow Promiscuous: false
Allow MAC Address Change: false
Allow Forged Transmits: true

More Related Content

What's hot

Formation gns3
Formation gns3Formation gns3
Formation gns3
Joeongala
 
Openvpn avec un client windows
Openvpn avec un client windows Openvpn avec un client windows
Openvpn avec un client windows
Yaya N'Tyeni Sanogo
 
Rapport mise en place d'un sevrer VPN .
   Rapport mise en place d'un sevrer VPN .   Rapport mise en place d'un sevrer VPN .
Rapport mise en place d'un sevrer VPN .
Mouad Lousimi
 
Gestion de consommation d'eau et d’Électricité
Gestion de consommation d'eau et d’ÉlectricitéGestion de consommation d'eau et d’Électricité
Gestion de consommation d'eau et d’Électricité
Ahmed EL ATARI
 
Les Vpn
Les VpnLes Vpn
Les Vpn
medalaa
 
7 hands on
7 hands on7 hands on
7 hands on
videos
 
Rapport d’installation d’un serveur de messagerie avec le Webmail Roundcube
Rapport d’installation d’un serveur de  messagerie avec le Webmail RoundcubeRapport d’installation d’un serveur de  messagerie avec le Webmail Roundcube
Rapport d’installation d’un serveur de messagerie avec le Webmail Roundcube
Balla Moussa Doumbouya
 
XDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @CloudflareXDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @Cloudflare
C4Media
 
Introduction à OpenStack
Introduction à OpenStackIntroduction à OpenStack
Introduction à OpenStack
AnDaolVras
 
Mise en place de Nagios core sur Ubuntu 22.04
Mise en place de Nagios core  sur Ubuntu 22.04Mise en place de Nagios core  sur Ubuntu 22.04
Mise en place de Nagios core sur Ubuntu 22.04
ImnaTech
 
Rapport sécurité
Rapport sécuritéRapport sécurité
Rapport sécurité
Mohammed Zaoui
 
Mise en place d’un système de détection
Mise en place d’un système de détectionMise en place d’un système de détection
Mise en place d’un système de détection
Manassé Achim kpaya
 
Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...
Mohammed LAAZIZLI
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
guest547d74
 
Mise en place d'une infrastructure basée sur OpenStack
Mise en place d'une infrastructure basée sur OpenStack Mise en place d'une infrastructure basée sur OpenStack
Mise en place d'une infrastructure basée sur OpenStack
Ahmed Slim
 
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : SécuritéAlphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm
 
ETUDE DE LA CYBERSECURITE
ETUDE DE LA CYBERSECURITEETUDE DE LA CYBERSECURITE
ETUDE DE LA CYBERSECURITE
SINCLAIR JAZA FOLEFACK
 
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 -  XDP closer integration with network stackKernel Recipes 2019 -  XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
Anne Nicolas
 
Présentation PFE
Présentation PFEPrésentation PFE
Présentation PFE
Ghizlane ALOZADE
 

What's hot (20)

Formation gns3
Formation gns3Formation gns3
Formation gns3
 
Openvpn avec un client windows
Openvpn avec un client windows Openvpn avec un client windows
Openvpn avec un client windows
 
Rapport mise en place d'un sevrer VPN .
   Rapport mise en place d'un sevrer VPN .   Rapport mise en place d'un sevrer VPN .
Rapport mise en place d'un sevrer VPN .
 
Gestion de consommation d'eau et d’Électricité
Gestion de consommation d'eau et d’ÉlectricitéGestion de consommation d'eau et d’Électricité
Gestion de consommation d'eau et d’Électricité
 
Les Vpn
Les VpnLes Vpn
Les Vpn
 
7 hands on
7 hands on7 hands on
7 hands on
 
Rapport d’installation d’un serveur de messagerie avec le Webmail Roundcube
Rapport d’installation d’un serveur de  messagerie avec le Webmail RoundcubeRapport d’installation d’un serveur de  messagerie avec le Webmail Roundcube
Rapport d’installation d’un serveur de messagerie avec le Webmail Roundcube
 
XDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @CloudflareXDP in Practice: DDoS Mitigation @Cloudflare
XDP in Practice: DDoS Mitigation @Cloudflare
 
Introduction à OpenStack
Introduction à OpenStackIntroduction à OpenStack
Introduction à OpenStack
 
Mise en place de Nagios core sur Ubuntu 22.04
Mise en place de Nagios core  sur Ubuntu 22.04Mise en place de Nagios core  sur Ubuntu 22.04
Mise en place de Nagios core sur Ubuntu 22.04
 
Rapport sécurité
Rapport sécuritéRapport sécurité
Rapport sécurité
 
Mise en place d’un système de détection
Mise en place d’un système de détectionMise en place d’un système de détection
Mise en place d’un système de détection
 
Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...Etude et mise en place d’une solution open source de gestion de la sécurité d...
Etude et mise en place d’une solution open source de gestion de la sécurité d...
 
Architecture Of The Linux Kernel
Architecture Of The Linux KernelArchitecture Of The Linux Kernel
Architecture Of The Linux Kernel
 
Mise en place d'une infrastructure basée sur OpenStack
Mise en place d'une infrastructure basée sur OpenStack Mise en place d'une infrastructure basée sur OpenStack
Mise en place d'une infrastructure basée sur OpenStack
 
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : SécuritéAlphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
Alphorm.com Formation CCNP ENCOR 350-401 (6of8) : Sécurité
 
ETUDE DE LA CYBERSECURITE
ETUDE DE LA CYBERSECURITEETUDE DE LA CYBERSECURITE
ETUDE DE LA CYBERSECURITE
 
Kernel Recipes 2019 - XDP closer integration with network stack
Kernel Recipes 2019 -  XDP closer integration with network stackKernel Recipes 2019 -  XDP closer integration with network stack
Kernel Recipes 2019 - XDP closer integration with network stack
 
Rapport de stage PFE
Rapport de stage PFERapport de stage PFE
Rapport de stage PFE
 
Présentation PFE
Présentation PFEPrésentation PFE
Présentation PFE
 

Viewers also liked

Hyper Converged Systems
Hyper Converged Systems Hyper Converged Systems
Hyper Converged Systems
Megan Salley
 
Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...
Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...
Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...
marketingunitrends
 
VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...
VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...
VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...
VMworld
 
Hyper-converged infrastructure
Hyper-converged infrastructureHyper-converged infrastructure
Hyper-converged infrastructure
Igor Malts
 
VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...
VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...
VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...
VMworld
 
Hyperconvergence 101: A Crash Course in Redefining Your Infrastructure
Hyperconvergence 101: A Crash Course in Redefining Your InfrastructureHyperconvergence 101: A Crash Course in Redefining Your Infrastructure
Hyperconvergence 101: A Crash Course in Redefining Your Infrastructure
ePlus
 
Hyperconverged Infrastructure, It's the Future
Hyperconverged Infrastructure, It's the FutureHyperconverged Infrastructure, It's the Future
Hyperconverged Infrastructure, It's the Future
Howard Marks
 

Viewers also liked (7)

Hyper Converged Systems
Hyper Converged Systems Hyper Converged Systems
Hyper Converged Systems
 
Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...
Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...
Protect the Hype: Backup Best Practices for Converged & Hyperconverged Infras...
 
VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...
VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...
VMworld Europe 204: Technical Deep Dive on EVO: RAIL, the new VMware Hyper-Co...
 
Hyper-converged infrastructure
Hyper-converged infrastructureHyper-converged infrastructure
Hyper-converged infrastructure
 
VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...
VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...
VMworld 2015: Rethinking Enterprise Storage: Rise Of Hyper Converged Infrastr...
 
Hyperconvergence 101: A Crash Course in Redefining Your Infrastructure
Hyperconvergence 101: A Crash Course in Redefining Your InfrastructureHyperconvergence 101: A Crash Course in Redefining Your Infrastructure
Hyperconvergence 101: A Crash Course in Redefining Your Infrastructure
 
Hyperconverged Infrastructure, It's the Future
Hyperconverged Infrastructure, It's the FutureHyperconverged Infrastructure, It's the Future
Hyperconverged Infrastructure, It's the Future
 

Similar to How to configure v mware v switch from esx-esxi command line

Nexus 1000v
Nexus 1000vNexus 1000v
Nexus 1000v
Krunal Shah
 
Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0
Fredy Ricse
 
VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話
upaa
 
VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...
VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...
VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...
VMworld
 
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
Dmitri Kalintsev
 
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
Amazon Web Services
 
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
David Pasek
 
vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01
vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01
vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01
Chrysostomos Christofi
 
NSX-MH
NSX-MHNSX-MH
VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...
VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...
VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...
VMworld
 
VswitchVLanCiscoNetworkingInANutshel.pdf
VswitchVLanCiscoNetworkingInANutshel.pdfVswitchVLanCiscoNetworkingInANutshel.pdf
VswitchVLanCiscoNetworkingInANutshel.pdf
jayshuklatrainer
 
How to configure cisco 6500 vss
How to configure cisco 6500 vssHow to configure cisco 6500 vss
How to configure cisco 6500 vss
IT Tech
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
Te-Yen Liu
 
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private CloudAWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
Amazon Web Services
 
Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)
Amazon Web Services
 
VMware NSX - Lessons Learned from real project
VMware NSX - Lessons Learned from real projectVMware NSX - Lessons Learned from real project
VMware NSX - Lessons Learned from real project
David Pasek
 
BRKVIR-3013 Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...
BRKVIR-3013  Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...BRKVIR-3013  Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...
BRKVIR-3013 Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...
Rassul Ismailov
 
Deep Dive: Amazon Virtual Private Cloud (March 2017)
Deep Dive: Amazon Virtual Private Cloud (March 2017)Deep Dive: Amazon Virtual Private Cloud (March 2017)
Deep Dive: Amazon Virtual Private Cloud (March 2017)
Julien SIMON
 
Deep Dive VPC - Pop-up Loft TLV 2017
Deep Dive VPC - Pop-up Loft TLV 2017Deep Dive VPC - Pop-up Loft TLV 2017
Deep Dive VPC - Pop-up Loft TLV 2017
Amazon Web Services
 
Demystifying openvswitch
Demystifying openvswitchDemystifying openvswitch
Demystifying openvswitch
Prasad Mukhedkar
 

Similar to How to configure v mware v switch from esx-esxi command line (20)

Nexus 1000v
Nexus 1000vNexus 1000v
Nexus 1000v
 
Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0Poster vmware-management-with-vcli-5.0
Poster vmware-management-with-vcli-5.0
 
VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話VyOS Users Meeting #2, VyOSのVXLANの話
VyOS Users Meeting #2, VyOSのVXLANの話
 
VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...
VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...
VMworld 2013: vSphere Networking and vCloud Networking Suite Best Practices a...
 
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
#NET5488 - Troubleshooting Methodology for VMware NSX - VMworld 2015
 
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
(SDD422) Amazon VPC Deep Dive | AWS re:Invent 2014
 
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
 
vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01
vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01
vmwarenetworkingnexus1000vm-fex-v2-140125071045-phpapp01
 
NSX-MH
NSX-MHNSX-MH
NSX-MH
 
VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...
VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...
VMworld 2013: Troubleshooting VXLAN and Network Services in a Virtualized Env...
 
VswitchVLanCiscoNetworkingInANutshel.pdf
VswitchVLanCiscoNetworkingInANutshel.pdfVswitchVLanCiscoNetworkingInANutshel.pdf
VswitchVLanCiscoNetworkingInANutshel.pdf
 
How to configure cisco 6500 vss
How to configure cisco 6500 vssHow to configure cisco 6500 vss
How to configure cisco 6500 vss
 
The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private CloudAWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
AWS May Webinar Series - Deep Dive: Amazon Virtual Private Cloud
 
Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)Deep Dive - Amazon Virtual Private Cloud (VPC)
Deep Dive - Amazon Virtual Private Cloud (VPC)
 
VMware NSX - Lessons Learned from real project
VMware NSX - Lessons Learned from real projectVMware NSX - Lessons Learned from real project
VMware NSX - Lessons Learned from real project
 
BRKVIR-3013 Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...
BRKVIR-3013  Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...BRKVIR-3013  Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...
BRKVIR-3013 Deploying and Troubleshooting the Nexus 1000v Virtual Switch on ...
 
Deep Dive: Amazon Virtual Private Cloud (March 2017)
Deep Dive: Amazon Virtual Private Cloud (March 2017)Deep Dive: Amazon Virtual Private Cloud (March 2017)
Deep Dive: Amazon Virtual Private Cloud (March 2017)
 
Deep Dive VPC - Pop-up Loft TLV 2017
Deep Dive VPC - Pop-up Loft TLV 2017Deep Dive VPC - Pop-up Loft TLV 2017
Deep Dive VPC - Pop-up Loft TLV 2017
 
Demystifying openvswitch
Demystifying openvswitchDemystifying openvswitch
Demystifying openvswitch
 

Recently uploaded

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
Divyam548318
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
MIGUELANGEL966976
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 

Recently uploaded (20)

Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
bank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdfbank management system in java and mysql report1.pdf
bank management system in java and mysql report1.pdf
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdfBPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
BPV-GUI-01-Guide-for-ASME-Review-Teams-(General)-10-10-2023.pdf
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 

How to configure v mware v switch from esx-esxi command line

  • 1. How to Configure VMware vSwitchfrom ESX/ ESXi Command Line by KAR TH I KEY AN SAD H ASI VAM on JANUARY 8, 2015 In both VMware ESX and ESXi host, vSwitches can be configured either from the GUI or from the command line. vSwitch is also known as vSphere standard switch. The CLI configuration are very helpful when you are installing multiple ESX servers and planning to script the vSwitch configuration. This article explains how to configure vSwitch from CLI using esxcfg-vswitch command examples. List all vSwitches On ESX: To view all the current vSwitches in ESX server, use the -l option as shown below. This will display both the switch and portgroup information. # esxcfg-vswitch -l Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch0 128 3 128 1500 vmnic0 PortGroup Name VLAN ID Used Ports Uplinks
  • 2. Management Network 0 1 vmnic0 On ESXi: Instead of esxcfg-vswitch, you can also use esxcli command to list vSwitches in ESXi as shown below. By default, each ESXi host has one virtual switch called vSwitch0. # esxcli network vswitch standard list Add a new vSwitch To add a new vswitch, use the -a option as shown below. In this example, a new virtual switch vswitch1 is created: # esxcfg-vswitch -a vSwitch1 If you are on ESXi host, you can also use esxcli command as shown below to add a new switch. # esxcli network vswitch standard add -v vSwitch1 The default number of logical ports on vswitch is 56. The maximum number of vSwithces that can be created on a single ESXi host is 127. When two or more virtual machines connected to the same vswitch the traffic between them is routed locally and whenever it needs to connect to the outside world, the traffic
  • 3. is routed through the uplink adapter basically a NIC port attached to the virtual switch. Add a Port to vSwitch On ESX: We just created the virtual switch. But, in order to associate a network port (add a uplink) to this virtual switch, use the following syntax: esxcfg-vswitch –L <primary NIC> <vswitch name> For example: # esxcfg-vswitch -L vmnic1 vSwitch1 # esxcfg-vswitch -l Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch0 128 3 128 1500 vmnic0 PortGroup Name VLAN ID Used Ports Uplinks Management Network 0 1 vmnic0
  • 4. Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch1 128 2 128 1500 vmnic1 PortGroup Name VLAN ID Used Ports Uplinks On ESXi, execute the following command to add uplink: # esxcli network vswitch standard uplink add -u vmnic1 -v vSwitch1 Create Port Groups Next we will see how to create port groups. Port groups are nothing but a group a ports on vSwitch. It is also logical segmentation of vSwitch. Every Port group has a name called Network label. This is the endpoint network for your virtual machines. In the following example, you will see how to create the port groups and assign the VLAN to the portgroups. In general, VLAN ID 0 disables the VLAN tagging on port group. The syntax to add a new port group is:
  • 5. esxcfg-vswitch –A <Port Group Name> <vSwitch name> The syntax to assign a VLAN to the port group is: esxcfg-vswitch <vSwitch name> –v <VLAN ID> -p <Port groupname>” On ESX, do the following to create port groups: # esxcfg-vswitch -A VM_Traffic_on_VLAN120 vSwitch1 # esxcfg-vswitch vSwitch1 -v 120 -p "VM_Traffic_on_VLAN120" # esxcfg-vswitch -A VM_Traffic_on_VLAN100 vSwitch1 # esxcfg-vswitch vSwitch1 -v 100 -p "VM_Traffic_on_VLAN100" View the portgroups that were just created above: # esxcfg-vswitch -l
  • 6. Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch0 128 3 128 1500 vmnic0 PortGroup Name VLAN ID Used Ports Uplinks Management Network 0 1 vmnic0 Switch Name Num Ports Used Ports Configured Ports MTU Uplinks vSwitch1 128 2 128 1500 vmnic1 PortGroup Name VLAN ID Used Ports Uplinks VM_Traffic_on_VLAN100 100 0 vmnic1 VM_Traffic_on_VLAN120 120 0 vmnic1 On ESXi, do the following to create port groups using esxcli command:
  • 7. # esxcli network vswitch standard portgroup add -p VM_Traffic_on_VLAN120 -v vSwitch1 Verify if vSwitch Exists To check if a virtual switch already exists, use the -c option as shown below. The return code 1 indicates that vSwitch0 already exists: # esxcfg-vswitch -c vSwitch1 1 The return code 0 indicates that vSwitch5 is not present. # esxcfg-vswitch -c vSwitch5 0 Verify if Port Group Exists To check if the port group already exists on the vSwitch use the following commands: The return code 1 indicates that VM_Traffic_on_VLAN100 portgroup already exists: # esxcfg-vswitch -C VM_Traffic_on_VLAN100
  • 8. 1 The return code 0 indicates that VM_Traffic_on_VLAN100 portgroup does not exist: # esxcfg-vswitch -C VM_Traffic_on_VLAN505 0 Add vMotion Network To add vMotion network & assigning a VMkernel IP to handle the vMotion traffic, follow the steps below: # esxcfg-vswitch -A "vMotionNetwork" vSwitch1 # esxcfg-vmknic -a -i 19.86.100.199 -n 255.255.255.0 -m 9000 "vMotionNetwork" # vim-cmd hostsvc/vmotion/vnic_set vmk1 View the vMotion configurations: # esxcfg-vmknic -l
  • 9. Interface Port Group/DVPort IP Family IP Address Netmask Broadcast MAC Address MTU TSO MSS Enabled Type vmk0 Management Network IPv4 19.86.101.99 255.255.255.0 19.86.101.255 64:31:50:51:84:6a 1500 65535 true STATIC vmk1 vMotionNetwork IPv4 19.86.100.199 255.255.255.0 19.86.100.255 00:50:56:6b:cb:d3 9000 65535 true STATIC Set MTU for vSwitch On ESX, to set the MTU for any vswitch do the following: # esxcfg-vswitch -m 9000 vSwitch1 Alternatively, only on ESXi, you can also do the following to set MTU.
  • 10. # esxcli network vswitch standard set --mtu=9000 -- vswitch-name=vSwitch1 Remove Port Group from vSwitch To remove a port group from vswitch use the following command: # esxcfg-vswitch -D VM_Traffic_on_VLAN100 vSwitch1 To unlink a primary NIC from the virtual switch do the following: # esxcfg-vswitch -U vmnic1 vSwitch1 View vSwitch Network Policy Settings The following commands list the network policy settings for a vSwitch. The network policy settings are security policy, traffic policy and failover policies. # esxcli network vswitch standard policy security get -v vSwitch1 Allow Promiscuous: false Allow MAC Address Change: true
  • 11. Allow Forged Transmits: true # esxcli network vswitch standard policy failover get -v vSwitch1 Load Balancing: srcport Network Failure Detection: link Notify Switches: true Failback: true Active Adapters: Standby Adapters: vmnic1 Unused Adapters: # esxcli network vswitch standard policy shaping get -v vSwitch1 Enabled: false Average Bandwidth: -1 Kbps Peak Bandwidth: -1 Kbps
  • 12. Burst Size: -1 Kib Change vSwitch Network Policy Settings You can also change network policy settings for security policy, or traffic policy, or failover policies from the command line using esxcli command as shown below. In the following example, we are changing the standard policy, and changing the “Allow MAC Address Change” from the default value of true to false. # esxcli network vswitch standard policy security set -- allow-mac-change=false -v vSwitch1 # esxcli network vswitch standard policy security get -v vSwitch1 Allow Promiscuous: false Allow MAC Address Change: false Allow Forged Transmits: true