linux运维开发(一)----------防火墙

解决问题:

Linux是系统部署常用的系统,但是经常由于我们忘记防火墙的存在导致访问失败,为了解决这个问题,我们需要对防火墙进行关闭操作,对于常见的系统我们提供了以下几种解决方式:

centos 7:

centos7防火墙查看
暴力解决 ------ 整体关闭

systemctl stop firewalld & systemctl disable firewalld

systemctl stop firewalld 命令只是临时关闭防火墙,dsystemctl disable firewalld是永久关闭

优雅关闭 ------ 开启端口

firewall-cmd --zone=public -add-port=9999/tcp --permanent
firewalld-cmd --reload

查看是否开启成功:

firewall-cmd --zone=public --list-ports | grep 9999

centos 6:

查看防火墙是否关闭:

service iptables status

暴力解决 ------ 整体关闭

service iptables stop & chkconfig iptables off

优雅关闭 ------ 开启端口

iptables -A INPUT -p tcp --dport 9999 -j ACCEPT

更多问题可以加公众号:代码小栈,期待为您解决更多问题
代码小栈

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章