From 0b2c1a3e137f4ef9759542b5d0a3e1f1ae69f846 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 1 Nov 2024 08:51:37 +0100 Subject: [PATCH] Enable IPv4/IPv6 forwarding for nodes This tool is focused on network labs which almost always require routing. --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 5c1e9cc..6e3f1e1 100644 --- a/main.go +++ b/main.go @@ -62,6 +62,10 @@ func main() { log.Fatal(err) } + // Enable IPv4 and IPv6 forwarding + ip("netns", "exec", ns, "sysctl", "-q", "net.ipv4.ip_forward=1") + ip("netns", "exec", ns, "sysctl", "-q", "net.ipv6.conf.all.forwarding=1") + ip("-n", ns, "link", "set", "lo", "up") // Extra interface for our loopback addresses; keeping them separate // can make things easier (e.g. using the interface for protocols). -- 2.45.2