要设置CentOS防火墙自动重启,可以按照以下步骤进行操作:
/etc/sysconfig/iptables
,使用文本编辑器如vim进行编辑:sudo vim /etc/sysconfig/iptables
# Save current firewall rules on stop.
# Firewall reloading on start is always performed regardless of the value of
# IPTABLES_SAVE_ON_RESTART.
IPTABLES_SAVE_ON_STOP="no"
将IPTABLES_SAVE_ON_STOP
的值改为"yes",并保存文件。
重新启动iptables服务来使设置生效:
sudo systemctl restart iptables
设置完成后,CentOS防火墙将会在重启时自动加载之前保存的规则。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:centos防火墙服务怎么重启