# esxcli network firewall ruleset list
Name Enabled
-------------- -----------------
sshServer true
sshClient false
nfsClient true
dhcp true
dns true
snmp true
ntpClient false
CIMHttpServer true
CIMHttpsServer true
CIMSLP true
iSCSI true
To enable the DNS service on port 53 for TCP:
/etc/vmware/firewall/service.xml
file by running the command:# cp /etc/vmware/firewall/service.xml /etc/vmware/firewall/service.xml.bak
service.xml
file to allow writes by running the chmod
command:# chmod 644 /etc/vmware/firewall/service.xml
# chmod +t /etc/vmware/firewall/service.xml
service.xml
file in a text editor.service.xml
file:<service id="0032">
<id>DNSTCPOut</id>
<rule id='0000'>
<direction>outbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>53</port>
</rule>
<enabled>true</enabled>
<required>false</required>
</service>
<ConfigRoot>
<service id='0000'>
<id>serviceName</id>
<rule id = '0000'>
<direction>inbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>80</port>
</rule>
<rule id='0001'>
<direction>inbound</direction>
<protocol>tcp</protocol>
<porttype>src</porttype>
<port>
<begin>1020</begin>
<end>1050</end>
</port>
</rule>
<enabled>true</enabled>
<required>false</required>
</service>
</ConfigRoot>
service.xml
file to the read-only default by running the command:# chmod 444 /etc/vmware/firewall/service.xml
# esxcli network firewall refresh
# localcli network firewall refresh
# esxcli network firewall ruleset list
Name Enabled
-------------- -----------------
sshServer true
sshClient false
nfsClient true
dhcp true
dns true
snmp true
ntpClient false
CIMHttpServer true
CIMHttpsServer true
CIMSLP true
iSCSI true
DNSTCPOut true
Notes:
DNSTCPOut
firewall rule allows outgoing connections on TCP port 53. New firewall rules and services are also viewable under the Host Configuration section in Security Profile using the vSphere Client.