How to enable ip6 forwarding?

I’m trying to setup wireguard through wg-quick but I’m hitting a “wall” and I’m getting the following outputs on my server:

> cat /proc/sys/net/ipv4/ip_forward
1
> cat /proc/sys/net/ipv6/conf/all/forwarding
0

What is the recommended approach to enable ip6-forwarding?

One solution which I can think of is adding this to my config:

  boot.kernel.sysctl = {
    "net.ipv6.conf.all.forwarding" = 1;
  };

but I though there may be an option which I’m not able to find.

I have:

  systemd = {
    network = {
      config = {
        networkConfig = {
          IPv4Forwarding = true;
          IPv6Forwarding = true;
        };
      };
    };
  };
1 Like

Oh neat, that looks better. Thanks!