amuck-landowner

Openvpn on VPS, Bandwidth limit?

bardaxx

New Member
Hello everybody, i have installed openvpn on my vps!

All works, but i have the "download limit" set to 10Mb/s.
 

how to allow to use the max bandwidth of my VPS through vpn?

Thankyou :) 

ps. Great forum! i love it!
 
 

Francisco

Company Lube
Verified Provider
thank you for reply, yes i use "proto udp" on server.conf, what is the difference if i set to "tcp" ? thankyou!
UDP can be a bit faster for OpenVPN, but it also depends on if you're using OpenVPN to get around firewalls/etc. Both work just fine, it's just that trickle works with TCP only if you want to go that route.

As I said, tc is another option but it's a lot more complex. You'd need to do something like...



/sbin/tc qdisc del dev MAIN_INTERFACE root

/sbin/tc qdisc add dev MAIN_INTERFACE root handle 1: htb
/sbin/tc class add dev MAIN_INTERFACE parent 1: classid 1:1 htb rate 10mbit
/sbin/tc class add dev MAIN_INTERFACE parent 1:1 classid 1:5 htb rate 10mbit ceil 10mbit prio 0
/sbin/tc filter add dev MAIN_INTERFACE parent 1:0 prio 1 protocol ip handle 5 fw flowid 1:5

/sbin/iptables -A OUTPUT -t mangle -p udp -s VPN_SUBNET_HERE -j MARK --set-mark 5
This won't hard cap it at 10mbit due to how it samples, but it should keep it right around that limit for the most part.
tc is still hit/miss when it comes to OpenVZ support since it usually requires extra permissions that not all hosts have given/will give. You might be able to use iptables to handle all the rate limiting but I can't see the performance being very good with that.

Francisco
 
Last edited by a moderator:

clarity

Active Member
I read the first post as he wanted to unlimit the speed that he is seeing.

@bardaxx What is the speed of the connection that you are using to connect to the server?
 

bardaxx

New Member
I read the first post as he wanted to unlimit the speed that he is seeing.

@bardaxx What is the speed of the connection that you are using to connect to the server?

Thank you for the replies guys, so


my Vps have 100Mbit/s, at home I have 20Mbit/s but i reach only 10Mbit/s.

UDP can be a bit faster for OpenVPN, but it also depends on if you're using OpenVPN to get around firewalls/etc. Both work just fine, it's just that trickle works with TCP only if you want to go that route.


As I said, tc is another option but it's a lot more complex. You'd need to do something like...



/sbin/tc qdisc del dev MAIN_INTERFACE root

/sbin/tc qdisc add dev MAIN_INTERFACE root handle 1: htb
/sbin/tc class add dev MAIN_INTERFACE parent 1: classid 1:1 htb rate 10mbit
/sbin/tc class add dev MAIN_INTERFACE parent 1:1 classid 1:5 htb rate 10mbit ceil 10mbit prio 0
/sbin/tc filter add dev MAIN_INTERFACE parent 1:0 prio 1 protocol ip handle 5 fw flowid 1:5

/sbin/iptables -A OUTPUT -t mangle -p udp -s VPN_SUBNET_HERE -j MARK --set-mark 5

This won't hard cap it at 10mbit due to how it samples, but it should keep it right around that limit for the most part.

tc is still hit/miss when it comes to OpenVZ support since it usually requires extra permissions that not all hosts have given/will give. You might be able to use iptables to handle all the rate limiting but I can't see the performance being very good with that.


Francisco
Francisco i need to add this rules?


MAIN INTERFACE = tun0 


VPNSUBMASK = 255.255.255.0 


right?


Thank you guys!
 
Top
amuck-landowner