Only enable forwarding for an IP family if any forwarding is required
for that family.
Fixes#6221.
Signed-off-by: David Anderson <danderson@tailscale.com>
pull/6227/head
David Anderson2 years agocommitted byDave Anderson
log.Printf("Failed to enable IP forwarding: %v",err)
log.Printf("Failed to enable IP forwarding: %v",err)
log.Printf("To run tailscale as a proxy or router container, IP forwarding must be enabled.")
log.Printf("To run tailscale as a proxy or router container, IP forwarding must be enabled.")
ifcfg.InKubernetes{
ifcfg.InKubernetes{
log.Fatalf("You can either set the sysctls as a privileged initContainer, or run the tailscale container with privileged=true.")
log.Fatalf("You can either set the sysctls as a privileged initContainer, or run the tailscale container with privileged=true.")
}else{
}else{
log.Fatalf("You can fix this by running the container with privileged=true, or the equivalent in your container runtime that permits access to sysctls.")
log.Fatalf("You can fix this by running the container with privileged=true, or the equivalent in your container runtime that permits access to sysctls.")
}
}
}
}
}
}
}
@ -334,14 +334,46 @@ func ensureTunFile() error {
}
}
// ensureIPForwarding enables IPv4/IPv6 forwarding for the container.
// ensureIPForwarding enables IPv4/IPv6 forwarding for the container.