Linux 使用iptables/ipfilter重新加载防火墙规则时的可靠/健壮错误处理方式
我需要一种健壮/可靠/优雅的方式来处理任何错误条件,同时重新加载防火墙规则,一些背景:Linux 使用iptables/ipfilter重新加载防火墙规则时的可靠/健壮错误处理方式,linux,iptables,Linux,Iptables,我需要一种健壮/可靠/优雅的方式来处理任何错误条件,同时重新加载防火墙规则,一些背景: 我们的服务器使用白名单机制,这意味着如果某些服务器需要与多个不同的目的地通话,那么应该有大量的规则 我们有另一个工具来生成防火墙规则文件,该文件将提供给iptables/ipfilter,极有可能该文件格式不正确 由于防火墙规则编号可能非常庞大,iptables/ipfilter可能无法加载防火墙规则文件,因为我们的一些传统硬件上存在资源限制,例如,在某些情况下,内存可能不足,同时重新加载超过20k的规则 因
[root@testmachine]$ iptables-save > new_rules.iptables
iptables restore-t
在生产机器上仔细检查规则集:
[root@production]$ iptables-restore --test < new_rules.iptables
[root@production]$iptables restore——测试
[root@production]$ iptables-restore < new_rules.iptables
[root@production]$iptables restore