内容简介:今天说下防火墙的操作。服务器刚刚重启完毕,先来看下防火墙的状态,输入
导语
今天说下防火墙的操作。 CentOS 6 的防火墙是 iptables , CentOS 7 默认的是 firewall ,以前的操作不再适用。
查看、开启
服务器刚刚重启完毕,先来看下防火墙的状态,输入 systemctl status firewalld 进行查看
这里是关闭的,然后把它打开,使用 systemctl start firewalld
设置为开机自动启动
输入 systemctl is-enabled firewalld ,可以查看是否设置为开机启动
那下一步就是设置为开机自动启动, systemctl enable firewalld
好的,设置完成后, reboot 重启之后再查看
查看、开启端口
先来看下 80 端口是否开启 firewall-cmd --query-port=80/tcp
简单粗暴的一个 no ,那就来开启吧。使用 firewall-cmd --zone=public --permanent --add-port=80/tcp 来开启。 zone 是作用域; --permanent 是永久生效;不然重启后就失效了; 80/tcp 是按照 端口/协议 的格式
注意,修改之后要 更新 防火墙, firewall-cmd --reload
好了,再来查看一下是否开启
这个命令是用来查看所有开启的端口, firewall-cmd --list-ports
删除一个端口就用 firewall-cmd --remove-port=80/tcp -permanent ,需要注意的是,删除之后仍然是要 更新 防火墙
参考资料: systemctl 命令 、 centos7 firewalld(防火墙)和systemctl(开机启动服务)相关 %E5%92%8Csystemctl(%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1)%E7%9B%B8%E5%85%B3)。
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- CentOS 6/7 防火墙设置 | 开启/关闭防火墙和端口
- Linux 下的防火墙
- 黑客的“攻”与“受”之防火墙
- 基于代理的防火墙安全性探讨
- Kubernetes网络与防火墙联动方案探索
- 小心AI成为2003年时的防火墙
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Game Engine Architecture, Second Edition
Jason Gregory / A K Peters/CRC Press / 2014-8-15 / USD 69.95
A 2010 CHOICE outstanding academic title, this updated book covers the theory and practice of game engine software development. It explains practical concepts and techniques used by real game studios,......一起来看看 《Game Engine Architecture, Second Edition》 这本书的介绍吧!