Set ESXi Firewall rules

Sometimes we have to enable and disable ESXi firewall rules for traffic or service functionality. as knows by default in ESXi 5 the firewall is enabled and in order to change certain firewall rule, we have to use on VSphere web, VSphere client or using Putty [SSH] onesxclicommand.
Therefore, I am going to show you how to do that for each option, be careful with it, don’t change anything without any essential reason.

VShpere web client

You definitely can do that from the Vsphere web client:
Login the VShpere Web Client > select a host > Manage tab > Security Profile > Edit:

VShpere Client:

In the Vshpere we can select the relevant HOST and then go to “Configuration”  tab and then > “Security Profile” > Properties>:

Uncheck/check the relevant rule:

The second option is to change it via esxcli > but first enable the SSH on your Host:

The second option is to change it via Esxcli –  first enable the SSH on your Host:

Then connect to the host using Putty:

esxcli network firewall get

In order to see the current firewall rules status we can use on this command:

esxcli network firewall ruleset list

We can enable or disable all rules using the following command:

esxcli network firewall set  –enabled false

esxcli network firewall set  –enabled true

Enable specific rule:

esxcli network firewall ruleset –enabled true –ruleset-id Name

Disable specific rule:

esxcli network firewall ruleset –enabled false –ruleset-id Name