Firewall Ubuntu: iptables setting

Following are the commands to open tcp or udp ports on the server.

Before using commands for opening the port please make sure the specific port is already opend and what is the use of that port.

you can verify the port with

netstat -nap | grep : <port no>

1. You can open TCP port with

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

2. You can open UDP port with

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

after that

3 service iptables save

and for flushhing iptables us

iptables -F

Advertisements

About zephyr9000

Happy sailer
This entry was posted in Ubuntu Configuration and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s