标签:systemctl conf yum with 操作 manual eject 端口 iptable
CentOs7安装配置Iptables二、安装iptables防火墙
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
//在此处下面编辑,添加80、3306、8080等端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
:wq! //保存退出
systemctl restart iptables.service //最后重启防火墙使配置生效
systemctl enable iptables.service //设置防火墙开机启动
标签:systemctl conf yum with 操作 manual eject 端口 iptable
原文地址:http://blog.51cto.com/372550/2064511