6.0

Table Of Contents
Getting Started with vSphere Command-Line Interfaces
122 VMware, Inc.
YoucanusethefollowingcommandsforVLANmanagement:
AllowportgroupstoreachportgroupslocatedonotherVLANs.
esxcli <conn_options> network vswitch standard portgroup set -p <pg_name> --vlan-id 4095
CallthecommandmultipletimestoallowallportstoreachportgroupslocatedonotherVLANs.
DisableVLANforportgroupg42
esxcli <conn_options> network vswitch standard portgroup set --vlan-id 0 -p g42
Setting the Port Group VLAN ID with vicfg-vswitch
VLANsallowyoutofurthersegmentasinglephysicalLANsegmentsothatgroupsofportsareisolatedasif
theywereonphysicallydifferentsegments.ThestandardisIEEE802.1Q.
AVLANIDrestrictsportgrouptraffictoalogicalEthernetsegmentwithinthephysicalnetwork.
SettheVLANIDto4095toallowaportgrouptoreachportgroupslocatedonotherVLAN.
SettheVLANIDto0todisabletheVLANforthisportgroup.
IfyouuseVLANIDs,youmustchangetheportgrouplabelsandVLANIDstogethersothatthelabels
properlyrepresentconnectivity.VLANIDsareoptional.
YoucanusethefollowingcommandsforVLANmanagement:
AllowallportgroupstoreachportgroupslocatedonotherVLANs.
vicfg-vswitch <conn_options> --vlan 4095 --pg “ALL” vSwitch2
DisableVLANforportgroupg42.
vicfg-vswitch <conn_options> --vlan 0 --pg g42 vSwitch2
Runvicfg-vswitch -ltoretrieveinformationaboutVLANIDscurrentlyassociatedwiththevirtual
switchesinthenetwork.
Runesxcli network vswitch standard portgroup listtolistallportgroupsandassociatedVLANIDs.
Managing Uplink Adapters
Youcanmanageuplinkadapters,whichrepresentthe physicalNICsthatconnecttheESXihosttothenetwork
byusingtheesxcli network nicsorthevicfg-nicscommand.Youcanalsouseesxcli network
vswitchandesxcfg-vswitchtolinkandunlinktheuplink.
Youcanusevicfg-nicstolistinformationandtospecifyspeed
andduplexsettingfortheuplink.
Youcanuseesxcli network nic tolistalluplinks,tolistinformation,tosetattributes,andtobringa
specifieduplinkdownorup.
Managing Uplink Adapters with esxcli network nic
Thefollowingexampleworkflowlistsalluplinkadapters,listspropertiesforoneuplinkadapter,changesthe
uplink’sspeedandduplexsettings,andbringstheuplinkdownandbackup.Specifyoneoftheoptionslisted
in“ConnectionOptionsforvCLIHostManagementCommands”onpage 18inplaceof<conn_options>.
To manipulate uplink adapter setup
1Listalluplinksandinformationabouteachdevice.
esxcli <conn_options> network nic list
Youcannarrowdowntheinformationdisplayedbyusingesxcli network nic get
--nic-name=<nic>.
2 (Optional)Bringdownoneoftheuplinkadapters.
esxcli <conn_options> network nic down --nic-name=vmnic0