]> git.ipfire.org Git - thirdparty/iproute2.git/commit
netshaper: Add netshaper command
authorErni Sri Satya Vennela <ernis@linux.microsoft.com>
Tue, 7 Oct 2025 11:06:14 +0000 (04:06 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 21 Oct 2025 22:06:05 +0000 (15:06 -0700)
commit6f7779ad4ef63e09acbfe84ecc308be044b77607
treeaee9d8e4523cb0364aef9b1f584a775ae433a5ca
parent1e5705447c2e29f0cf658d778410c0d0d5246c14
netshaper: Add netshaper command

Add support for the netshaper Generic Netlink family to
iproute2. Introduce a new command for configuring netshaper
parameters directly from userspace.

This interface allows users to set shaping attributes which
are passed to the kernel to perform the corresponding netshaper
operation.

Example usage:
$netshaper { set | show | delete } dev DEV \
           handle scope SCOPE [id ID] \
           [ bw-max BW_MAX ]

Internally, this triggers a kernel call to apply the shaping
configuration to the specified network device.

Currently, the tool supports the following functionalities:
- Setting bandwidth in Mbps, enabling bandwidth clamping for
  a network device that support netshaper operations.
- Deleting the current configuration.
- Querying the existing configuration.

Additional netshaper operations will be integrated into the tool
as per requirement.

This change enables easy and scriptable configuration of bandwidth
shaping for devices that use the netshaper Netlink family.

Corresponding net-next patches:
1) https://lore.kernel.org/all/cover.1728460186.git.pabeni@redhat.com/
2) https://lore.kernel.org/lkml/1750144656-2021-1-git-send-email-ernis@linux.microsoft.com/

Install pkg-config and libmnl* packages to print kernel extack
errors to stdout.

Signed-off-by: Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Makefile
man/man8/netshaper.8 [new file with mode: 0644]
netshaper/Makefile [new file with mode: 0644]
netshaper/netshaper.c [new file with mode: 0644]