This knowledge base explains the recovery procedure when you accidentally change the ESXi firewall configuration and can no longer access the ESXi host from the Host Client, SSH, etc.
VMware ESXi
If access via the network is blocked due to the ESXi firewall configuration, directly operate the ESXi Shell from the physical console or remote console to lift the restriction.
esxcli network firewall ruleset allowedip list | moreesxcli network firewall ruleset set --ruleset-id=<Ruleset Name> --allowed-all trueesxcli network firewall ruleset set --ruleset-id=vSphereClient --allowed-all trueesxcli network firewall ruleset allowedip list | more