Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Firewall – Ports to open on your firewall (OPNSense)

by Jan Bachelor October 31, 2024
  • On OPNSense, go to Firewall → Rules → WAN 1 (or whatever the name of your inteface is).
  • Here is a list of ports used by iRedMail services – not all of them need to be opened.
    • Port 80 and 443 for HAProxy (unless you have it set up already)
    • Port 25: required for mail server exchange.
    • Port 993 for IMAP over SSL
  • We will not need to open ports for SMTP since we will be using the relay by default. This is safer in case the public IP changes to ensure that communication can be sent out.
  • Firewall rules – go to Firewall → Rules → WAN 1 (or just WAN) and click on the + sign to make sure you have the following set up

  • Rule 1: Port 80
    • Action: Pass
    • Interface: WAN
    • Direction: in
    • TCP/IP: IPv4
    • Protocol: TCP
    • Destination: This Firewall
    • Destination port range: from HTTP to HTTP
OPNSense – Adding A Firewall Rule
  • Rule 2: Port 443
    • Same as above with the difference of the port range starting from HTTPS to HTTPS (or choose ‘other’ and manually type 443 in both boxes).

  • Rule 3: Port 25
    • Destination here is not ‘This firewall’ but ‘LAN net’ since we will be forwarding it as a NAT rule to our mail server later.
    • Port range starting from SMTP to SMTP (or choose ‘other’ and manually type 25 in box boxes).
OPNSense Firewall Allow Port 25
  • Rule 4: Port 993 (IMAPS)
    • As before, the Destination is not ‘This firewall’ but ‘LAN net’.
    • Port range starts from IMAPS to IMAPS (or 993 to 993)
OPNSense Firewall Allow Port 993 – IMAPS
  • Rule 5: Port 465 (SMPTS)
    • As before,the Destination is not ‘This firewall’ but ‘LAN net’
    • Port range starts from SMTPS to SMPTS (or 465 to 465). Alternatively, you can use port 587 if you manually define it (then you must be consistent even with the NAT rule and how you connect your email client).
OPNSense Firewall Allow Port 465 – SMTPS
  • Once done, remember to click on the ‘Apply Settings’ button for the changes to take an effect before moving to the NAT rules.
Firewall - static DHCP assignment (OPNsense)
Fiirewall- Set Up NAT Rules (OPNSense)
Go back to course overview: Install iRedMail Mail Server As Proxmox VM With OPNSense As Firewall

Leave a Comment Cancel Reply

Save my name, email, and website in this browser for the next time I comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 FacebookWhatsappEmail

Course Steps

  1. Starting Point and Considerations
  2. Pointing Your MX Records (DNS)
  3. Generic VM Installation (Proxmox)
  4. Firewall - static DHCP assignment (OPNsense)
  5. Firewall - Ports to open on your firewall (OPNSense)
  6. Fiirewall- Set Up NAT Rules (OPNSense)
  7. Dynamic DNS for our ‘mail’ DNS record (CloudFlare with OPNSense)
  8. Get SSL Certificate on OPNSense for Web Services (CloudFlare)
  9. HAProxy Set Up - SSL termination (OPNSense)
  10. Services To Be Installed On Our Mail Server (OPTIONAL)
  11. iRedMail installation (Debian)
  12. Nginx Configuration (Debian)
  13. Access iRedAdmin
  14. Configure Roundcube
  15. CertBot Certificate Creation
  16. Apply Certificates - Nginx
  17. A Theory Crash Course On Postfix (OPTIONAL)
  18. Securing Your Mail Server (Postfix)
  19. SMTP Relay With Brevo
  20. Testing your outgoing email ranking
  21. Connect Your Device To The Mail Server Via Email Client
Previous Next

Recent Comments

  • Jan Bachelor on Dynamic DNS Set Up with DuckDNS on OPNSenseHi Jake, that's awesome, congratulations on getting…
  • Jake on Dynamic DNS Set Up with DuckDNS on OPNSensefollowed guide above to the T and all is working. i…
  • Fastbrain on Dynamic DNS Set Up with DuckDNS on OPNSenseThanks for the guide. For some reason, after follow…

Other courses

Install iRedMail Mail Server As Proxmox VM With...

October 31, 2024

Remote Bucket Storage for Proxmox VM Backups

August 16, 2024

Concur Alternative: Import Employees’ Credit Card Expenses to...

January 19, 2024

Create an automated Gravity workflow that will allow...

January 19, 2024

Dynamically Populate Gravity Forms from Google Sheets (GSheets...

March 16, 2021
Bachelor Tech
  • Home
  • Tutorials
  • Portfolio
  • About Jan
  • Contact Jan

Recent Posts

  • How to join two Proxmox nodes into a cluster (PVE 8.x)

  • How to Rename a Proxmox Node

  • How to mount an NFS share on an Android box

Facebook Twitter Instagram Pinterest Linkedin Youtube

All Rights Reserved. The theme was customized from Soledad, see PenciDesign