LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 08-23-2010, 04:41 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 509

Rep: Reputation: 31
How to check if a port is allowed in iptables?


I want to check if a port is allowed in iptables. How to do this?
 
Old 08-23-2010, 05:00 AM   #2
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
iptables -L

as root user
 
Old 08-23-2010, 05:18 AM   #3
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 509

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by chrism01 View Post
iptables -L

as root user
I got followings:

Code:
[root@s003ap25-test ~]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
Assumed I will check the port 8999 is allowed in the iptables, how can I do this?
 
Old 08-23-2010, 05:28 AM   #4
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 49
You do not have any rules configured in Iptables. It is showing empty table. To check the opened ports in iptables, you may use the following command,

iptables -nL | grep <port number>
 
1 members found this post helpful.
Old 08-23-2010, 05:38 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 509

Original Poster
Rep: Reputation: 31
I type

iptables -nL | grep 8999

But I get nothing shown. What does this mean?

Then I try and iptables -nL. But still nothing shown.

Last edited by thomas2004ch; 08-23-2010 at 05:42 AM.
 
Old 08-23-2010, 05:41 AM   #6
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 49
As I said already, the iptables in your system doesn't have any rules configured. For this reason, you are not getting anything after executing "iptables -nL | grep 8999".

You may refer the link http://www.linuxhomenetworking.com/w...Using_iptables

to configure iptables rules in your system.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Iptables can't port forward (PAT Port address translation) sfrederiksen Linux - Networking 7 12-20-2011 11:47 AM
debian iptables squid - redirect port 80 to port 8080 on another machine nickleus Linux - Networking 1 08-17-2006 01:59 AM
Iptables wide open, but no UDP packets allowed (all ports closed) please help mfeoli Linux - Networking 1 01-06-2006 10:52 AM
No Shorewall/IPtables: not inbound connections allowed psychobyte Mandriva 3 05-25-2005 02:29 AM
set time limit on allowed user in iptables? luap Linux - Networking 5 03-04-2003 11:55 PM


All times are GMT -5. The time now is 08:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration