Jul 16, 2012

0 How to open port with IP tables.



ethX = X is number of your adapter. (usually it's 0)

You can check it with :  ipconfig -a

Opening port 22 for TCP/IP protocol.

iptables -A INPUT -i ethX -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -o ethX -p tcp --sport 22 -m state --state ESTABLISHED -j ACCEPT

Opening port 22 for UDP protocol.

iptables -A INPUT -i ethX -p udp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT

iptables -A OUTPUT -o ethX -p udp --sport 22 -m state --state ESTABLISHED -j ACCEPT

Note : You can change port number to any number you need.

0 comments :

Post a Comment

Comment: