mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: Gabriel Goller <g.goller@proxmox.com>,
	"David S. Miller" <davem@davemloft.net>,
	David Ahern <dsahern@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] ipv6: enable per-interface forwarding
Date: Fri, 20 Jun 2025 18:09:52 +0200	[thread overview]
Message-ID: <d429f28f-f515-405d-b490-9b60e5f95070@6wind.com> (raw)
In-Reply-To: <20250620152813.1617783-1-g.goller@proxmox.com>

Le 20/06/2025 à 17:28, Gabriel Goller a écrit :
> It is currently impossible to enable ipv6 forwarding on a per-interface
> basis like in ipv4. To enable forwarding on an ipv6 interface we need to
> enable it on all interfaces and disable it on the other interfaces using
> a netfilter rule. This is especially cumbersome if you have lots of
> interface and only want to enable forwarding on a few. According to the
> sysctl docs [0] the `net.ipv6.conf.all.forwarding` enables forwarding
> for all interfaces, while the interface-specific
> `net.ipv6.conf.<interface>.forwarding` configures the interface
> Host/Router configuration.
> 
> This patch modifies the forwarding logic to check both the global
> forwarding flag AND the per-interface forwarding flag. Packets are
You cannot change this, it will break existing setups.

> forwarded if either the global setting (conf.all.forwarding) OR the
> interface-specific setting (conf.<interface>.forwarding) is enabled.
> This allows enabling forwarding on individual interfaces without
> setting the global option.
> 
> This change won't allow a `Router`-state interface without forwarding
> capabilities anymore, but (with my limited knowledge) I don't think that
> should be a problem?
> 
> This is quite an impacting change, so I don't really expect this to get
> merged. I'm more interested in hearing your feedback and if something
> like this would even be considered?
The only way I see for this is probably to introduce a new sysctl, say
net.ipv6.conf.<iface>.fwd_per_iface (there is probably a better name).
When the user set net.ipv6.conf.all.forwarding to 0, the kernel should reset all
existing net.ipv6.conf.<iface>.fwd_per_iface entries to keep the backward compat.


Regards,
Nicolas

  reply	other threads:[~2025-06-20 16:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20 15:28 Gabriel Goller
2025-06-20 16:09 ` Nicolas Dichtel [this message]
2025-06-20 17:26   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d429f28f-f515-405d-b490-9b60e5f95070@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=g.goller@proxmox.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®