Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where can I find the centos firewall log file?

I have some ports block by firewall when i set my centos server, such as gerrit can't send email by timeout error when I stop firewalld service, it works. And same as shadowsocks, when I start firewalld service, I can't get anything by my server. I have already opened server port 8388 & 8389 & 465 & 25, but it just didn't work.

I want to cat some firewall log file to find which port wouldn't be aborted. And I cat the file /usr/sbin/firewalld author is you, and firewall import config,config set the log file location. So, how to locate the log file's location?

like image 259
TomDuan Avatar asked Nov 01 '18 09:11

TomDuan


People also ask

How do I see Firewalld logs?

According to this page, the FirewallD logs are at /var/log/firewalld . To get debug messages, you need to run it with --debug or --debug=2 . Save this answer.

Where are firewall logs in Linux?

Firewall log collection in Linux When it comes to Linux systems, iptables, a command line interface is used to set up and maintain tables or rules for the NetFilter firewall for IPv4 that is included by default in the Linux kernel.

Where do Firewalld logs go?

Change location of logfile for logging dropped packets using firewalld. Now, by default the dropped packets are logged into the file /var/log/messages. In order to to change the logging location, we need to configure rsyslog to capture the dropped packets messages. The file /var/log/firewalld.

How do I check logs on CentOS 7?

This is such a crucial folder on your Linux systems. Open up a terminal window and issue the command cd /var/log. Now issue the command ls and you will see the logs housed within this directory (Figure 1).


1 Answers

Log files

Logs are in /var/log/firewalld.

You can use tail to autrenew the output and display the last few lines:

tail -f /var/log/firewalld

You may need to activate logging on startup with --debug. You can just add it in /etc/sysconfig/firewalld:

FIREWALLD_ARGS=--debug=10

and restart the process with sudo systemctl restart firewalld

Add the service to firewalld

Also you might need to add the service itself like so (replace the https):

firewall-cmd --set-default-zone=dmz 2>&1 > /dev/null
firewall-cmd --zone=dmz --permanent --add-service=https 2>&1 > /dev/null
firewall-cmd --reload 2>&1 > /dev/null
like image 172
Hafenkranich Avatar answered Sep 26 '22 16:09

Hafenkranich