| Author |
Message |
jcr
Joined: 14 May 2007
Posts: 76
|
| Posted: Sat Mar 12, 2011 10:20 am Post subject: iptables centos 5 |
|
|
Hello,
My linode works fine with Centos 5.5, two IPs (one for Apache and one for Nginx). ports 80and 21 are obviously open.
Now, I am struggling to open port 30000.
What puzzles me is that
Code:
iptables -L
returns
Code:
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
It looks like my current rules are somewhere else and that would explain why adding rules for port 30000 does not work. But I don't really understand what's going on here.
Where are the rules for ports 80 declared?
How could I add rles so that I can run bidirectionnal socket on that port.
(I need that 30000 port to communicate with Canada Post's shipping module
Thanks! |
|
| Back to top |
|
Vance
Joined: 18 Jan 2009
Posts: 351
|
| Posted: Sat Mar 12, 2011 8:53 pm Post subject: |
|
|
CentOS keeps its firewall rules in the /etc/sysconfig/iptables file.
According to the output you posted, your firewall is accepting all connections. What makes you think that port 30000 is not open? |
|
| Back to top |
|
jcr
Joined: 14 May 2007
Posts: 76
|
| Posted: Sat Mar 12, 2011 10:14 pm Post subject: |
|
|
What makes me think that port 30000 is closed? That my script requiring port 300000 did not work of course! Since what you suggested made quite a bit of sense, I reviewed my script... found a problem... and, guess what?, I can now connect to CanadaPost.
Thanks a ton!
I guess I should consider closing all those ports... |
|
| Back to top |
|
sleddog
Joined: 31 Aug 2008
Posts: 101
|
| Posted: Sun Mar 13, 2011 8:54 am Post subject: |
|
|
A port isn't "open" unless something is listening on it.
To see open (listening) TCP ports, try:
netstat -ltn
And for UDP ports:
netstat -lun |
|
| Back to top |
|
| |