NETSHAPER(8)

๐Ÿ“ฆ
version 7.3.0 ยท 3 versions
, in arch rolling, nixpkgs unstable, ubuntu stonking

๐Ÿ’… NETSHAPER โ€” the netshaper page, but make it cute โœจ

okay bestie, pull up a chair ๐Ÿซถ you're reading the manual page for netshaper, section 8 of the Linux manuals. yes, that section 8, the one for the big-girl system admin tools. we're doing hardware shaping today and honestly? it's giving main character energy ๐Ÿ‘‘


โœจ NAME โœจ

netshaper โ€” show / manipulate network device hardware shaping configuration ๐ŸŒธ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

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 ]

like, look at all those brackets. it's giving "optional but make it fashion" ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so. netshaper lets you configure and manage the hardware rate limiting (shaping) capabilities that live on network devices. not software shaping, bestie โ€” hardware. the API gives you control over shapers at a bunch of different levels, including network devices, queues, and scheduling nodes, which means you can literally manipulate the device's scheduling tree. iconic behavior, no cap ๐Ÿ”ฅ

Every single shaper is uniquely identified within a device by a handle, which is made of a scope plus an optional id. and depending on what that scope value is, shapers get attached to specific hardware objects:

  • netdev โ€” shapers attached to the entire network device. the id parameter is optional for this scope (it defaults to 0 if you don't specify it).
  • queue โ€” shapers attached to specific device queues. the id parameter is required here and it specifies the queue number.
  • node โ€” intermediate scheduling nodes that can be placed at arbitrary locations in the scheduling tree. the id parameter is required for the set, show, and delete commands. for the group command it's optional; if you omit it, the kernel auto-assigns one. so generous of it ๐Ÿงš

๐Ÿ‘‘ COMMANDS ๐Ÿ‘‘

๐ŸŒˆ netshaper set

  • Create or update a shaper configuration

Creates or updates a shaper with the parameters you gave it. At least one of bw-min, bw-max, or weight must be provided โ€” you can't just roll up with nothing, bestie ๐Ÿ˜ญ The id parameter is required for queue and node scopes and optional for netdev scope.

๐ŸŒˆ netshaper show

  • Display shaper information

Shows you the current configuration of the specified shaper, including bandwidth limits, weight, and parent information. it's the vibe check of shapers ๐Ÿ’–

๐ŸŒˆ netshaper delete

  • Remove a shaper configuration

Removes the specified shaper configuration from the device. bye bye ๐Ÿ‘‹

๐ŸŒˆ netshaper group

  • Create a scheduling hierarchy

Creates a scheduling group by binding one or more queue leaf shapers to a netdev or node handle โ€” all in a single operation, because we don't do multiple round trips around here โœจ The command specifies the target handle, its parent, optional bandwidth and weight parameters, and the set of queue leaves to attach.


๐ŸŒธ PARAMETERS ๐ŸŒธ

  • dev DEV โ€” Specifies the network device name on which to operate.
  • handle โ€” Defines the shaper handle, which consists of:
    • scope HANDLE_SCOPE โ€” The shaper scope, which can be: netdev (device-level shaper), queue (queue-level shaper), or node (scheduling node shaper).
    • id HANDLE_ID โ€” 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.
  • bw-min BW_MIN โ€” Minimum guaranteed bandwidth for the shaper. Accepts values with suffixes: kbit, mbit, gbit for kilobits, megabits, and gigabits per second respectively.
  • bw-max BW_MAX โ€” Maximum bandwidth limit for the shaper. Accepts the same suffixes as bw-min.
  • weight WEIGHT โ€” Scheduling weight for the shaper, used for weighted fair sharing among siblings under the same parent node. Value is an unsigned integer.
  • parent โ€” 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.
  • leaves โ€” 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.

๐Ÿ’– OPTIONS ๐Ÿ’–

  • -V, -Version โ€” Print the version of the netshaper utility and exit.
  • -c[color] = {always | auto | never} โ€” 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. (last one wins, always ๐Ÿ’…)
  • -help โ€” Display usage information and exit.

๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

Example 1: Create a device-level shaper

# netshaper set dev foo handle scope netdev bw-max 10gbit

Creates a netdev-scoped shaper with maximum bandwidth of 10 Gbit/s. slay.

Example 2: Set bandwidth and weight on a queue shaper

# 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.

Example 3: Show shaper configuration

# netshaper show dev foo handle scope netdev

Displays the current shaper configuration for the specified device and handle.

Example 4: Create a scheduling hierarchy with group

# 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. the way that structure just works ๐Ÿ˜ญ๐Ÿ’–

Example 5: Delete shaper configuration

# netshaper delete dev foo handle scope netdev

Removes the specified shaper configuration.


๐ŸŽ€ NOTES ๐ŸŽ€

  • 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. atomic. periodt. โญ

๐Ÿซถ SEE ALSO ๐Ÿซถ

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


๐Ÿ’œ AUTHOR ๐Ÿ’œ

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


and that's the whole thing bestie, go forth and shape some bandwidth ๐ŸŒˆโœจ this little gem lives in iproute2, dated 19 May 2026, and yeah โ€” it's still NETSHAPER(8) at the bottom, iykyk ๐Ÿ’…

๐Ÿ“ฆ where this page comes from