How to Allow Mail Server Samba, FTP and NFS in Firewall | Allow SMTP IMAPs and POP3 in Firewall |
tags: How to allow mail server in firewall, allow samba service in firewall, firewall-cmd --add-services, allow NFS and FTP, Allow SMTP, Imaps, POP3
Q : How to Allow Mail service in firewall using firewall-cmd command ?
Before we start to add mail service in firewall we will check all services and allow service in active firewall zone,below command we will use
firewall-cmd --get-services
firewall-cmd --list-all
We will get info about all mail services, means which ports is used by service and allow by firewall.
firewall-cmd --info-service=smtpfirewall-cmd --info-service=smtpsfirewall-cmd --info-service=smtp-submissionfirewall-cmd --info-service=pop3
firewall-cmd --info-service=pop3sfirewall-cmd --info-service=imapfirewall-cmd --info-service=imaps
It will display, 25/tcp port used by smtp and 465/tcp by smtps and so forth
To allow mail service like smtp and smtps in firewall
firewall-cmd --add-service=smtp --permanent
firewall-cmd --add-service=smtps --permanent
We require to allow another service like smtp-submission for mail access
firewall-cmd --add-service=smtp-submission --permanent
To allow POP3 and POP3s Service in Firewall
firewall-cmd --add-service=pop3 --permanent
firewall-cmd --add-service=pop3s --permanent
To allow IMAP and IMAPs Service in Firewall
firewall-cmd --add-service=imap --permanent
firewall-cmd --add-service=imaps --permanent
After the adding we will reload the firewall to update all changes,
firewall-cmd --reload
Now we will check all services to added in firewall
firewall-cmd --list-all
Q : How to Allow SAMBA Server in Firewall ?
We will allow samba and samba-client service for accessing a samba server
To information about samba service
firewall-cmd --info-service=samba
firewall-cmd --info-service=samba-client
firewall-cmd --info-service=samba-client
Q : Which ports is using by samba server ?
Samba is using following tcp and udp ports
137/tcp
138/udp
139/tcp
445/tcp
To allow SMB service in firewall
firewall-cmd --add-service=imap --permanent
firewall-cmd --add-service=imaps --permanent
firewall-cmd --add-service=imaps --permanent
To Reload firewall service
firewall-cmd --reload
Now we will check all services to added in firewall
firewall-cmd --list-all
Allow NFS Server in Firewall
To info about NFS service
firewall-cmd --info-service=nfs
NFS use 2049/tcp port
To allow SMB service in firewall
After the adding we will reload the firewall to update all changes,
firewall-cmd --reload
Now we will check all services to added in firewall
firewall-cmd --list-all
Allow FTP Server in Firewall
To get info about FTP services
firewall-cmd --info-service=ftpfirewall-cmd --add-service=ftp --permanentfirewall-cmd --reloadfirewall-cmd --list-all
To know about more :