Categories
How To Raspberry Pi

Wondershaper and VPN Router: Internet speed under control

We use the Internet for many things these days. Some need more bandwidth than others. Streaming for example can use a lot of data. There is one thing that really gets on my nerves with most streaming apps. I cannot determine the bandwidth at all or only vaguely. All apps think they know what quality and resolution I would like to have and thus determine over my head how much bandwidth I use and consume more data that I want. With Wondershaper I take back control.

In some countries most connections provide unlimited bandwidth. This is a great thing and I don’t really have to worry about it. But there are also connections where the data usage is limited. For example, you could use your smartphone as a hotspot and it would be interesting to know how much data you are using. In any case, I would simply like to determine how much data I use.

Wondershaper helps

Under Linux there is a small and beautiful command line program called Wondershaper. The source code is available at GitHub and in popular Linux distributions you find the program in the repositories. Under Linux Mint or Raspbian (Raspberry Pi) you can install it this way:

apt install wondershaper

The program allows me to control network interfaces. So I tell my Wi-Fi or Ethernet interface, i.e. the network card, how much upload and download it may use.

Wondershaper allows me to regulate the internet speed
Wondershaper allows me to regulate the internet speed

As you can see in the screenshot, the syntax is very simple:

sudo wondershaper Downlink Uplink

It’s not hard, is it? But what if I want to regulate the internet speed for my Android device, smart TV and so on?

Control the Internet speed on a VPN router!

It is really not very difficult to make a VPN router out of a Raspberry Pi. The Pi’s wireless interface serves as an access point to connect your devices. The wired network card (eth0) forwards the data traffic to the Internet. If I put Wondershaper on eth0, I have control over the internet speed and thus it’s up to me how much bandwidth the apps can use. The command

sudo wondershaper eth0 2048 512

gives me 2 Mbps download and 0,5 Mbps upload. Once you have done that, you can test your internet speed. The method works and I can prove it.

My download speed is limited to 2 Mbps
My download speed is limited to 2 Mbps

It is no secret that the download speed is decisive for streaming. Many streaming portals deliver an acceptable quality from 2 Mbps. Some need a bit more. But we are flexible and can also set our VPN router to 4 Mbps.

Now I have 4 Mbps download speed
Now I have 4 Mbps download speed

With such a VPN router you can also connect a Chromecast to a VPN easily.

Wondershaper – think of your fellow men!

If several parties in the house use the Internet, you can also let your fellow men use some bandwidth as the streaming apps cannot hog all data. You use only a small part of the bandwidth and streaming in HD is still possible.

In my second example the apps can’t grab more than 4 Mbps, no matter how hungry for bandwidth they are. Wondershaper simply controls the flow of the data. I think it’s a very elegant way to give streaming apps a feature that they don’t have — I don’t know why but most are lacking in this area.

With a little patience, you can quickly build your own VPN router. With a VPN, you can not only avoid the annoying geoblocking, but also control the Internet speed for some streaming Apps. Great, isn’t it?

Leave a Reply

Your email address will not be published. Required fields are marked *