May 25, 2013
Category: vmware
Tags: command-line-interface, domain-name-system, esxi-shell, ip-interface, jumbo-frames, mtu, name-server, protocols, search-domains, servers, virtual-lan, virtual-machine, vm, vmware-esx
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