Networking Configuration on a ESXI Host using Shell


Useful network commands on ESXI Shell:

esxcfg-nics cmd allows you to set the speed, duplex or list physical nics.

esxcfg-nics -h shows the list of cmd available

esxcfg-vswitch cmd allows you to administer vSwitchs.

to list the switches:

esxcfg-vswitch -l      # list current vswitch configuration
esxcfg-vmknic -l       # list vmkernel interfaces and their configuration
esxcfg-nics -l         # display listing of physical adapters and their link state

esxcli network ip interface list – ESXI’s ifconfig showing all host network information.

to create a vswitch:

esxcfg-vswitch -a <vswitch name>

Create a port group:

esxcfg-vswitch -A TestPortGroup1 TestSwitch1

when creating vSwitch’s and port groups via the shell, they may not appear in the console until you restart the hostd service.

/etc/init.d/hostd restart
/etc/init.d/vpxa restart

to set the MTU on the vswitch:

This is great for configuring Jumbo frames, ensure that you use VMNET3 interfaces to take full advantage. The default E1000 device that is presented to guests is not supported.

esxcfg-vswitch --mtu 9000 vSwitch0

To verify the config:

esxcfg-vswitch vsift -l

Configuring VLANs:

esxcfg-vswitch -v <VLAN> -p “Service Console” vSwitch0

Check if a port-group already exists:

esxcfg-vswitch -C VMotion

List DNS servers and Search Domains:

esxcli network ip dns search list
esxcli network ip dns server list

VMware’s ifconfig:

esxcli network ip interface list

VMware’s netstat:

esxcli network ip connection list

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1000258

2 thoughts on “Networking Configuration on a ESXI Host using Shell

Add yours

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a website or blog at WordPress.com

Up ↑