在Debian 11中,iptables规则可以通过使用iptables-persistent
包进行持久化。以下是一个如何安装并使用它的步骤:
iptables-persistent
包。你可以使用以下命令安装:sudo apt-get update
sudo apt-get install iptables-persistent
Yes
。对于IPv4:
sudo sh -c 'iptables-save > /etc/iptables/rules.v4'
对于IPv6:
sudo sh -c 'ip6tables-save > /etc/iptables/rules.v6'
iptables-persistent
将自动加载这些规则。请注意,每次修改iptables规则后,你都需要手动保存它们,以便它们在系统重启后仍然有效。
注:本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有