a blog about Network and Security

Autor: Stephan Wolf (Seite 2 von 5)

VCF Holodeck Preparation via ESXi CLI

with this following CLI script you can prep a ESXi Host for VCF Holodeck and create the standard switches and portgroups like in official guide but with CLI and so you save time and manual errors.

###### START #########


# Enable SSH
vim-cmd hostsvc/enable_ssh

vim-cmd hostsvc/start_ssh

# Enable ESXi Shell

vim-cmd hostsvc/enable_esx_shell

vim-cmd hostsvc/start_esx_shell


# Suppress Shell warning

esxcli system settings advanced set -o /UserVars/SuppressShellWarning -i 1



# NTP
esxcli system ntp set -s pool.ntp.org

esxcli system ntp set -e 1


#Create vSwitch


esxcli network vswitch standard add --vswitch-name=VLC-A
esxcli network vswitch standard add --vswitch-name=VLC-A2
esxcli network vswitch standard add --vswitch-name=VLC-B
esxcli network vswitch standard add --vswitch-name=VLC-B2


#Set Security Policy
esxcli network vswitch standard policy security set --allow-promiscuous=true -v VLC-A

esxcli network vswitch standard policy security set --allow-mac-change=true -v VLC-A

esxcli network vswitch standard policy security set --allow-forged-transmits=true -v VLC-A

esxcli network vswitch standard policy security set --allow-promiscuous=true -v VLC-A2

esxcli network vswitch standard policy security set --allow-mac-change=true -v VLC-A2

esxcli network vswitch standard policy security set --allow-forged-transmits=true -v VLC-A2


#### Pause ###


esxcli network vswitch standard policy security set --allow-promiscuous=true -v VLC-B

esxcli network vswitch standard policy security set --allow-mac-change=true -v VLC-B

esxcli network vswitch standard policy security set --allow-forged-transmits=true -v VLC-B

esxcli network vswitch standard policy security set --allow-promiscuous=true -v VLC-B2

esxcli network vswitch standard policy security set --allow-mac-change=true -v VLC-B2

esxcli network vswitch standard policy security set --allow-forged-transmits=true -v VLC-B2


#Configure MTU

esxcfg-vswitch -m 9000 VLC-A

esxcfg-vswitch -m 9000 VLC-A2

esxcfg-vswitch -m 9000 VLC-B

esxcfg-vswitch -m 9000  VLC-B2





#Create Portgroups

esxcli network vswitch standard portgroup add --portgroup-name=VLC-A-PG --vswitch-name=VLC-A

esxcli network vswitch standard portgroup add --portgroup-name=VLC-A2-PG --vswitch-name=VLC-A2

esxcli network vswitch standard portgroup add --portgroup-name=VLC-B-PG --vswitch-name=VLC-B

esxcli network vswitch standard portgroup add --portgroup-name=VLC-B2-PG --vswitch-name=VLC-B2

#Set Portgroups VLANs

esxcli network vswitch standard portgroup set -p VLC-A-PG --vlan-id 4095

esxcli network vswitch standard portgroup set -p VLC-A2-PG --vlan-id 4095

esxcli network vswitch standard portgroup set -p VLC-B-PG --vlan-id 4095

esxcli network vswitch standard portgroup set -p VLC-B2-PG --vlan-id 4095



######## END ##############

Thanks to Gareth Edwards for his article with is the source

« Ältere Beiträge Neuere Beiträge »

© 2025 v-Wolf

Theme von Anders NorénHoch ↑