I resolved the problem, iptables was working correctly, but postfix doesn't start automatically, I'm willing to give the points if someone can instruct me to set postfix to start up automatically in Redhat? I can do it in Gentoo, but Redhat eludes me.
==========================
==========
==========
==========
==========
==========
==========
=======
We have iptables setup on a linux server. I was trying to get the iptables to save properly and somehow, things have gone awry. By executing:
iptables -I INPUT 1 -p tcp --dport 25 -j ACCEPT
I was able to telnet to the port after a reboot:
telnet community.nyln.org 25
Trying 75.19.188.102...
Connected to community.nyln.org.
Escape character is '^]'.
220 metadot.nyln.org ESMTP Postfix
^]
telnet> quit
Connection closed.
I thought executing
iptables-save > /etc/sysconfig/iptables.sa
ve
was enough to save on reboot, but it wasn't. I ended up with multiple rules accepting port 25 (accidentally on my part), and now I cannot get a telnet connection to work at all.
On reboot, this is my iptables:
[root@server sbin]# ./iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- adsl-70-244-126-158.dsl.au
sttx.swbel
l.net anywhere tcp dpt:ssh
ACCEPT tcp -- 192.168.0.0/16 anywhere tcp dpt:ssh
DROP tcp -- anywhere anywhere tcp dpt:ssh
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
ACCEPT ipv6-crypt-- anywhere anywhere
ACCEPT ipv6-auth-- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Trying to telnet in gives this:
telnet mail.nyln.org 25
Trying 75.19.188.102...
telnet: Unable to connect to remote host: No route to host
I then run:
iptables -I INPUT 1 -p tcp --dport 25 -j ACCEPT
giving me this:
[root@server sbin]# ./iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
ACCEPT tcp -- adsl-70-244-126-158.dsl.au
sttx.swbel
l.net anywhere tcp dpt:ssh
ACCEPT tcp -- 192.168.0.0/16 anywhere tcp dpt:ssh
DROP tcp -- anywhere anywhere tcp dpt:ssh
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere
ACCEPT ipv6-crypt-- anywhere anywhere
ACCEPT ipv6-auth-- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
telnet then tells me this:
telnet mail.nyln.org 25
Trying 75.19.188.102...
telnet: Unable to connect to remote host: Connection refused
Really stuck, any help?
Start Free Trial