centos下iptables和ip6tables设置
ssh端口修改:
http://jingyan.baidu.com/article/414eccf61b23ca6b431f0ad8.html
启停查看状态:
http://www.centoscn.com/CentOS/help/2015/0708/5813.html
参数解释:
http://blog.csdn.net/chtdsl/article/details/8882239
http://blog.csdn.net/canot/article/details/51289176
#!/bin/bash
/sbin/ip6tables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT;
/sbin/ip6tables -A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT;
/sbin/iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT;
/etc/rc.d/init.d/iptables save;
/etc/rc.d/init.d/ip6tables save;
service iptables restart ;
service ip6tables restart ;
保存之后 /etc/sysconfig/ 出现iptable.save....
必须在reject之前 需要选择顺序
/sbin/ip6tables -I INPUT 4 -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT;
/sbin/ip6tables -I INPUT 5 -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT;
/sbin/iptables -I INPUT 1 -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT;
/etc/rc.d/init.d/iptables save;
/etc/rc.d/init.d/ip6tables save;