Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #http://manngupta.wordpress.com/bandwidth-management-with-htb/
- cd /usr/local/src
- wget http://www.udiniqgeek.com/download/HTB-tools-0.3.0a-i486-1.tgz
- or, http://downloads.ziddu.com/downloadfile/16666271/HTB-tools-0.3.0a-i486-1.tgz
- tar -zxvf HTB-tools-0.3.0a-i486-1.tgz
- cd /usr/local/src/sbin
- mv htb /sbin
- mv htbgen /sbin
- mv q_checkcfg /sbin
- mv q_parser /sbin
- mv q_show /sbin
- cd /usr/local/src/etc
- mv htb /etc
- mv /etc/htb/eth0-qos.cfg.new /etc/htb/eth0-qos.cfg
- mv /etc/htb/eth1-qos.cfg.new /etc/htb/eth1-qos.cfg
- cd /usr/local/src/etc/rc.d
- mv rc.htb.new /etc/init.d/rc.htb
- chmod 755 /etc/init.d/rc.htb
- #Then Setting file eth0-qos cfg and eth1-qos cfg bandwidth limit as needed, and here I will explain to limit bandwidth on eth1 (LAN Office) :
- nano /etc/htb/eth1-qos.cfg
- *upload limit(external eth) -> src: /etc/htb/eth0-qos.cfg
- *dowload limit(internal eth)-> dst: /etc/htb/eth1-qos.cfg
- class Internet_Office {
- bandwidth 1024;
- limit 2048;
- burst 2;
- priority 1;
- client Manager {
- bandwidth 256;
- limit 512;
- burst 2; #NEW 0 = burst automatic calculation
- priority 1;
- dst { 192.168.168.5/32; }; #src
- };
- client secretary {
- bandwidth 64;
- limit 256;
- burst 2;
- priority 1;
- dst { 192.168.168.7/32; };
- };
- client Staff {
- bandwidth 256;
- limit 512;
- burst 2;
- priority 1;
- dst { 192.168.168.11/32; 192.168.168.12/32; };
- };
- };
- class default { bandwidth 8; };
- #description:
- bandwidth: guaranteed minimum
- limit: maximum transfer rate
- burst: maximum number of kbits *0 = automatic
- priority: 0-7
- ----------------
- 192.168.100.12/32; - single IP;
- 192.168.1.0/24; - class representation;
- 192.168.1.14/32 80 25; - limit the traffic on port 80 and 25 for a single IP;
- 192.168.1.0/24 25; - limit tge traffic on port 25 for a class;
- *dowload
- /etc/init.d/rc.htb start_eth1
- /etc/init.d/rc.htb show_eth1
- /etc/init.d/rc.htb stop_eth1
- -----------------------------
- *upload
- /etc/init.d/rc.htb start_eth0
- /etc/init.d/rc.htb show_eth0
- /etc/init.d/rc.htb stop_eth0
- *Run automatically when the PC in rebot, into rc.local
- nano /etc/rc.local
- /etc/init.d/rc.htb start
- or,
- /etc/init.d/rc.htb start_eth1
- /etc/init.d/rc.htb start_eth0
Advertisement
Add Comment
Please, Sign In to add comment