Linux查看防火墙日志
Linux查看防火墙日志CentOS系统查询防火墙日志
·
CentOS系统查询防火墙日志
firewalld的默认配置是不记录日志,需要单独配置
1、配置防火墙记录reject日志
编辑/etc/firewalld/firewalld.conf文件将其中的”LogDenied=off”调整为”LogDenied=all“(off表示关闭不记录被拒绝日志,all表示记录所有被拒的日志)
[root@localhost ~]# vi /etc/firewalld/firewalld.conf
[root@localhost ~]# grep LogDenied= /etc/firewalld/firewalld.conf
LogDenied=all
[root@localhost ~]#
2、重启firewalld服务并验证
重启firewalld服务
[root@localhost ~]# systemctl restart firewalld.service
验证策略是否生效
[root@localhost ~]# firewall-cmd --get-log-denied
all
[root@localhost ~]#
3、查询被拒的日志
[root@localhost ~]# dmesg --| grep -i reject
更多推荐
已为社区贡献6条内容
所有评论(0)