Adding port 25 to iptables won't getting to open centOS

6,570

The iptables rule is fine, but according to nmap's output I don't think that you have any service running in that port.

Confirm that by running the following command:

netstat -nltp | grep 25

If the output does not show anything in that port, be sure to start the appropriate service.

Share:
6,570

Related videos on Youtube

user968898
Author by

user968898

Updated on September 18, 2022

Comments

  • user968898
    user968898 over 1 year

    I am facing a problem to open port 25 with iptables on my CentOS machine. I checked the connection by 'nmap' and 'telnet' but both failed.

    The follow things I did to trying make this work:

    iptables -I INPUT -p tcp --dport 25 -j ACCEPT
    
    /sbin/service iptables save
    
    /sbin/service iptables restart
    

    OUTPUTS:

    # iptables -L -n
    Chain INPUT (policy DROP)
    target     prot opt source               destination         
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:25 
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:32315 
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:80 
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:443 
    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:8443 
    ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:25 
    ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:465 
    
    Chain FORWARD (policy DROP)
    target     prot opt source               destination         
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination      
    
    
    
    
    # nmap localhost
    
    Starting Nmap 5.51 ( http://nmap.org ) at 2014-02-08 01:46 CET
    Nmap scan report for localhost (127.0.0.1)
    Host is up (0.000015s latency).
    Not shown: 996 closed ports
    PORT     STATE SERVICE
    80/tcp   open  http
    443/tcp  open  https
    2222/tcp open  EtherNet/IP-1
    8443/tcp open  https-alt
    
    Nmap done: 1 IP address (1 host up) scanned in 0.16 seconds
    
    • Zoredache
      Zoredache about 10 years
      How exactly do you know there is a problem? What are you doing that is failing? Are you trying to run a mail server, or what? If a mail server, then are you sure it is running? We need more details here.