CentOS7防火墙和端口相关命令介绍
目录[*]1、查看防火墙当前状态
[*]2、启动防火墙服务
[*]3、关闭防火墙服务
[*]4、开放指定端口
[*]5、移除指定端口,需重启防火墙服务才能生效
[*]6、重启防火墙
[*]7、设置防火墙开机自启动
[*]总结
以下情况对应的linux系统版本为CentOS7,若使用的环境为CentOS6请使用service iptables state/start/stop/restart替换对应的systemctl status /start/stop/restart firewalld.service命令;
1、查看防火墙当前状态
方法1
# firewall-cmd --state
not running ---未运行
# firewall-cmd --state
running ---运行中方法2
# systemctl status firewalld.service正常运行中
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
页:
[1]