Please Note: This article is part of our historical archive. Because it was published a while ago, some of the information, links, or context may now be outdated.
Are you looking for steps for Zimbra firewall configuration with UFW and firewalld? Take a peek at this blog.
Here at Bobcares, we have seen several such Zimbra related queries as part of our Server Management Services for web hosts and online service providers.
Today we’ll take a look at the restoration process of the Zimbra LDAP database from backup.
Installing UFW on Ubuntu and CentOS
Before we get into the configuration of the Zimbra firewall, let’s first install UFW and Firewalld.
In order to install UFW on Ubuntu, we run the below command.
sudo apt-get update && sudo apt-get -y install ufwThen for CentOS, the UFW package is available on EPEL repositories. So we run the below commands.
sudo yum -y install epel-release sudo yum makecache fast sudo yum -y install ufw
Installing Firewalld on CentOS 7.x
If CentOS doesn’t have Firewalld already then we can install it using the below commands.
sudo makecache fast sudo yum -y install firewalldNext, we start and enable the firewalld service.
sudo systemctl start firewalld sudo systemctl enable firewalldFor Debian, we run the below commands.
sudo apt update sudo apt -y install firewalld
Zimbra Firewall configuration using UFW
Now let’s take a deep look at how our Support Engineers configure Zimbra firewalld.
For UFW, we shall create an application profile for UFW called Zimbra as given below:
sudo vim /etc/ufw/applications.d/zimbraNext, we add the following content.
[Zimbra] title=Zimbra Collaboration Server description=Open source server for email, contacts, calendar, and more. ports=22,25,80,110,143,161,389,443,465,514,587,993,995,7071,8443,11211/tcpThen we enable app profile on ufw
sudo ufw allow Zimbra sudo ufw enableAlso, we add ssh port by running the below command.
sudo ufw allow sshIn case, if we wish to make any Zimbra profile then we update it using the command.
$ sudo ufw app update Zimbra Rules updated for profile ‘Zimbra’ Skipped reloading firewallFor a single server installation, Memcache is not used outside the local server. We consider binding it to the loopback IP address by running the below commands.
sudo su – zimbra zmprov ms zmhostname zimbraMemcachedBindAddress 127.0.0.1 zmprov ms zmhostname zimbraMemcachedClientServerList 127.0.0.1Then we restart the Memcached service.
sudo su – zimbra -c “zmmemcachedctl restart”
Zimbra Firewall configuration using Firewalld
First, we confirm if firewalld is in a running state or not.
sudo firewall-cmd –state runningIf not, then we start it by executing the below command.
sudo systemctl start firewalldAfter that, we configure Zimbra ports and services on the firewall.
sudo firewall-cmd –add-service={http,https,smtp,smtps,imap,imaps,pop3,pop3s} –permanent sudo firewall-cmd –add-port 7071/tcp –permanent sudo firewall-cmd -add-port 8443/tcp –permanentNow, we reload the firewalld configurations by running the below command.
sudo firewall-cmd –reloadThen we confirm the runtime settings.
$ sudo firewall-cmd –list-all public target: default icmp-block-inversion: no interfaces: sources: services: dhcpv6-client http https imap imaps pop3 pop3s smtp smtps snmp ssh ports: 7071/tcp 8443/tcp[Need any further assistance with Zimbra related queries? – We are here to help you.]
Conclusion
In today’s writeup, we saw how our Support Engineers configure Zimbra firewalls with UFW and firewalld.