From cd3af5f21a1a5aaff5163ece8874f51e93a8b3e5 Mon Sep 17 00:00:00 2001 From: Gray Liang Date: Sun, 14 Apr 2024 03:43:58 +0800 Subject: [PATCH] sysctl net.ipv6.conf.all.forwarding=1 inside netns --- control/netns_utils.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/control/netns_utils.go b/control/netns_utils.go index 36a0c97bf9..a981fcab1a 100644 --- a/control/netns_utils.go +++ b/control/netns_utils.go @@ -289,11 +289,15 @@ func (ns *DaeNetns) setupSysctl() (err error) { return fmt.Errorf("failed to set forwarding for dae0: %v", err) } - // *_early_demux is not mandatory, but it's recommended to enable it for better performance if err = netns.Set(ns.daeNs); err != nil { return fmt.Errorf("failed to switch to daens: %v", err) } defer netns.Set(ns.hostNs) + + // sysctl net.ipv6.conf.all.forwarding=1 + SetForwarding("all", "1") + + // *_early_demux is not mandatory, but it's recommended to enable it for better performance sysctl.Set("net.ipv4.tcp_early_demux", "1", false) sysctl.Set("net.ipv4.ip_early_demux", "1", false) return