LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to open port at iptable? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-open-port-at-iptable-837506/)

windstory 10-11-2010 07:58 PM

how to open port at iptable?
 
How to open port at iptable?

My box is centos 5.4.

I wanto to open UDP 177 and TCP 6000~60010.

I can connect my box through putty now.

Helpful comment would be appreciated.

frankbell 10-11-2010 08:25 PM

http://www.iptables.org/ or http://security.maruhn.com/iptables-tutorial/ should help.

I like to use Firestarter or an rc.firewall script for a frontend to iptables, mostly because I'm used to them.

In rc.firewall, you use a PERMIT statement. For example:

PERMIT="192.168.1.0/8:137-139/tcp"

Syntax:

PERMIT="[network or computer ip address]/[netmask]:[port/port range]/[protocol]"

This is part of the PERMIT that open my file server to tcp from other computers in my local network.

The rc.firewall script is usually heavily annotated, but the Firestarter GUI is friendlier, lots friendlier.

windstory 10-11-2010 08:31 PM

frankbell/

Thanks a lot!

I'm insterested in Firestarter GUI, I'll study it.

sandebains 10-11-2010 08:59 PM

Hi, I assume you are looking for inbound traffic, you can use the below commands

iptables -A INPUT -i <interface> -p udp --dport 177 -j ACCEPT

iptables -A INPUT -i <interface> -p udp -m multiport --dports 6000:60010 -j ACCEPT

instead of using -i <interface>, you can also use the -s <IP Address>

Sandeep

frankbell 10-13-2010 09:44 PM

Quote:

Originally Posted by windstory (Post 4124448)
I'm insterested in Firestarter GUI, I'll study it.

Firestarter is one of the friendliest firewall frontends I have used under either Windows or Linux, assuming that one understands the concept of a port. It does require Gnome libraries.


All times are GMT -5. The time now is 11:31 AM.