RHEL get firewall zones and their interfaces in one go


The firewall-cmd  doesn't have an option to show all zones and to which one the server interfaces belong, so here is a one-line to show that:

#for ii in `ls /usr/lib/firewalld/zones/`; do echo ${ii%%.xml}: ; firewall-cmd --zone=${ii%%.xml} --list-interfaces; done
The output:

block:
dmz:
drop:
external:
home:
internal:
public:
eno16777736 eno50332184
trusted:
work:

Follow me on https://www.linkedin.com/in/yurislobodyanyuk/ not to miss what I publish on Linkedin, Github, blog, and more.