6.5
Table Of Contents
- vSphere Command-Line Interface Concepts and Examples
- Contents
- About This Book
- vSphere CLI Command Overviews
- Introduction
- List of Available Host Management Commands
- Targets and Protocols for vCLI Host Management Commands
- Supported Platforms for vCLI Commands
- Commands with an esxcfg Prefix
- ESXCLI Commands Available on Different ESXi Hosts
- Trust Relationship Requirement for ESXCLI Commands
- Using ESXCLI Output
- Connection Options for vCLI Host Management Commands
- Connection Options for DCLI Commands
- vCLI Host Management Commands and Lockdown Mode
- Managing Hosts
- Managing Files
- Managing Storage
- Introduction to Storage
- Examining LUNs
- Detach a Device and Remove a LUN
- Reattach a Device
- Working with Permanent Device Loss
- Managing Paths
- Managing Path Policies
- Scheduling Queues for Virtual Machine I/O
- Managing NFS/NAS Datastores
- Monitor and Manage FibreChannel SAN Storage
- Monitoring and Managing Virtual SAN Storage
- Monitoring vSphere Flash Read Cache
- Monitoring and Managing Virtual Volumes
- Migrating Virtual Machines with svmotion
- Configuring FCoE Adapters
- Scanning Storage Adapters
- Retrieving SMART Information
- Managing iSCSI Storage
- iSCSI Storage Overview
- Protecting an iSCSI SAN
- Command Syntax for esxcli iscsi and vicfg-iscsi
- iSCSI Storage Setup with ESXCLI
- iSCSI Storage Setup with vicfg-iscsi
- Listing and Setting iSCSI Options
- Listing and Setting iSCSI Parameters
- Enabling iSCSI Authentication
- Set Up Ports for iSCSI Multipathing
- Managing iSCSI Sessions
- Managing Third-Party Storage Arrays
- Managing Users
- Managing Virtual Machines
- Managing vSphere Networking
- Introduction to vSphere Networking
- Retrieving Basic Networking Information
- Troubleshoot a Networking Setup
- Setting Up vSphere Networking with vSphere Standard Switches
- Setting Up Virtual Switches and Associating a Switch with a Network Interface
- Retrieving Information About Virtual Switches
- Adding and Deleting Virtual Switches
- Checking, Adding, and Removing Port Groups
- Managing Uplinks and Port Groups
- Setting the Port Group VLAN ID
- Managing Uplink Adapters
- Adding and Modifying VMkernel Network Interfaces
- Managing VMkernel Network Interfaces with ESXCLI
- Add and Configure an IPv4 VMkernel Network Interface with ESXCLI
- Add and Configure an IPv6 VMkernel Network Interface with ESXCLI
- Managing VMkernel Network Interfaces with vicfg-vmknic
- Add and Configure an IPv4 VMkernel Network Interface with vicfg-vmknic
- Add and Configure an IPv6 VMkernel Network Interface with vicfg-vmknic
- Setting Up vSphere Networking with vSphere Distributed Switch
- Managing Standard Networking Services in the vSphere Environment
- Setting the DNS Configuration
- Manage an NTP Server
- Manage the IP Gateway
- Setting Up IPsec
- Manage the ESXi Firewall
- Monitor VXLAN
- Monitoring ESXi Hosts
- Index
Setting Up vSphere Networking with vSphere Standard Switches
You can use ESXCLI and vicfg-vswitch to set up the vSphere networking.
You can set up your virtual network by performing a set of tasks.
1 Create or manipulate virtual switches by using esxcli network vswitch or vicfg-vswitch. By default,
each ESXi host has one virtual switch, vSwitch0. You can create additional virtual switches or manage
existing switches. See “Seing Up Virtual Switches and Associating a Switch with a Network Interface,”
on page 136.
2 (Optional) Make changes to the uplink adapter by using esxcli network vswitch standard uplink or
vicfg-nics. See “Managing Uplink Adapters,” on page 142.
3 (Optional) Use esxcli network vswitch standard portgroup or vicfg-vswitch to add port groups to
the virtual switch. See “Managing Port Groups with vicfg-vswitch,” on page 140.
4 (Optional) Use esxcli network vswitch standard portgroup set or vicfg-vswitch to establish VLANs
by associating port groups with VLAN IDs. See “Seing the Port Group VLAN ID with vicfg-vswitch,”
on page 141.
5 Use esxcli network ip interface or vicfg-vmknic to congure the VMkernel network interfaces. See
“Adding and Modifying VMkernel Network Interfaces,” on page 145.
Setting Up Virtual Switches and Associating a Switch with a Network Interface
A virtual switch models a physical Ethernet switch. You can manage virtual switches and port groups by
using the vSphere Web Client or by using vSphere CLI commands.
You can create a maximum of 127 virtual switches on a single ESXi host. By default, each ESXi host has a
single virtual switch called vSwitch0. By default, a virtual switch has 56 logical ports. See the Conguration
Maximums document on the vSphere documentation main page for details. Ports connect to the virtual
machines and the ESXi physical network adapters.
n
You can connect one virtual machine network adapter to each port by using the vSphere Web Client UI.
n
You can connect the uplink adapter to the virtual switches by using vicfg-vswitch or esxcli network
vswitch standard uplink. See “Linking and Unlinking Uplink Adapters with vicfg-vswitch,” on
page 144.
When two or more virtual machines are connected to the same virtual switch, network trac between them
is routed locally. If an uplink adapter is aached to the virtual switch, each virtual machine can access the
external network that the adapter is connected to.
This section discusses working in a standard switch environment. See “Networking Using vSphere
Distributed Switches,” on page 133 for information about distributed switch environments.
When working with virtual switches and port groups, perform the following tasks.
1 Find out which virtual switches are available and, optionally, what the associated MTU and CDP (Cisco
Discovery Protocol) seings are. See “Retrieving Information About Virtual Switches with ESXCLI,” on
page 137 and “Retrieving Information About Virtual Switches with vicfg-vswitch,” on page 137.
2 Add a virtual switch. See “Adding and Deleting Virtual Switches with ESXCLI,” on page 138 and
“Adding and Deleting Virtual Switches with vicfg-vswitch,” on page 138.
3 For a newly added switch, perform these tasks.
a Add a port group. See “Managing Port Groups with ESXCLI,” on page 139 and “Managing Port
Groups with vicfg-vswitch,” on page 140.
b (Optional) Set the port group VLAN ID. See “Seing the Port Group VLAN ID with ESXCLI,” on
page 141 and “Seing the Port Group VLAN ID with vicfg-vswitch,” on page 141.
vSphere Command-Line Interface Concepts and Examples
136 VMware, Inc.