Linux防火墙Iptables设置
参考来源:
http://www.zrblog.net/7027.html
http://www.2cto.com/Article/201309/245198.html
http://blog.163.com/dk_linux/blog/static/203226166201261323349658/
http://blog.chinaunix.net/uid-26495963-id-3279216.html
Step1: 修改规则
查看规则编号 iptables -L -n --line-numbers
开放端口 添加在第10条 iptables -I INPUT 10 -m state --state NEW -m tcp -p tcp --dport 9316 -j ACCEPT
开放端口(追加) iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 9316 -j ACCEPT
删除规则: iptables -D INPUT 1
Usage: iptables -[ACD] chain rule-specification [options]
iptables -I chain [rulenum] rule-specification [options]
iptables -R chain rulenum rule-specification [options]
iptables -D chain rulenum [options]
Step2: 保存规则
service iptables save
Step3: 重启,生效
service iptables restart
Tips: 如何从客户端判断远程linux服务器的某个端口已经打开
telnet ip 端口
举例:telnet 192.168.0.33 22