问题原文
原帖链接 · Iso · CC BY-SA 4.0
Is there a way to list runtime-only (i.e. no --permanent) changes in firewalld? I would like to see a diff in my configuration to make sure no change will get lost in case of a --reload.
已采纳解答
原帖链接 · natxo asenjo · CC BY-SA 4.0
as far as I can see no tool that offers you that possibility, but you can create it yourself.
I add a runtime acl to port 54/tcp:
# firewall-cmd --add-port=54/tcp
Then I can save the runtime rules to a file:
# firewall-cmd --list-all > /tmp/runtime_rules
And I save the permanent rules to another file:
# firewall-cmd --list-all --permanent > /tmp/permanent_rules
Finally I use diff to compare both
# diff /tmp/runtime_rules /tmp/permanent_rules
1c1
< FedoraWorkstation (active)
---
> FedoraWorkstation
4c4
< interfaces: wlp2s0
---
> interfaces:
7c7
< ports: 1025-65535/udp 1025-65535/tcp 54/tcp
---
> ports: 1025-65535/udp 1025-65535/tcp
And there you have the port I added on the runtime rules, not on the permanent one.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
