找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 4320|回复: 10

[coyote] [分享]使coyote2.05支持带宽控制(流量控制)

[复制链接]
发表于 2004-1-11 13:51:05 | 显示全部楼层
先请下载这个文件:
http://dolly.czi.cz/coyote/binary/coyote-2...qos-ide_v03.tgz

(用这个文件制作的系统可以支持硬盘的,也就是说可以考到硬盘上)在linux下制作软盘,然后用软盘启动系统,启动后,编辑/etc/qos.classes 和etc/qos.filters 这两个文件,进行带宽的配置。就可以了
routeros
回复

使用道具 举报

 楼主| 发表于 2004-1-11 13:51:39 | 显示全部楼层
原文:
Hi,

I have put together an updated coyote linux disk creator which supports bandwidth control (QOS) and optional IDE support. It's based on official disk creator (coyote linux 2.05) and you will need working linux system to create floppies.

It can be downloaded on my coyote page http://dolly.czi.cz/coyote/

I've also included my bandwidth control init scripts, they are disabled by default. If you want try them, edit /etc/qos.classes to suit your needs and uncomment this line somewhere at the beginning ...
#QOS_SETUPED=YES

technical info:
- QOS support enabled in kernel
- HTB, SFQ, U32 classifier, Firewall based classifier compiled as modules
- Netfilter packet mangling and MARK target enabled
- tc binary (with current HTB patch) from iproute2 package added
- IDE support enabled (optional)
- optional QOS init scripts (/etc/qos.classes, /etc/qos.filters, /etc/rc.d/rc.traffic) added

Let me know if it works for you. As i know myself, there will probably be many bugs ) I'm using direct ethernet connection so i don't know if it works for PPP and PPPOE.
routeros
回复

使用道具 举报

 楼主| 发表于 2004-1-11 13:52:00 | 显示全部楼层
Coyote Linux Packages & Tools
Coyote Traffic Control - RRDTool - Other Packages - Links

Coyote Traffic Control
10.1.2004
- Coyote linux 2.05 QOS-enabled disk creator added

13.10.2003
- Another small update in qos init scripts

12.10.2003
- Added QOS wizard update build from original coyote linux kernel config with qos enabled (all modules included), contains updated qos init scripts.
- Updated qos.tgz, there was bug in QOS classes priorities assignments.

I have been using coyote linux with traffic control (QOS) support for some time now without any major problems. For traffic control support in coyote you will need new kernel with qos enabled, tc program from iproute2 package and probably some init scripts. You can download here qos enabled kernel, modules, tc and some init scripts that i'm using on my coyote box.

1. QOS-Enabled coyote 2.05 disk creator
Contains updated QOS init scripts for coyote linux 2.05. Disk creator supports two coyote version standard+qos and standard+qos+ide. This is updated official linux coyote disk creator and installation is the same as official one (you will need functional linux system to run this package, here are some information how to make floppy using Knoppix distribution).

coyote-2.05-qos-ide.tgz

You have to setup upstream/downstream limits and QOS classes hierarchy first. QOS configuration is stored in two files

/etc/qos.classes - upstream/downstream limits, qos class hierarchy
/etc/qos.filters - QOS clasification filters

QOS class chain is build by /etc/rc.d/rc.traffic script, which is started automaticaly after bootup at the end of rc.inet.

2. QOS integration with windows coyote wizard 2.2.3 (coyote 2.02)
Download coyote disk creator wizard (version 2.2.3 ) and unpack it somewhere
Download QOS-wizard update and unpack to the same directory (some files will be overwritten)
Build coyote boot disk as usual and boot up. You should have full HTB, SFQ and CBQ qdisc support with u32 and fw filter classifiers.
Edit /etc/qos.classes and /etc/qos.filters to suit your needs
Run /etc/rc.d/rc.traffic to initialize your QOS setup (rc.traffic is NOT started automatically after system boot)
QOS wizard updates:

qos-wizard-2.2.3-allmods.zip  kernel-config  Wizard update with QOS support (HTB, CBQ, SFQ, cls_fw, cls_u32), includes all modules.  
qos-ide-wizard-2.2.3-allmods.zip  kernel-config  Wizard update with QOS support (HTB, CBQ, SFQ, cls_fw, cls_u32) and IDE hard drive support, includes all modules.  

3. Manual Setup (coyote 2.02)
Download kernel image
   qos-kernel.zip
- Simple QOS enabled kernel

  qos-ide-kernel.zip
- QOS enabled kernel with IDE hard drive support


Download kernel modules
Download compiled tc binary from iproute2

Build new modules.tgz using downloaded modules (do not forget to add qos modules ... sch_htb.o, sch_sfq.o, sch_cbq.o, cls_u32.o, cls_fw.o) and edit /etc/modules
Copy tc binary to /usr/sbin/tc in root.tgz
Replace your current kernel with downloaded one (linux file in root directory of boot device)
Reboot ... qos should be working now.
QOS setup and init scripts
Here are my qos init scripts . There are three files ( /etc/qos.classes , /etc/qos.filters , /etc/rc.d/rc.traffic )

qos.classes - is used to define upstream/downstream values, guaranteed bandwidth for different qos classes and actual qos class tree (it is explained there with some samples)
qos.filters - categorization rules for qos classes (read comments in qos.classes you should know what they are then).
rc.traffic - traffic control init script, uses qos.classes and qos.filters for configuration. If you want to run it automatically, end of rc.firewall file is good place for this.

Idea behind this init script is quite simple, it uses HTB as primary queuing discipline with some SFQ classes on it's leaves. Root classes with maximum bandwidth specified as downstream/upstream are created automatically with id 1:1. You can then define class hierarchy with three types of subclasses. Each class has it's own classid /1:10-1:80/ and when you create it, you specify id of it's parent class.

define_class - Simple container class which is used only as container for other classes. In is specified with guaranteed and maximum bandwidth and ip specification filter.
define_class_sfq - Simple leaf is created with specified guaranteed and maximum allowed bandwidth and ip specification filter
define_class_qos - Full QOS leaf with 3 priority subclasses is created.
RRDTool
I have created small RRD frontend for monitoring my coyote box. It uses some shell scripts to gather data for RRD databases and slightly modified RRDcgi program to visualize data in browser. RRDtool is quite big, i don't know if it fits on the floppy because i'm using old hard drive to boot coyote.

This package is quite difficult  to install and needs a lot of manual setup and some basic HTML knowledge. Here are only some basic steps how does it work and what files need to be changed.

    Here you can see static html snapshots taken from this monitoring front end
If you want to give it a try, download following two coyote packages (see install notes bellow)

RRDtool package (190kB)
RRDstats package (7kB)
  

Remember this is a test version, so configuration is sometimes not simple and maybe even not logical  

RRDtool package

Contains only rrdtool and rrdcgi programs (together with needed libraries) no configuration is needed.

RRDstats package

Contains all shell script for reading data from ethernet adapters, QOS classes and querying link quality. QOS support is disabled by default.

/etc/rrd.config  one and only configuration file. You can define database names, querying intervals, bandwidth limits,... here  
/var/rrd/script/rrd.create  script file that creates empty RRD databases, run this script after you setup rrd.config. Databases are saved with package if you save coyote linux configuration. default database directory is /var/rrd/data/  

at this time it's not possible to setup everything in config file. Some things must be changed by hand.

line capacity  Configuration located in graph template files
/var/rrd/www/templates/*.tpl

IN/OUT and QOS graphs have predefined upper and lower limits, there limits should be set somewhat more than your actual line capacity. That values are controlled in the templates with statements

   --upper-limit 300
   --lower-limit 0

There are horizontal lines at link capacity boundaries in IN/OUT and QOS graphs. In IN/OUT graph there is also link capacity displayed at the bottom of the graph. This is defined at the bottom of template files .. lines you are looking for look like this

   HRULE:256#009000:""
   HRULE:96#000090:""


Enabling QOS support

QOS graphing support is disabled by default because it requires my qos init scripts. If you installed that scripts you can try to enable qos support. At first setup QOS in rrd.config (i hope there are some samples how to set databases and data gathering)

/etc/rc.d/pkgs/rc.rrdstats - at the of this file uncomment lines that run qos data gathering daemon ( /var/rrd/script/rrd.run.qos )
/var/rrd/www/include/menu.inc - under Link quality menu there is QOS menu commented out (with examples)
/var/rrd/www/index.cgi - if you want to have some QOS displayed in overview define it here (example is included there)

Other Small Packages
Here are some packages that i build myself, and which i am using on my coyote box. They work pretty good for me, but they have not been tested on other system setups (all compiled against uClibc 0.9.16 /eg. coyote linux 2.0/).

hdparm.tgz (12kB)

If you are booting coyote linux using IDE hard drive you could find this package quite useful. It sets IDE disk sleep timeout time (default is 1 minute on /dev/hda1 ) id you want to set other device or timeout edit /etc/rc.d/pkgs/rc.hdparm.

ntpcli.tgz (7kB)

Contains ntp client, which allows you to synchronize computer time using ntp servers. You will have to set correct time zone in /etc/TZ or TZ variable (format is described here ) otherwise it will not work properly. Time is set every 10minutes by default, you can change this behavior and also ntp server address in /etc/rc.d/pkgs/rc.ntpcli

noip.tgz (14kB)

No-ip.com dns updater. Updates dynamic ip address on your no-ip.com account. You have to configure updater after first boot with this package with /bin/noip2 -C

iptraf.tgz (132kB)

IPtraf 2.7.0 traffic analyzer. If you are connecting to coyote linux over ssh using putty and want to see iptraf console in colors, set putty's terminal type string to xterm-color.

Interesting links

Coyote Linux Homepage
Claudio's coyote pages and add-ons

HTB homepage
routeros
回复

使用道具 举报

 楼主| 发表于 2004-1-11 13:52:32 | 显示全部楼层
http://www.coyotelinux.com/modules.php?nam...6&i=1635&t=1635
routeros
回复

使用道具 举报

发表于 2004-1-11 14:40:58 | 显示全部楼层
谢谢Wsgtrsys推荐好东西给大家!
routeros
回复

使用道具 举报

 楼主| 发表于 2004-1-11 15:20:15 | 显示全部楼层
http://ccpi.gov.cn/linux/cisco/Cisco_config/cisco.php3
routeros
回复

使用道具 举报

发表于 2004-1-11 15:20:18 | 显示全部楼层
不是说有 bug吗?
routeros
回复

使用道具 举报

 楼主| 发表于 2004-1-13 17:18:59 | 显示全部楼层
是的,它说它没有在pppoe的模式下试过,但是在其它环境下工作是正常的。
大家有空可以多去看看这个网站:
http://dolly.czi.cz/coyote/#traffic
routeros
回复

使用道具 举报

 楼主| 发表于 2004-1-15 08:37:31 | 显示全部楼层
网站介绍最新的版本已经支持web界面进行管理带宽了,有人可以试一试吗?
routeros
回复

使用道具 举报

发表于 2004-1-16 09:06:23 | 显示全部楼层
我今天有空会试试的!
routeros
回复

使用道具 举报

 楼主| 发表于 2004-1-16 10:01:45 | 显示全部楼层
OK
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-12-23 05:24 , Processed in 0.051988 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表