Limit Bandwidth / Valid for Container and KVM

M

menezes

Guest
Corrected ** ** now this perfect


Good night!


I searched a lot on google how to limit internet bandwidth and also saw that many are looking for, but today, I found a partial solution that solved my problem. But it would be interesting personnel Proxmox see a way to integrate into the next update.


THIS IS THE ORIGINAL turorial
Information taken from the site: http://www.oficinadanet.com.br/artigo/linux/limitando_banda_com_cbqinit_no_debian_e_ubuntu
Credit: Julio Cardoso author of the tutorial.
Site design: http://sourceforge.net/projects/cbqinit/?source=navbar


BELOW FOR TUTORIAL Proxmox


1 - These steps must be run on the server that the Proxmox (Note I have not tested with more than one node)
2 - Download this file wget http://ufpr.dl.sourceforge.net/project/cbqinit/cbqinit/0.7.3/cbq.init-v0.7.3
3 - Make the default directory mkdir /etc/sysconfig/cbq
4 - Now move the script v0.7.3-cbq.init mv /etc/sysconfig/cbq/cbq.init
5 - Change the permission chmod 700 /etc/sysconfig/cbq/cbq.init
6 - Start /etc/sysconfig/cbq/cbq.init start (Note will generate an error normal)
7 - Now we will create the configuration file entry:
cd /etc/sysconfig/cbq/
came cbq-00101.CT.in <- Container name, create an input file created for each Container
8 - Insert the following content: -> use the drive for kilobytes kilobits http://letconversion.com/conversao-de-dados-de-armazenamento/de-kilobits/para-kilobytes


DEVICE = veth101.0, 100Mbit, 10Mbit, 1Mbit # Download
# Transfer rate: 10kb / s
RATE = 80Kbit
# Higher speed allowed
WEIGHT = 5Kbit
Priority #
PRIO = 5
# IP you will limit
RULE = 10.0.0.20


9 - Save the file Esc: wq!


10 - Now we will create the configuration file output:
cd /etc/sysconfig/cbq/
came cbq-00101.CT.out <- Container name, create an output file created for each Container
11 - Insert the following content: -> use the drive for kilobytes kilobits http://letconversion.com/conversao-de-dados-de-armazenamento/de-kilobits/para-kilobytes


DEVICE = eth0, 100Mbit, 10Mbit, 1Mbit # Upload
# Transfer rate: 10kb / s
RATE = 80Kbit
# Higher speed allowed
WEIGHT = 5Kbit
Priority #
PRIO = 5
# IP you will limit
RULE = 10.0.0.20


12 - Save the file Esc: wq!
13 - Restart the service /etc/sysconfig/cbq/restart cbq.init
14 - Creating the file to start automatically on boot vim /etc/init.d/cbq-init
15 - Paste the content below:


#! / Bin / sh
# / Etc / sysconfig / cbq / cbq.init
#
case "$ 1" in
start)
/ Etc / sysconfig / cbq / cbq.init start
;;
stop)
/ Etc / sysconfig / cbq / stop cbq.init
;;
*)
echo "Use / etc / sysconfig / cbq / cbq.init {start | stop}"
exit 1
;;
esac
exit 0


16 - Save Esc: wq! and change permission to file chmod 700 /etc/init.d/cbq-init
17 - Run update-rc.d cbq-init defaults
18 - END


I'm no expert but I found this content and I was racking my brain, who can improve and maybe find a better way to do this would be good ... lol
anyone interested in test and tell me if it's working, or could improve, it would be good for us

Translation with google!
 
Thanks!

Proxmox Developers Team:
any Chance to get it as part of the gui?

Best Regards,
Star Network.
 
please take my curiosity: When you talk about ip address, you refer to a public ip address? I'm asking because I think that this script would not be applicable in case we had a VM (for example a container) behind a firewall (such as a KVM), is that correct?
 
I suppose that to adopt this code in the SCRIPT Proxmox, it is necessary that it is valid for ip addresses are public or private. It would be strange to see available bandwidth throttling option that is not applicable to all network interfaces and all the ip addresses. As you said in the first argument published, this script is valid for both KVM and CT ... this means that the script will need to be refined to work with all network interfaces, and for all classes of IP addresses.
 
Thanks!

Proxmox Developers Team:
any Chance to get it as part of the gui?

Best Regards,
Star Network.


Of course, thanks for the invite, I'm happy for the opportunity!
How can we do? The only problem is that my english is not very good, I use google for some things if you do not mind.
I would like to help where needed, as this project Proxmox is very good and would like to contribute to the development or even helping users.
I wonder if you tested and if it worked? I have not had the opportunity to test with public ips for not owning a range, things are different here in Brazil and even more difficult to achieve, but I think that works, because the rule applies to "virtual driver" and ip "associated . "

Best Regards,
Felipe Menezes
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!