Pet*_*ter 13 iptables systemd firewalld rhel7
我开始使用 RHEL7 并了解一些 systemd 带来的变化。
有没有办法/sbin/service iptables save在firewalld中执行?
$ /sbin/service iptables save
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
Run Code Online (Sandbox Code Playgroud)
我可以从文档中找到的最接近的平行是--reload:
Reload the firewall without loosing state information:
$ firewall-cmd --reload
Run Code Online (Sandbox Code Playgroud)
但它没有明确说明它是否在保存。
Mic*_*ton 25
RHEL 7.0 中的firewalld 版本没有“保存”脚本,也无法将正在运行的防火墙配置复制到永久配置中。您可以通过添加--permanent到进行更改的命令行来使用 firewalld 保存防火墙更改。没有它,您所做的任何更改都是暂时的,并且会在系统重新启动时丢失。
例如:
firewall-cmd --add-service=http # Running config
firewall-cmd --add-service=http --permanent # Startup config
Run Code Online (Sandbox Code Playgroud)
更高(后 RHEL 7)版本的 firewalld 确实包含一种保存运行配置的方法,现在在 Fedora 和RHEL 7.1 中可用。在这种情况下,命令很简单:
firewall-cmd --runtime-to-permanent
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
32584 次 |
| 最近记录: |