VMware ESXi: A (incomplete) list of host commands Part 5

Hi,

some more commands…

Capture Network Packets on the a physical interface

1
pktcap-uw --uplink vmnic0

List all physical nic’s

1
esxcli network nic list

List kernel interfaces

1
esxcfg-vmknic -l

Create a n Kernel interface with a specfic MAC and IP Address and add it to a portgroup

1
2
esxcfg-vmknic -a -i 192.168.254.3 -n 255.255.255.0 -M 01:12:34:56:78:90 -p PortGroupName
esxcfg-vmknic -p PortGroupName -6 false

Or with DHCP enabled

1
esxcfg-vmknic -a -i DHCP -M 01:12:34:56:78:90 -p PortGroupName

Delete an Kernel interface

1
esxcfg-vmknic -d -p PortGroupName

Show routing table

1
esxcli network ip route ipv4 list

Show arp cache

1
esxcli network ip neighbor list

List all vSwitches

1
esxcli network vswitch standard list

Change the physical uplink of an vSwitch

1
2
esxcli network vswitch standard uplink remove -u vmnic0 -v vSwitch1
esxcli network vswitch standard uplink add -u vmnic1 -v vSwitch1

Change the uplink priority of the physical adapters

1
esxcli network vswitch standard portgroup policy failover set -p MyPortgroup --active-uplinks vmnic0 --standby-uplinks vSwitch1

List all portgroups

1
esxcli network vswitch standard portgroup list

Add a new portgroup at the vSwitch to which the Kernel Interface should connected

1
esxcli network vswitch standard portgroup add -p "PG vMotion" -v vSwitch0

Set the VLAN id

1
esxcli network vswitch standard portgroup set --vlan-id 0 -p "PG vMotion"

Add a Kernel interface to the new Portgroup

1
esxcfg-vmknic –a -i 192.168.254.5 -n 255.255.255.0 "PG vMotion"

or, for example, recreating the vmk0 Kernel Interface

1
2
3
esxcli network ip interface remove --interface-name=vmk0
esxcli network ip interface add --interface-name=vmk0 -p "Management Network" -M 01:12:34:56:78:90
esxcli network ip interface ipv4 set --interface-name=vmk0 --ipv4=192.168.254.5 --netmask=255.255.255.0 --type=static

Set Interface as Management Network

1
esxcli network ip interface tag add -i vmk0 -t Management

Set Default Gateway

1
esxcfg-route -a default 192.168.254.1

Michael

Leave a Reply