centos 7 防火墙

firewall-cmd --zone=public --add-port=80/tcp --permanent       添加端口
firewall-cmd --zone=public --remove-port=80/tcp --permanent    删除端口
firewall-cmd --zone=public --list-ports    查看开放的端口
firewall-cmd --reload   重新加载
启动:systemctl start firewalld

查看状态:systemctl status firewalld

停止: systemctl disable firewalld

禁用: systemctl stop firewalld

============================

启动iptables

systemctl start iptables.service

systemctl start iptables #启动

systemctl status iptables #查看运行状态

systemctl restart iptables.service #重启

systemctl stop iptables.service #停止

systemctl enable iptables.service #设置开机启动

systemctl disable iptables.service #禁止开机启动

评论