Zimbra Firewall Configuration with ufw for Ubuntu

Windows Articles

How to update apps on Android

Hi folks! In this post, we will show you how to update your Android apps. Updating the apps on your device is...

How to install Apache Ant on Ubuntu 20.04?

Hello, friends. Apache Ant is a very important tool for the development of applications in Java. So in this post, we will...

How to use the ss command

For Linux users, there will come a time when you need to know about the network. Several tools help in this process,...

How to create user template in Windows Server 2019/2016

Hello! Windows Server has many features that support system administration. For example, through the users it is possible to manage many administrative...

Debian 10.6 available

Several volunteers have developed the free software distributed under the name of Debian. Debian does not sell its software directly, the developers...

Previously we had cover the Installation of Zimbra Collaboration on Ubuntu 18.04. Today, we will go through the Firewall configuration with ufw for Ubuntu 18.04.

Installing UFW on Ubuntu

Install the UFW on Ubuntu by executing the command as

sudo apt-get update && sudo apt-get -y install ufw

Configure Zimbra Firewall usign UFW

Because of recent Memcache amplification attacks for UDP ports, we won’t enable udp port as it will cause serious problems. Due to this reason we will use only tcp ports which is protected from these.

Because we need an application profile for UFW, so let’s create this profile as:

sudo nano /etc/ufw/application.d/zimbra

Then add the following lines

[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/tcp

After that enable app profile on ufw

sudo ufw allow Zimbra
sudo ufw enable

Then add ssh port as

sudo ufw allow ssh

To make any changes to the Zimbra profile, update it using:

$ sudo ufw app update Zimbra
Rules updated for profile 'Zimbra'
Skipped reloading firewall

Because for a single server installation, Memcache is not used outside the local server, consider binding it to the loopback ip address. So, use the commands:

sudo su - zimbra
zmprov ms zmhostname zimbraMemcachedBindAddress 127.0.0.1
zmprov ms zmhostname zimbraMemcachedClientServerList 127.0.0.1

Then restart Memcache services.

sudo su - zimbra -c "zmmemcachedctl restart"

Restricting Access to Admin dashboard

As it is a good practice to always restrict access to port 7071 to a trusted network or IP, so do it by typing:

$ sudo ufw allow from 192.168.1.10 to any port 7071
$ sudo ufw allow from 192.168.1.0/24 to any port 7071

So, this is how you can configure your Zimbra Server with firewall using ufw on Ubuntu 18.04 LTS.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to update apps on Android

Hi folks! In this post, we will show you how to update your Android apps. Updating the apps on your device is...

How to install Apache Ant on Ubuntu 20.04?

Hello, friends. Apache Ant is a very important tool for the development of applications in Java. So in this post, we will...

How to use the ss command

For Linux users, there will come a time when you need to know about the network. Several tools help in this process,...

How to create user template in Windows Server 2019/2016

Hello! Windows Server has many features that support system administration. For example, through the users it is possible to manage many administrative...

Debian 10.6 available

Several volunteers have developed the free software distributed under the name of Debian. Debian does not sell its software directly, the developers...