wondershaper, a command-line utility for limiting an adapter's bandwidth

栏目: IT技术 · 发布时间: 5年前

内容简介:Copyright (c) 2002-2020 Bert HubertSee the ChangeLog for information on the individual contributions of the authors.Wonder Shaper is a script that allows the user to limit the bandwidth of one or more network adapters. It does so by using iproute's tc comm

The Wonder Shaper 1.4.1

Copyright

Copyright (c) 2002-2020 Bert Hubert ahu@ds9a.nl , Jacco Geul jacco@geul.net , Simon Séhier simon@sehier.fr , corbolais@gmail.com

See the ChangeLog for information on the individual contributions of the authors.

About

Wonder Shaper is a script that allows the user to limit the bandwidth of one or more network adapters. It does so by using iproute's tc command, but greatly simplifies its operation. Wonder Shaper was first released by Bert Hubert in 2002, but the original version lacked a command-line interface, from on version 1.2 this feature was added. From version 1.3, the HTB queing is used instead of CBQ, allowing better bandwith managment on high speed (above ten megabits) links. In version 1.4 an improved ingress shaping method was implemented and the ability to limit either down or up (both is still possible too). The original README is a rather lengthy document and is saved under README.old, for those who'd like some more background information. Except any notes on operation this document is considered up-to-date.

Installation

Obtaining wondershaper

It is recommended to clone the GitHub repository of wondershaper such that you can pull in new updates at any time (if available). Open a new terminal and clone the repository using

git clone https://github.com/magnific0/wondershaper.git

This will clone wondershaper in your current folder in a new folder named wondershaper. Now enter the folder using

cd wondershaper

Using wondershaper

You can run wondershaper (as any user with sufficient permissions) without installation and stop following the instructions at this point. Show the wondershaper usage instructions by typing

./wondershaper -h

The program details all available options on how to use wondershaper. Next is to pick an interface that you want to shape. You can see all availble interfaces by typing

ip addr show

Note that on older systems this command might not be available. In this case you should run ifconfig instead.

Identify the network interface that you want to shape. The names differ per system .

In the following example a wireless interface is limited to an upload of 4Mbps and download of 8Mbps .

./wondershaper -a wlp4s0 -u 4096 -d 8192

If you get messages telling you that RTNETLINK answers: Operation not permitted your user account does not have sufficient privileges. In that case try:

sudo ./wondershaper -a wlp4s0 -u 4096 -d 8192

System installation (optional)

A makefile file provided for easy installation. The default location for wondershaper is in /usr/bin . If you want to install to your system you can run:

sudo make install

You can verify that wondershaper was installed correctly by entering:

which wondershaper

This should return /usr/bin/wondershaper . You can follow the same instructions as explained in the "Using wondershaper" section, but instead of running the local version of the program you now run the system version by removing the ./ from the beginning of each command. For example to show the help instructions again run:

wondershaper -h

Persistent usage of wondershaper (optional)

Instead of using the commandline options to set the rates and interface as previously shown, it is necessary to set these parameters in the wondershaper.conf configuration file. You can edit this file using your favourite text editor (vim in the example below) as such:

sudo vim /etc/systemd/wondershaper.conf

To make sure wondershaper is reactivated on reboot a systemd service file is provided. First enable wondershaper as a systemd service using:

sudo systemctl enable --now wondershaper.service

This way wondershaper is activated with your setting upon reboot.

Usage

wondershaper [-hcs] [-a <adapter>] [-d <rate>] [-u <rate>]

The following command line options are allowed:

  • -h Display help

  • -a <adapter> Set the adapter

  • -d <rate> Set maximum download rate (in Kbps) and/or

  • -u <rate> Set maximum upload rate (in Kbps)

  • -p Use the presets in /etc/systemd/wondershaper.conf

  • -c Clear the limits from adapter

  • -s Show the current status of adapter

The different modes are:

wondershaper -a <adapter> -d <rate> -u <rate>

    wondershaper -c -a <adapter>

    wondershaper -s -a <adapter>

Some examples:

wondershaper -a eth0 -d 1024 -u 512

    wondershaper -a eth1 -d 94000 -u 94000  # could be used on a 100Mbps link

    wondershaper -a eth1 -u 94000  # only limit upload

    wondershaper -c -a eth0

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

移动Web手册

移动Web手册

Peter-Paul Koch(彼得-保罗 科赫) / 奇舞团 / 电子工业出版社 / 2015-4 / 65.00元

《移动Web手册(双色)》主要讲解了移动Web开发和传统PC网站开发的不同之处。作者首先对移动互联网相关的运营商、设备、操作系统和软件进行了简单的介绍,让读者理解移动开发的复杂之处。接下来对移动设备上的各种浏览器进行了详细介绍,以及这些浏览器的市场占有率、特性支持等。《移动Web手册(双色)》为那些想进入移动Web开发领域的人提供了一些指导性的建议并对移动Web开发的未来进行了展望。 《移动......一起来看看 《移动Web手册》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具