Tuesday 10 May 2011

Commands to open tcp or udp ports on the servers


//**Following commands use to open tcp or udp ports on the server **// :--

** Before using commands for opening the port,Please make sure the specific port is already opened & 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 
 iptables -A INPUT -s 210.0.143.122 -j DROP

203.162.3.147

iptables -L

service iptables save
 
------------------------------------****************------------------------------------------

No comments:

Post a Comment