[SOLVED] problem to open a port

Issues related to configuring your network
Post Reply
wighou
Posts: 10
Joined: 2012/11/15 18:36:36

[SOLVED] problem to open a port

Post by wighou » 2012/11/19 14:30:51

Hello,

I followed a little tutorial to open a port.
I edited
/etc/sysconfig/iptables
I added
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5280 -j ACCEPT
I restarted the firewall
service iptables restart

But the port remains closed :
> nmap -v -sV localhost -p 5280

Starting Nmap 5.51 ( http://nmap.org ) at 2012-11-19 11:27 BRT
NSE: Loaded 8 scripts for scanning.
Initiating SYN Stealth Scan at 11:27
Scanning localhost (127.0.0.1) [1 port]
Completed SYN Stealth Scan at 11:27, 0.01s elapsed (1 total ports)
Initiating Service scan at 11:27
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000056s latency).
Other addresses for localhost (not scanned): 127.0.0.1
rDNS record for 127.0.0.1: bio1
PORT STATE SERVICE VERSION
5280/tcp closed xmpp-bosh

Read data files from: /usr/share/nmap
Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 0.14 seconds
Raw packets sent: 1 (44B) | Rcvd: 2 (84B)

What is the problem with my configuration ?

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: problem to open a port

Post by TrevorH » 2012/11/19 17:18:38

You need to make sure you added the rule before the final REJECT one in the default ruleset. If this doesn't apply to you then post the output of the iptables-save command.

wighou
Posts: 10
Joined: 2012/11/15 18:36:36

Re: problem to open a port

Post by wighou » 2012/11/20 19:49:08

Hello TrevorH,

yes, I added this line before REJECT.
Finally, I solved the problem. I changed the command to :
-A INPUT -p tcp --dport 5280 -j ACCEPT

Now, the port is open.
thanks for your help

User avatar
AlanBartlett
Forum Moderator
Posts: 9345
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

[SOLVED] problem to open a port

Post by AlanBartlett » 2012/11/21 01:32:03

Thank you for reporting back with your positive result.

On your behalf and for posterity, this thread is now marked [SOLVED].

Post Reply