centos下iptables和ip6tables設置

ssh端口修改:html

http://jingyan.baidu.com/article/414eccf61b23ca6b431f0ad8.htmlcentos

啓停查看狀態:bash

http://www.centoscn.com/CentOS/help/2015/0708/5813.htmlssh

參數解釋:tcp

http://blog.csdn.net/chtdsl/article/details/8882239.net

 

http://blog.csdn.net/canot/article/details/51289176rest

 

 

 

 

#!/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 ;htm

保存以後 /etc/sysconfig/  出現iptable.save....blog

必須在reject以前 須要選擇順序ip

/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;

相關文章
相關標籤/搜索