LinuxCommandLibrary

wondershaper

Limit network bandwidth usage

TLDR

Show the current [s]tatus of a specific [a]dapter

$ wondershaper -s -a [adapter_name]
copy

Clear limits from a specific [a]dapter
$ wondershaper -c -a [adapter_name]
copy

Set a specific maximum [d]ownload rate (in Kbps)
$ wondershaper -a [adapter_name] -d [1024]
copy

Set a specific maximum [u]pload rate (in Kbps)
$ wondershaper -a [adapter_name] -u [512]
copy

Set a specific maximum [d]ownload rate and [u]pload rate (in Kpbs)
$ wondershaper -a [adapter_name] -d [1024] -u [512]
copy

Display [h]elp
$ wondershaper -h
copy

SYNOPSIS

wondershaper interface download_rate upload_rate

PARAMETERS

interface
    The network interface to apply traffic shaping to (e.g., eth0, wlan0).
You can obtain the interface name by running ip addr.

download_rate
    The maximum download bandwidth in kilobits per second (kbps).

upload_rate
    The maximum upload bandwidth in kilobits per second (kbps).

-a interface
    Specifies the interface to apply shaping, same as interface parameter.

-d download_rate
    Specifies the download rate, same as download_rate parameter.

-u upload_rate
    Specifies the upload rate, same as upload_rate parameter.

-s
    Shows the current status of the traffic shaping rules.

-c
    Clears all traffic shaping rules from the specified interface.

DESCRIPTION

Wondershaper is a simple traffic shaping script for Linux. It allows you to limit the bandwidth used by a specific network interface, improving the responsiveness of your internet connection. This is particularly useful for managing uploads, which can often saturate the connection and cause lag. Wondershaper works by creating Quality of Service (QoS) rules that prioritize certain types of traffic over others. It uses the tc (Traffic Control) command to implement these rules. It's easy to use and configure, making it a good choice for users who want to improve their network performance without having to delve into the complexities of advanced traffic shaping configurations. Wondershaper automatically creates the correct rules to limit the download and upload bandwidth. It can be easily configured with a command line interface by defining the interface and the desired bandwidth.

CAVEATS

Wondershaper requires root privileges to run. The specified rates should be lower than the actual bandwidth available to avoid starvation. Bandwidth measurements can be inaccurate due to network overhead.
It is important to note that wondershaper's traffic shaping is based on simple rate limiting. It doesn't provide advanced QoS features such as packet prioritization based on application or port number. For more complex QoS requirements, consider using tc directly.

EXAMPLES

To limit the bandwidth on the interface eth0 to 1000 kbps download and 500 kbps upload:
wondershaper eth0 1000 500
To clear the rules:
wondershaper -c eth0
To check status:
wondershaper -s eth0

HISTORY

Wondershaper has been around for quite a while, initially created to provide a simple way to manage bandwidth on Linux systems, primarily for home users and small networks. It gained popularity as a quick solution for improving internet responsiveness when uploading large files. Development has been relatively slow, focused on stability and ease of use.

SEE ALSO

tc(8), ip(8), iptables(8)

Copied to clipboard