Report this

What is the reason for this report?

how to set bandwidth limitation for openVPN

Posted on August 8, 2020

As I following through this tutorial I installed OpenVPN on my server https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-18-04

and I needed to limit bandwidth for the users so regarding to this tutorial I set a bandwidth limitation for the server

https://netbeez.net/blog/how-to-use-the-linux-traffic-control/ I just used 2 commands for set limit for bandwidth

apt-get install iproute2
tc qdisc add dev eth0 root tbf rate 1mbit burst 32kbit latency 200ms

Also I set sever.conf up with the underneath configuration

sndbuf 0
rcvbuf 0

and add these lines to the ovpn client file

sndbuf 393216
rcvbuf 393216
push "sndbuf 393216"
push "rcvbuf 393216"

but unfortunately my openVPN is unstable and it doesn’t work well, it just work for a few seconds and after the seconds it Interrupts the internet traffic.

so is there anything else for limiting the bandwidth for each user in DigitalOcean Droplets?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.

It seems you have configured traffic control tc and buffer settings in the server and client config files. However, if you’re still facing issues, you can try the following:

  1. Check logs on your OpenVPN server to see if there are any errors or warnings that may provide insight into the issue. These logs can typically be found in /var/log/openvpn/openvpn.log or /var/log/syslog.
  2. Consider using a different method for bandwidth management, such as Wondershaper (a wrapper for tc) or trickle (a standalone userspace bandwidth shaper).
  3. If possible, test without bandwidth limits to confirm if the limitation is causing the issue.

If you need further assistance, please refer to the OpenVPN troubleshooting guide and DigitalOcean OpenVPN tutorial.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.