[SOLVED] problem to open a port

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

[SOLVED] problem to open a port

Postby wighou » 2012/11/19 14:30:51


I followed a little tutorial to open a port.
I edited
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 ( [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 (
Host is up (0.000056s latency).
Other addresses for localhost (not scanned):
rDNS record for bio1
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
Forum Moderator
Posts: 20325
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: problem to open a port

Postby 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.

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

Re: problem to open a port

Postby 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
Forum Moderator
Posts: 9310
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk

[SOLVED] problem to open a port

Postby 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].