Is there an easy way to show a full list of all the ports that have been opened using firewalld?
I know the command firewall-cmd --list-all, but that just shows service names, not the ports that those services define as being open.
For example:
[root@myserver log]# firewall-cmd --list-all dmz (active) target: default icmp-block-inversion: no interfaces: ens160 sources: services: ssh squid my-icap ports: protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules: I know I can go into the definition files for each of these services to see what ports they are defining as open, but it seems like there should be a single-line way to do this, and I'm just missing it.
And I'm not looking for netstat: that will tell me if something is listening on a port, which is a different question from whether that port is accessible from another host.
firewall-cmd --add-portorfirewall-cmd --add-service?--add-service, which is why they show up in theservices:line. If I had added the ports individually with--add-port, then they would have shown up in theports:line. But I like the concept of grouping ports by service and enabling and disabling them all together, I'm just frustrated that I can't find a simple way to see all the ports that are opened by the listed services.--add-services, the--list-allswitch only shows the services. That's the way thatfirewall-cmdis designed to work. If you want it to list the ports then you'll either have to open them with--add-portor edit the code offirewall-cmdso that it shows the ports as well as the services.--list-alloption works. It just seems bizarre if there's no way to display all the ports that are open, which - surely - is one of the most common questions about a firewall's status. Even--service <service_name> get-portsdoesn't give the information about a single service.