By Joe Piggee
By default, when ESXi is installed, the firewall is enabled. The default configuration is to permit only the required operational traffic and to deny all others. As a note, the command esxcfg-firewall was retired and replaced by esxcli network firewall in vSphere 5.
To enable the firewall:
esxcli network firewall set –enabled true
To disable the firewall
esxcli network firewall set –enabled false
Enable/Disable pre-configured services
- List the services and record the proper ruleset ID for your service
- esxcli network firewall ruleset list
- To enable:
- esxcli network firewall ruleset –enabled true –ruleset-id rulesetName
- To disable:
- esxcli network firewall ruleset –enabled false –ruleset-id rulesetName
Configure service behavior automation
- Login to vSphere client
- Enter the Hosts and Clusters View (Ctrl + Shift + H)
- Select a host
- Click the Configuration tab
- Under the Software view, select Security Profile
- Under Security Profile > Services, click Properties
- Highlight a service
- Click Options
- The service operational controls are listed
- Start automatically if any ports are open, and stop when all ports are closed
- Start and stop with host
- Start and stop manually (Select this to effectively disable the service)
Open/Close ports in the firewall
- Login to vSphere client
- Enter the Hosts and Clusters View (Ctrl + Shift + H)
- Select a host
- Click the Configuration tab
- Under the Software view, select Security Profile
- Under Security Profile > Firewall, click Properties
- Highlight a service
- To enable a firewall rule, check the check box next to the traffic label
- Click Options to set the service start automation settings as described above
- Click the firewall button to define what connections can be made to the services. All connections may be allowed or it can be restricted to a single IPv4 or IPv6 addresses and/or IPv4 or IPv6 networks.
Alternatively, to define the allowed IP addresses, you may configure this from the command line:
esxcli network firewall ruleset allowedip add –ruleset-id RulesetName –ip-address IPAddress/Network
esxcli network firewall ruleset allowedip add –ruleset-id RulesetName –ip-address IPAddress
esxcli network firewall ruleset allowedip remove –ruleset-id RulesetName –ip-address IPAddress/Network
esxcli network firewall ruleset allowedip remove –ruleset-id RulesetName –ip-address IPAddress
esxcli network firewall ruleset allowedip list –ruleset-id RulesetName
Note that you may edit the /etc/vmware/firewall/services.xml file for the pre-configured services. After you update any port numbers, remember to refresh the firewall:
esxcli network firewall refresh
No comments:
Post a Comment