Форум русскоязычного сообщества Ubuntu


Считаете, что Ubuntu недостаточно дружелюбна к новичкам?
Помогите создать новое Руководство для новичков!

Автор Тема: Проблема с HTB  (Прочитано 947 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн hackerochek

  • Автор темы
  • Новичок
  • *
  • Сообщений: 20
    • Просмотр профиля
Проблема с HTB
« : 22 Марта 2010, 16:03:51 »
 Доброе время суток, проблема такова, имеется сеть 40 компов, сервер ubuntu-server 9.10 + traffpro
eth0 = adsl modem 8Mb
eth1 = adsl modem 4Mb - adsl modem 4Mb
eth2 = lan
-------------------------------------------------------------------
/etc/init.d/route
#!/bin/sh

GW1="192.*6*.1.2"
GW2="192.*5*.1.2"
GW3="192.*5*.1.3"

    ip route flush table T1
    ip route flush table T2
    ip route flush table T3

    ip route add default via $GW1 table T1
    ip route add default via $GW2 table T2
    ip route add default via $GW3 table T3


    ip rule add from 10.0.0.2  table T1
    ip rule add from 10.0.0.3  table T1
    ip rule add from 10.0.0.4  table T2
    ip rule add from 10.0.0.5  table T3
..............
    ip rule add from 10.0.0.250  table T1
    ip rule add from 10.0.0.251  table T1
    ip rule add from 10.0.0.252  table T1
    ip rule add from 10.0.0.253  table T1
    ip rule add from 10.0.0.254  table T1

    ip route flush cache

exit 0

/etc/htb/eth2

R2Q=20
DEFAULT=0

/etc/htb/eth2-2.root
RATE=16Mbit
/etc/htb/eth2-2:2001
RATE=400Kbit
CEIL=1Mbit
LEAF=sfq
RULE=10.0.0.2
RULE=10.0.0.4
RULE=10.0.0.5
RULE=10.0.0.15
RULE=10.0.0.18
RULE=10.0.0.23
RULE=10.0.0.25
RULE=10.0.0.31
RULE=10.0.0.35
RULE=10.0.0.39
RULE=10.0.0.46
RULE=10.0.0.47
RULE=10.0.0.56
RULE=10.0.0.61
RULE=10.0.0.70
RULE=10.0.0.72
RULE=10.0.0.73
RULE=10.0.0.77
RULE=10.0.0.83
RULE=10.0.0.88
RULE=10.0.0.90
RULE=10.0.0.95
RULE=10.0.0.103
RULE=10.0.0.106
RULE=10.0.0.110
RULE=10.0.0.114
RULE=10.0.0.115
RULE=10.0.0.119
RULE=10.0.0.120
RULE=10.0.0.122
RULE=10.0.0.123
RULE=10.0.0.124
RULE=10.0.0.249
RULE=10.0.0.250
RULE=10.0.0.253
master2@Master2:~$ ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_seq=1 ttl=64 time=177 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=64 time=137 ms
64 bytes from 10.0.0.1: icmp_seq=3 ttl=64 time=239 ms
64 bytes from 10.0.0.1: icmp_seq=4 ttl=64 time=238 ms
64 bytes from 10.0.0.1: icmp_seq=5 ttl=64 time=158 ms
64 bytes from 10.0.0.1: icmp_seq=6 ttl=64 time=206 ms
64 bytes from 10.0.0.1: icmp_seq=7 ttl=64 time=220 ms
64 bytes from 10.0.0.1: icmp_seq=8 ttl=64 time=203 ms
64 bytes from 10.0.0.1: icmp_seq=9 ttl=64 time=345 ms
64 bytes from 10.0.0.1: icmp_seq=10 ttl=64 time=69.8 ms
64 bytes from 10.0.0.1: icmp_seq=11 ttl=64 time=219 ms
64 bytes from 10.0.0.1: icmp_seq=12 ttl=64 time=165 ms
64 bytes from 10.0.0.1: icmp_seq=13 ttl=64 time=181 ms
64 bytes from 10.0.0.1: icmp_seq=14 ttl=64 time=125 ms
64 bytes from 10.0.0.1: icmp_seq=15 ttl=64 time=198 ms
^C
--- 10.0.0.1 ping statistics ---
15 packets transmitted, 15 received, 0% packet loss, time 14020ms
rtt min/avg/max/mdev = 69.861/192.564/345.893/60.256 ms
master2@Master2:~$
----------------------------------------------------------------------------------------------------
это пинг на сервер, в онлайне было 20 компьютеров, из них 3 качали, под вечер качают 90% клиентов, пинг на сервер составляет от 500 и ....., инета почти нет, из за чего такое торможение?
root@bunker-server:~# top

top - 14:46:41 up  2:27,  4 users,  load average: 0.82, 1.08, 1.08
Tasks:  85 total,   1 running,  84 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.3%us,  1.3%sy,  0.0%ni, 90.0%id,  0.0%wa,  1.0%hi,  5.3%si,  0.0%st
Mem:   1535712k total,   958084k used,   577628k free,   147456k buffers
Swap:  3229024k total,        0k used,  3229024k free,   645400k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 1487 root      20   0  143m  46m 1184 S  6.0  3.1   9:34.51 billing           
 2367 root      20   0  2440 1128  884 R  0.3  0.1   0:00.03 top               
    1 root      20   0  2528 1440 1104 S  0.0  0.1   0:00.91 init               
    2 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kthreadd           
    3 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0       
    4 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0       
    5 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0         
    6 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 events/0           
    7 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 cpuset             
    8 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 khelper           
    9 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 netns             
   10 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 async/mgr         
   11 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kintegrityd/0     
   12 root      15  -5     0    0    0 S  0.0  0.0   0:00.17 kblockd/0         
   13 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kacpid             
   14 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kacpi_notify       
   15 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kacpi_hotplug

Оффлайн hackerochek

  • Автор темы
  • Новичок
  • *
  • Сообщений: 20
    • Просмотр профиля
Re: Проблема с HTB
« Ответ #1 : 01 Апреля 2010, 14:53:39 »
проблему решил.... кому интересно, пишите  :D

Оффлайн Silver Ghost

  • Участник
  • *
  • Сообщений: 107
    • Просмотр профиля
Re: Проблема с HTB
« Ответ #2 : 01 Апреля 2010, 15:10:23 »
Лучше бы Вы здесь расписали в чем она была.

Оффлайн hackerochek

  • Автор темы
  • Новичок
  • *
  • Сообщений: 20
    • Просмотр профиля
Re: Проблема с HTB
« Ответ #3 : 01 Апреля 2010, 16:49:02 »
вот конфиги
/etc/htb/eth2
R2Q=100
DEFAULT=30
/etc/htb/eth2-2.root
# Скорость корневого класса 100Мбит, так как других классов тут не будет
RATE=100Mbit
/etc/htb/eth2-2:10.local
# Правило для трафика в локальную сеть
RATE=1Kbit
CEIL=100Mbit
LEAF=sfq
RULE=10.0.0.0/24
PRIO=5
/etc/htb/eth2-2:20.clients
# Гарантированная скорость 512Кbit, для трафика проходящего к клиентам
RATE=512Kbit
CEIL=1Mbit
LEAF=sfq
RULE=10.0.0.4
RULE=10.0.0.14
RULE=10.0.0.18
RULE=10.0.0.22
RULE=10.0.0.26
RULE=10.0.0.46
RULE=10.0.0.72
RULE=10.0.0.79
RULE=10.0.0.86
RULE=10.0.0.103
RULE=10.0.0.110
RULE=10.0.0.120
PRIO=0
/etc/htb/eth2-2:30.all
# Правило по умолчанию. Оставшийся трафик будет интернет трафиком.
RATE=1Kbit
CEIL=1Mbit
LEAF=sfq
PRIO=5
всё сделал по этой статье http://wiki.enchtex.info/howto/htb

потом сделал это и вышло вот
# /etc/init.d/htb compile
/sbin/tc qdisc del dev eth2 root
/sbin/tc qdisc add dev eth2 root handle 1 htb default 30 r2q 100

find: warning: you have specified the -maxdepth option after a non-option argument (, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.

/sbin/tc class add dev eth2 parent 1: classid 1:2 htb rate 100Mbit

/sbin/tc class add dev eth2 parent 1:2 classid 1:10 htb rate 1Kbit ceil 100Mbit prio 5
/sbin/tc qdisc add dev eth2 parent 1:10 handle 10 sfq perturb 10
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.0/24 classid 1:10

/sbin/tc class add dev eth2 parent 1:2 classid 1:20 htb rate 512Kbit ceil 1Mbit prio 0
/sbin/tc qdisc add dev eth2 parent 1:20 handle 20 sfq perturb 10
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.4 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.14 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.18 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.22 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.26 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.46 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.72 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.79 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.86 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.103 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.110 classid 1:20
/sbin/tc filter add dev eth2 parent 1:0 protocol ip prio 100 u32 match ip dst 10.0.0.120 classid 1:20

/sbin/tc class add dev eth2 parent 1:2 classid 1:30 htb rate 1Kbit ceil 1Mbit prio 5
/sbin/tc qdisc add dev eth2 parent 1:30 handle 30 sfq perturb 10

# /etc/init.d/htb restart
но тормоз не исчез
сделал ещё 3-4 раза так

и всё работает так как надо  :coolsmiley:
в чём заключался последний каприз пока не выяснил  :-[
« Последнее редактирование: 01 Апреля 2010, 16:52:30 от hackerochek »

 

Страница сгенерирована за 0.107 секунд. Запросов: 24.