Thread (10 messages) flat view 10 messages, 3 authors, 2026-06-04

Re: [PATCH iproute2-next] iplink: add support for setting IPv4 devconf parameters

From: David Ahern <dsahern@kernel.org>
Date: 2026-06-04 15:10:56

On 6/1/26 8:32 AM, Fernando Fernandez Mancera wrote:
Currently, modifying IPv4 interface configuration parameters requires
interacting with sysctl (/proc/sys/net/ipv4/conf/*). While
ip-netconf exists for monitoring these values, there has been no native
way to set them directly through iproute2.

This patch introduces the support for that via 'inet' at the 'ip link
set'. It uses IFLA_INET_CONF netlink attribute to set the parameter.

Example to enable forwarding on an interface:

ip link set dev enp8s0 inet forwarding on

Signed-off-by: Fernando Fernandez Mancera <redacted>
---
 ip/iplink.c           | 354 ++++++++++++++++++++++++++++++++++++++++++
 man/man8/ip-link.8.in |  81 ++++++++++
 2 files changed, 435 insertions(+)
applied to iproute2-next after s/matches/strcmp/ and fixed up the code
to keep lines of reasonable length. iproute2 follows netdev with coding
standards and those need to be followed as long as humans are in the
loop. Please make sure follow on patches adhere to roughly 80 columns
with a little extra if it improves readability (and of course strings
are not broken across lines).

claude had one quibble with the man page update - please send a fixup:

1. Man page indent imbalance (visible bug) — man/man8/ip-link.8.in
synopsis opens the inet block with .in +8 but closes with .in -10.
Confirmed by rendering with groff: the [ macaddr ... ] line and
everything after it is indented 2 columns to the left of the baseline.
Should be .in -8. The detailed-description section (~lines 2661/2699) is
already correctly paired.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help