服务启动操作:
启动防火墙
[root@localhost ~]# systemctl start firewalld
关闭防火墙
[root@localhost ~]# systemctl stop firewalld
重启防火墙
[root@localhost ~]# systemctl restart firewalld
查看防火墙状态
[root@localhost ~]# systemctl status firewalld
防火墙配置命令
重载防火墙配置
[root@localhost ~]# firewall-cmd --reload
查看防火墙运行状态
[root@localhost ~]# firewall-cmd --state
查看默认区域
[root@localhost ~]# firewall-cmd --list-all
应急模式
拒绝所有流量,断开远程连接
[root@localhost ~]# firewall-cmd --panic-on
取消应急模式
[root@localhost ~]# firewall-cmd --panic-off
查看是否为应急模式
[root@localhost ~]# firewall-cmd --query-panic
服务
firewall-cmd --add-service=Telnet #添加服务
firewall-cmd --remove-service=Telnet #移除服务
端口
添加端口和协议
[root@localhost ~]# firewall-cmd --add-port=3306/tcp
删除端口和协议
[root@localhost ~]# firewall-cmd --remove-port=3306/tcp
查看开启的端口
@localhost ~]# firewall-cmd --list-ports
协议
添加协议
[root@localhost ~]# firewall-cmd --remove-protocol=icmp
取消协议
[root@localhost ~]# firewall-cmd --remove-protocol=icmp
查看添加的协议
firewall-cmd --list-protocols
最后
以上就是英勇跳跳糖最近收集整理的关于linux 防火墙的使用方法,Linux防火墙(firewalld)使用方法,的全部内容,更多相关linux内容请搜索靠谱客的其他文章。
发表评论 取消回复