美文网首页
Centos 防火墙开启关闭、端口开放

Centos 防火墙开启关闭、端口开放

作者: 城北客运站徐公 | 来源:发表于2019-04-13 19:52 被阅读0次

一.Centos 6

1.防火墙开启关闭

[root@xuyj~] service iptables restart/start/stop

2.端口开放

#以8080端口为例
[root@xuyj~] /sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT  #写入修改
[root@xuyj~] /etc/init.d/iptables save   #保存修改
[root@xuyj~] service iptables restart    #重启防火墙,修改生效

二.Centos 7

1.防火墙开启关闭

[root@xuyj~] systemctl restart/start/stop firewalld.service

2.端口开放

#permanent 为永久
[root@xuyj~] firewall-cmd --zone=public --add-port=8388/tcp --permanen

相关文章

网友评论

      本文标题:Centos 防火墙开启关闭、端口开放

      本文链接:https://www.haomeiwen.com/subject/ktirwqtx.html