We have an excellent guide on using iptables to manage your firewall by port or by IP address for IPv4 and IPv6 here.
Here are some example rules that can accomplish allowing port 25 traffic:
iptables -A INPUT -i eth0 -p tcp --dport 25 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o eth0 -p tcp --sport 25 -m state --state ESTABLISHED -j ACCEPT
We also have a suite of guides on firewalls and firewall configuration tools like UFW (Uncomplicated Firewall) here.
I hope that helps!
We wanted to update this post with a link about our policy regarding mail server ports for new Linode customers. You can find more information about this in the below Community site post.
I tried this and many other things, but I can't open ports on my linodes.
Still port 25 blocked.
NOT using a firewall, so how could it be ports blocked?
Support says I all my limits are lifted
I'm going crazy
I want to open port 25.
No matter what I do, I see this same thing:
Starting Nmap 7.60 ( https://nmap.org ) at 2022-01-13 23:14 -05
Nmap scan report for mail.agencia.click (184.108.40.206)
Host is up (0.0000070s latency).
Not shown: 997 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
I have no firewall, so who is blocking?
How I could open port 25?
Support says that all blocking of email ports are lifted on all my linodes.