ServerPronto Dedicated Servers
       ServerPronto Home   ServerPronto University     
ServerPronto University  

Support of the day: Open/Close Ports on Ubuntu distributions


March 2nd, 2011

IPTables is an application program that allows to set up, maintain, and inspect the tables of IP packet filter rules provided by the Linux kernel.

All IPTables rules are stored on /etc/iptables.rules
You can open/close any port from it and then restart the network by running “etc/init.d/networking restart”

Before opening or closing ports, we recommend to first verify if the port is open or closed and who is using the port. There a number of different commands:

Commands to verify ports:

nmap IP#
nmap localhost
netstat –ntulp

to verify single port

netstat -nap | grep  <port #>

to list all current rules in iptables

iptables -L

For opening a TCP port:

iptables -A INPUT  -p tcp –dport <port #> -j ACCEPT

For opening a UDP port:

iptables -A INPUT -p udp –sport <port #>  -j ACCEPT

Save changes:

iptables-save > /etc/iptables.rules

If you need to disable the firewall temporarily, you can flush all the rules using:

iptables -F

————————————————————————————————————

For more detailed information visit

Iptables Description by Ubuntu Manuals

Iptables How-To for Ubuntu by Ubuntu Manuals

Iptables How-To for Debian by wiki.debian.org



Entry Filed under: Support of the day

 

1 Comment Add your own

Leave a Comment

hidden
Comment:

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed

 
Infolink ServerPronto Infolink Review Our Guarantee Why Choose ServerPronto? Why Choose ServerPronto? Review Our Guarantee Home About Why Choose ServerPronto? Compare Packages Frequently Asked Questions (FAQ) Order Now!