firewall-cmdの使い方をまとめてみた。
環境は、たまたまあったRHEL8.2。
# firewall-cmd --list-all public target: default icmp-block-inversion: no interfaces: sources: services: cockpit dhcpv6-client ssh ports: protocols: masquerade: no forward-ports: source-ports: icmp-blocks: rich rules:
上の情報からわかること。
# firewall-cmd --permanent --remove-service=ssh
# firewall-cmd --permanent --new-zone=SSH01
# firewall-cmd --permanent --zone=SSH01 --add-source=***.***.***.*** # firewall-cmd --permanent --zone=SSH01 --add-source=192.168.1.0/24
# firewall-cmd --permanent --zone=SSH01 --add-service=ssh
# firewall-cmd --reload
# firewall-cmd --get-active-zones # firewall-cmd --list-all --zone=sshArnsible
たぶんですが、firewalldが動いてないのでは?
# cd /etc/firewalld/zones # ls public.xml public.xml.old SSH01.xml SSH01.xml.old #