Configure FirewallD for Mail Server in Centos 7

Configure FirewallD for Mail Server

Configure FirewallD for Mail Server in Centos 7A mail server (or email server) is a computer system that sends and receives email. In many cases, web servers and mail servers are combined in a single machine. However, large ISPs and public email services (such as Gmail and Hotmail) may use dedicated hardware for sending and receiving email. In order for a computer system to function as a mail server, it must include mail server software. This software allows the system administrator to create and manage email accounts for any domains hosted on the server

Configure FirewallD for Mail Server

Check if firewalld is installed:

# which firewalld
/usr/bin/which: no firewalld in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

If not installed, install firewalld:

# yum install firewalld

Ensure that firewalld is running:

# systemctl start firewalld

List allowed services:

# firewall-cmd --list-service
dhcpv6-client ssh

How to Install Percona 8 in CentOS 7

Add required services: HTTPS, SMTP, IMAP, POP3, DAV, DHCP(May be required in a testing environment).

# firewall-cmd --zone=public --add-service=smtp --add-service=smtps --add-service=imap --add-service=imaps --add-service=pop3 --add-service=pop3s --add-service=https --add-service=dhcp --permanent
# firewall-cmd --zone=public --add-port=587/tcp --add-port=8443/tcp --permanent

Reload firewalld

# firewall-cmd --reload

List allowed services and ports. Check for previously added additions firewalld list rules

# firewall-cmd --list-all | grep 'services\|ports' | head -n 2
services: dhcpv6-client https imap imaps pop3 pop3s smtp smtps ssh
ports: 8443/tcp 587/tcp

Enable DNS over HTTPS (DoH) on Mikrotik

Tags : firewalldfirewalld centos 7firewalld list rulesfirewalld open port

Leave a Response

We would like to show you notifications for the latest news and updates.
Allow Notifications