ESXi 5.x Allow SMTP Firewall Setup

Create this file:
/etc/vmware/firewall/smtp.xml

<ConfigRoot>
<service id=”0033″>
<id>smtp</id>
<rule id=’0000′>
<direction>outbound</direction>
<protocol>tcp</protocol>
<porttype>dst</porttype>
<port>25</port>
</rule>
<enabled>true</enabled>
<required>false</required>
</service>
</ConfigRoot>

 

Restart Firewall Services
esxcli network firewall refresh

To enable persistency after reboot

copy smtp.xml to a place that have persistant storage, then

vi /etc/profile.local (5.1) or vi /etc/rc.local (5.0)

add

cp /vmfs/volumes/nas03.iscsi/firewall/smtp.xml /etc/vmware/firewall/smtp.xml
esxcli network firewall refresh

replace /vmfs/volumes/nas03.iscsi/firewall/smtp.xml with the storage location

Also upon restart, need to ssh logon to trigger the effect (no idea why it only execute only during ssh logon)

Leave a Reply