Debian系统中的防火墙配置文件主要位于以下几个位置:
iptables 规则文件:
/etc/iptables/rules.v4
/etc/iptables/rules.v6
。iptables-persistent:
iptables-persistent
包时,系统会提示你是否保存当前的防火墙规则。这些规则会被保存到 /etc/iptables/
目录下。。sudo systemctl restart netfilter-persistent.service
ufw 配置文件(Uncomplicated Firewall):
/etc/default/ufw
。。/etc/ufw/applications.d/
目录中。。firewalld 配置文件(适用于较新的Debian版本,如Debian 12):
/etc/firewalld/
目录下。。sudo firewall-cmd --runtime-to-permanent
sudo firewall-cmd --reload
请注意,具体文件位置和名称可能会因Debian版本的不同而有所差异。建议查阅你所使用的Debian版本的官方文档以获取最准确的信息。