Where can I find the centos firewall log file?

Viewed 27603

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?

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
Related