NETSHAPER(8) Linux NETSHAPER(8)

netshaper - show / manipulate network device hardware shaping configuration


netshaper [ OPTIONS ] { COMMAND | help }

OPTIONS := { -V[ersion] | -c[olor] | -help }

netshaper set dev DEV handle scope HANDLE_SCOPE [ id HANDLE_ID ] [ bw-min BW_MIN ] [ bw-max BW_MAX ] [ weight WEIGHT ]

netshaper { show | delete } dev DEV handle scope HANDLE_SCOPE [ id HANDLE_ID ]

netshaper group dev DEV handle scope { node | netdev } [ id HANDLE_ID ] [ parent scope { netdev [ id PARENT_ID ] | node id PARENT_ID } ] [ bw-min BW_MIN ] [ bw-max BW_MAX ] [ weight WEIGHT ] leaves LEAF_SPEC [ LEAF_SPEC ... ]


LEAF_SPEC := scope queue id ID [ weight WEIGHT ] [ priority PRIO ]

netshaper allows configuration and management of hardware rate limiting (shaping) capabilities available on network devices. The API provides control over shapers at different levels including network devices, queues, and scheduling nodes, enabling manipulation of the device's scheduling tree.

Each shaper is uniquely identified within a device by a handle, which consists of a scope and an optional id. Depending on the scope value, shapers are attached to specific hardware objects:

Shapers attached to the entire network device. The id parameter is optional for this scope (defaults to 0 if not specified).
Shapers attached to specific device queues. The id parameter is required and specifies the queue number.
Intermediate scheduling nodes that can be placed at arbitrary locations in the scheduling tree. The id parameter is required for set, show, and delete commands. For the group command it is optional; if omitted, the kernel auto-assigns one.

- Create or update a shaper configuration

Creates or updates a shaper with the specified parameters. At least one of bw-min, bw-max, or weight must be provided. The id parameter is required for queue and node scopes and optional for netdev scope.

- Display shaper information

Shows the current configuration of the specified shaper, including bandwidth limits, weight, and parent information.

- Remove a shaper configuration

Removes the specified shaper configuration from the device.

- Create a scheduling hierarchy

Creates a scheduling group by binding one or more queue leaf shapers to a netdev or node handle in a single operation. The command specifies the target handle, its parent, optional bandwidth and weight parameters, and the set of queue leaves to attach.

Specifies the network device name on which to operate.
Defines the shaper handle consisting of:
The shaper scope, which can be: netdev (device-level shaper), queue (queue-level shaper), or node (scheduling node shaper).
Numeric identifier for the shaper. Required for queue and node scopes. Optional for netdev scope (defaults to 0). For the group command, node id may be omitted to let the kernel auto-assign one.
Minimum guaranteed bandwidth for the shaper. Accepts values with suffixes: kbit, mbit, gbit for kilobits, megabits, and gigabits per second respectively.
Maximum bandwidth limit for the shaper. Accepts the same suffixes as bw-min.
Scheduling weight for the shaper, used for weighted fair sharing among siblings under the same parent node. Value is an unsigned integer.
Defines the parent for the group command. The parent scope must be node or netdev; queue is not valid as a parent scope. For parent scope node, id is required. For parent scope netdev, id is optional. When omitted, the parent is inherited from the leaves' current parent, which requires all leaves to share the same parent.
Specifies one or more leaf shapers to attach to the group. Each leaf must use scope queue; no other scope is accepted for leaves. Each leaf is given as scope queue id ID, with optional weight and priority parameters for per-queue scheduling within the group. Multiple leaves can be specified in sequence.

Print the version of the netshaper utility and exit.
Configure color output. If the parameter is omitted or always, color output is enabled regardless of stdout state. If the parameter is auto, stdout is checked to be a terminal before enabling color output. If the parameter is never, color output is disabled. If specified multiple times, the last one takes precedence.
Display usage information and exit.

# netshaper set dev foo handle scope netdev bw-max 10gbit
Creates a netdev-scoped shaper with maximum bandwidth of 10 Gbit/s.
# netshaper set dev foo handle scope queue id 0 \
    bw-min 1gbit bw-max 5gbit weight 10
Creates a queue-scoped shaper on queue 0 with minimum/maximum bandwidth limits and a scheduling weight.
# netshaper show dev foo handle scope netdev
Displays the current shaper configuration for the specified device and handle.
# netshaper group dev foo handle scope node \
    parent scope netdev bw-max 10gbit \
    leaves scope queue id 0 weight 3 \
    scope queue id 1 weight 2
Creates a node shaper under the netdev parent, grouping queues 0 and 1 as leaves. The 10 Gbit/s cap applies to the node itself.
# netshaper delete dev foo handle scope netdev
Removes the specified shaper configuration.

  • For netdev scope, the id parameter is optional and defaults to 0 if not specified.
  • For queue and node scopes, the id parameter is required. For the group command, node id may be omitted to let the kernel auto-assign one.
  • Bandwidth values support standard suffixes: kbit (kilobits per second), mbit (megabits per second), gbit (gigabits per second).
  • The group command attaches queue leaves to a netdev or node handle in a single atomic operation.

ip(8), ip-link(8), tc(8)

Erni Sri Satya Vennela <ernis@linux.microsoft.com>
Mohsin Bashir <hmohsin@meta.com>

19 May 2026 iproute2