How to use the command 'wondershaper' (with examples)

How to use the command 'wondershaper' (with examples)

The wondershaper command allows users to limit the bandwidth of one or more network adapters. It is a handy tool for managing network traffic and ensuring equitable distribution of bandwidth across different users or devices.

Use case 1: Display help

Code:

wondershaper -h

Motivation: The -h option is used to display the help menu for the wondershaper command. This is useful for new users or if you need a quick reminder of the available options and how to use them.

Explanation:

  • wondershaper: The name of the command.
  • -h: The option to display the help menu.

Example output:

Usage: wondershaper [options]
...

Use case 2: Show the current status of a specific adapter

Code:

wondershaper -s -a adapter_name

Motivation: The -s option is used to show the current status of a specific network adapter. This is useful to check if any bandwidth limits have been set on the adapter.

Explanation:

  • wondershaper: The name of the command.
  • -s: The option to show the current status.
  • -a adapter_name: Specifies the name of the network adapter for which you want to check the status.

Example output:

Current status of adapter adapter_name:
Uplink: 512 Kbps
Downlink: 1024 Kbps

Use case 3: Clear limits from a specific adapter

Code:

wondershaper -c -a adapter_name

Motivation: The -c option is used to clear the bandwidth limits from a specific network adapter. This is useful if you want to remove any previously set limits and allow the adapter to use the full available bandwidth.

Explanation:

  • wondershaper: The name of the command.
  • -c: The option to clear the limits.
  • -a adapter_name: Specifies the name of the network adapter for which you want to clear the limits.

Example output:

All limits cleared for adapter adapter_name.

Use case 4: Set a specific maximum download rate

Code:

wondershaper -a adapter_name -d 1024

Motivation: The -d option is used to set a specific maximum download rate (in Kbps) for a network adapter. This is useful when you want to limit the download speed of a particular adapter to prevent it from monopolizing the available bandwidth.

Explanation:

  • wondershaper: The name of the command.
  • -a adapter_name: Specifies the name of the network adapter for which you want to set the limit.
  • -d 1024: Sets the maximum download rate to 1024 Kbps.

Example output:

Download rate set to 1024 Kbps for adapter adapter_name.

Use case 5: Set a specific maximum upload rate

Code:

wondershaper -a adapter_name -u 512

Motivation: The -u option is used to set a specific maximum upload rate (in Kbps) for a network adapter. This is useful when you want to limit the upload speed of a particular adapter to prevent it from overwhelming the network with excessive data transfer.

Explanation:

  • wondershaper: The name of the command.
  • -a adapter_name: Specifies the name of the network adapter for which you want to set the limit.
  • -u 512: Sets the maximum upload rate to 512 Kbps.

Example output:

Upload rate set to 512 Kbps for adapter adapter_name.

Use case 6: Set specific maximum download and upload rates

Code:

wondershaper -a adapter_name -d 1024 -u 512

Motivation: The combination of the -d and -u options allows users to set specific maximum download and upload rates for a network adapter simultaneously. This is useful when you want to limit both the download and upload speeds of a particular adapter to manage its bandwidth usage.

Explanation:

  • wondershaper: The name of the command.
  • -a adapter_name: Specifies the name of the network adapter for which you want to set the limits.
  • -d 1024: Sets the maximum download rate to 1024 Kbps.
  • -u 512: Sets the maximum upload rate to 512 Kbps.

Example output:

Download rate set to 1024 Kbps and upload rate set to 512 Kbps for adapter adapter_name.

Conclusion:

The wondershaper command is a versatile tool for managing network bandwidth. It allows users to set specific maximum download and upload rates, clear limits, and display the current status of network adapters. By using these options effectively, users can optimize their network traffic and ensure fair bandwidth allocation across different users or devices.

Related Posts

Using the `transmission-daemon` Command (with examples)

Using the `transmission-daemon` Command (with examples)

Starting a headless transmission session transmission-daemon Motivation Using the transmission-daemon command without any additional arguments starts a headless transmission session.

Read More
Configuring AWS CLI: Managing Your AWS CLI Configuration (with examples)

Configuring AWS CLI: Managing Your AWS CLI Configuration (with examples)

Introduction The AWS Command Line Interface (CLI) provides a command-line interface for interacting with AWS services.

Read More
How to use the command "xcaddy" (with examples)

How to use the command "xcaddy" (with examples)

xcaddy is a custom build tool for the Caddy Web Server.

Read More