hotfix(firewall): re-add iptables-legacy for setups with nft kernel support
This commit is contained in:
@@ -38,7 +38,7 @@ type Config struct { //nolint:maligned
|
||||
func NewConfig(ctx context.Context, logger Logger,
|
||||
runner command.Runner, defaultRoutes []routing.DefaultRoute,
|
||||
localNetworks []routing.LocalNetwork) (config *Config, err error) {
|
||||
iptables, err := checkIptablesSupport(ctx, runner, "iptables", "iptables-nft")
|
||||
iptables, err := checkIptablesSupport(ctx, runner, "iptables", "iptables-nft", "iptables-legacy")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -269,12 +269,18 @@ func (c *Config) runUserPostRules(ctx context.Context, filepath string, remove b
|
||||
case strings.HasPrefix(line, "iptables-nft "):
|
||||
ipv4 = true
|
||||
rule = strings.TrimPrefix(line, "iptables-nft ")
|
||||
case strings.HasPrefix(line, "iptables-legacy "):
|
||||
ipv4 = true
|
||||
rule = strings.TrimPrefix(line, "iptables-legacy ")
|
||||
case strings.HasPrefix(line, "ip6tables "):
|
||||
ipv4 = false
|
||||
rule = strings.TrimPrefix(line, "ip6tables ")
|
||||
case strings.HasPrefix(line, "ip6tables-nft "):
|
||||
ipv4 = false
|
||||
rule = strings.TrimPrefix(line, "ip6tables-nft ")
|
||||
case strings.HasPrefix(line, "ip6tables-legacy "):
|
||||
ipv4 = false
|
||||
rule = strings.TrimPrefix(line, "ip6tables-legacy ")
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user