Freesco, NND, CDN, EOS
http://forum.freesco.pl/

[HTB] i problemy z ograniczaniem pasma
http://forum.freesco.pl/viewtopic.php?f=22&t=4873
Strona 1 z 1

Autor:  Anonymous [ wtorek, 6 lipca 2004, 10:50 ]
Tytuł:  [HTB] i problemy z ograniczaniem pasma

zainstalowałem na serwerze [NND] usugę do ograniczenia przepustowości [HTB] i zaobserwowałem dziwną systuację dla jednego z klinetów 192.168.0.15 nie działa ograniczenie a dla innych tak. WW klient używa programu FlashGet i zapycha całe łącze tak że inni nie mogą przeglądać nawet stron. (DSL 512, 30 userów).

Fragment pliku /usr/src/rchtb/ready/rc.htb:

#!/bin/bash
# rc.htb 0.3.3-stable, (C)PriSM 2oo3, GNU GPL
# <http://www.rc.htb.prv.pl/>
# Poprawki Zciech 0.1
# wygenerowano: 06/24/04 12:41:50

VER=0.3.3-stable

stop()
{
/sbin/rchtb_tc qdisc del root dev eth0 2> /dev/null
/sbin/rchtb_tc qdisc del root dev eth1 2> /dev/null
}

start()
{
stop # dla bezpiecze&ntilde;stwa

# INTERFEJS ETH1 (ruch przychodz&plusmn;cy)
/sbin/rchtb_tc qdisc add dev eth1 root handle 1:0 htb default 3 r2q 1

# G&sup3;ówna klasa dla eth1
/sbin/rchtb_tc class add dev eth1 parent 1:0 classid 1:1 htb rate 90000kbit ceil 90000kbit

# Podzia&sup3; na pasmo dla &sup3;&plusmn;cza internetowego i reszt&ecirc;
/sbin/rchtb_tc class add dev eth1 parent 1:1 classid 1:2 htb rate 640kbit ceil 640kbit
/sbin/rchtb_tc class add dev eth1 parent 1:1 classid 1:3 htb rate 89494kbit ceil 89494kbit prio 9
/sbin/rchtb_tc qdisc add dev eth1 parent 1:3 sfq perturb 10

# pasmo priorytetowe dla ICMP, TOS 0x10 (min. delay) oraz wybranego portu 22
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:20 htb rate 16kbit ceil 506kbit prio 1 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:20 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 3 parent 1:0 u32 match ip sport 22 0xffff flowid 1:20
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 2 parent 1:0 u32 match ip tos 0x10 0xff flowid 1:20
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 2 parent 1:0 u32 match ip protocol 1 0xff flowid 1:20

# xx_10
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:21 htb rate 16kbit ceil 64kbit prio 2 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:21 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.0.10 flowid 1:21

# xxx_11
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:22 htb rate 16kbit ceil 128kbit prio 2 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:22 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.0.11 flowid 1:22

# xxxxx_12
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:23 htb rate 16kbit ceil 64kbit prio 2 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:23 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.0.12 flowid 1:23

# xxx_13
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:24 htb rate 16kbit ceil 128kbit prio 2 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:24 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.0.13 flowid 1:24

# xx_14
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:25 htb rate 16kbit ceil 128kbit prio 2 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:25 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.0.14 flowid 1:25

# xxx_15
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:26 htb rate 16kbit ceil 128kbit prio 2 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:26 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 5 parent 1:0 u32 match ip dst 192.168.0.15 flowid 1:26

Autor:  zciech [ piątek, 1 października 2004, 12:18 ]
Tytuł: 

Dlaczego ten post jest w
Forum Strona Główna -> Problemy z konfiguracją - Freesco 0.3 skoro jest o NND ? wprowadzasz balagan.

prawdopodobnie zasuwa po klasie priorytetowej.
zainstaluj statystyki htb i zobacz gdzie jest ten ruch.
prawdopodobnie wystarczy w klasach 1:20 i 2:9 zaplotkowac:
# pasmo priorytetowe dla ICMP, TOS 0x10 (min. delay) oraz wybranego portu 22
/sbin/rchtb_tc class add dev eth1 parent 1:2 classid 1:20 htb rate 16kbit ceil 506kbit prio 1 quantum 1500
/sbin/rchtb_tc qdisc add dev eth1 parent 1:20 sfq perturb 10
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 3 parent 1:0 u32 match ip sport 22 0xffff flowid 1:20
#/sbin/rchtb_tc filter add dev eth1 protocol ip prio 2 parent 1:0 u32 match ip tos 0x10 0xff flowid 1:20
/sbin/rchtb_tc filter add dev eth1 protocol ip prio 2 parent 1:0 u32 match ip protocol 1 0xff flowid 1:20


# klasa priorytetowa TOS 0x10 oraz ICMP
/sbin/rchtb_tc class add dev ppp0 parent 2:1 classid 2:9 htb rate 2kbit ceil 111kbit prio 2 quantum 1500
/sbin/rchtb_tc qdisc add dev ppp0 parent 2:9 sfq perturb 10
# /sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip tos 0x10 0xff flowid 2:9 # TOS 0x10
/sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 2 u32 match ip dport 22 0xffff flowid 2:9 # port 22
/sbin/rchtb_tc filter add dev ppp0 parent 2:0 protocol ip prio 1 u32 match ip protocol 1 0xff flowid 2:9 # ICMP

Strona 1 z 1 Strefa czasowa UTC+2godz.
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/