CSF Firewall Port generation tool

Fill in the IP address and port to open a specific port in CSF Firewall for a specific IP. All commands need done as Root

Port to open in firewall.
IP for destination/source opened port in firewall.
cPanel username is required for outbound opened port in firewall.
Comment/TicketID for rule. Format: # Client ID: $CLIENTID, Service ID: $SERVICEID, Reason: REASON - $LDAPUSER
CSF TCP port rules
Allow incoming traffic from 18.97.9.175 and TCP port:587

Allow outgoing traffic via TCP port:587 to 18.97.9.175


CSF UDP port rules
Allow incoming traffic from 18.97.9.175 and UDP port:587

Allow outgoing traffic via UDP port:587 to 18.97.9.175

If converting rules from APF /etc/apf/allow_hosts.rules see below reference for difference. Change the ":" to "|" on whole rule set and append to /etc/csf/csf.allow
CSF format: tcp|in|d=587|s=192.168.1.0
APF format: tcp:in:d=587:s=192.168.1.0