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

iptables -L

returns

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!

3 Replies

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?

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…

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

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct