open port 8000:
iptables -I INPUT -p tcp --dport 8000 -j ACCEPT
save new configuration. if don't, the port will return closed where iptables restarted:
service iptables save
A sample iptables rule to open Linux iptables firewall
/sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
OR only allow remote connection from your web server located at 10.5.1.3:
/sbin/iptables -A INPUT -i eth0 -s 10.5.1.3 -p tcp --destination-port 3306 -j ACCEPT
OR only allow remote connection from your lan subnet 192.168.1.0/24:
/sbin/iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp --destination-port 3306 -j ACCEPT
test it:
$ telnet 65.55.55.2 3306
note:
if the above steps doesn't work try this..
/sbin/iptables -I INPUT -p tcp -s 202.1.9.17 --dport 5434 -j ACCEPT
[user@server ~]$ sudo /etc/init.d/iptables save
Saving firewall rules to /etc/sysconfig/iptables: [ OK ]
ref:
http://www.linuxquestions.org/questions/linux-security-4/how-to-open-ports-with-iptables-237939/
https://help.ubuntu.com/community/IptablesHowTo
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
https://help.ubuntu.com/community/IptablesHowTo
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html
No comments:
Post a Comment