default DROP policy on firewall reload also for IPv6

Signed-off-by: Benjamin Böhmke <benjamin@boehmke.net>
This commit is contained in:
Benjamin Böhmke 2020-07-20 19:56:34 +02:00
parent ec7df93731
commit 9cf5335269
1 changed files with 6 additions and 0 deletions

View File

@ -60,6 +60,12 @@ func setupIPForwarding(enableIPTables bool, enableIP6Tables bool) error {
if err := iptable.SetDefaultPolicy(iptables.Filter, "FORWARD", iptables.Drop); err != nil {
logrus.Warnf("Setting the default DROP policy on firewall reload failed, %v", err)
}
iptables.OnReloaded(func() {
logrus.Debug("Setting the default DROP policy on firewall reload")
if err := iptable.SetDefaultPolicy(iptables.Filter, "FORWARD", iptables.Drop); err != nil {
logrus.Warnf("Setting the default DROP policy on firewall reload failed, %v", err)
}
})
}
return nil