linux + firewall + how to check if any port on linux is blocked by the firewall / iptables

32,492

You can just dump the firewall rules your machine runs:

sudo iptables -S

If you use firewalld on RHEL7, you can use

sudo firewall-cmd --list-all-zones

for a more readable output.

Share:
32,492
jango
Author by

jango

Updated on September 18, 2022

Comments

  • jango
    jango over 1 year

    some application on my redhat Linux machine isn't working ( and we suspect that according to application logs some port's are blocked )

    so we want to check all ports on the OS that are blocked by the Firewall/iptables

    is it possible to scan/verify all ports ( lets say from /etc/services ) on the linux OS and verify ports that are blocked ?

    • Daniel Widrick
      Daniel Widrick almost 7 years
      Why don't you ask the sysadmin which ports are blocked or tell that person to unblock the ports that your application uses?