You can configure incoming and outgoing firewall connections for a service or a management agent from the vSphere Client or at the command line.
This task describes how to use the vSphere Client to configure ESXi firewall settings. You can use the ESXi Shell or ESXCLI commands to configure ESXi at the command line to automate the firewall configuration. See Getting Started with ESXCLI for an introduction, and ESXCLI Concepts and Examples for examples of using ESXCLI to manipulate firewalls and firewall rules.
Note: If different services have overlapping port rules, enabling one service might implicitly enable other services. You can specify which IP addresses are allowed to access each service on the host to avoid this problem.