Автор Тема: Шейпване на бг и инт нет само с tc?  (Прочетена 1411 пъти)

0FF1

  • Напреднали
  • *****
  • Публикации: 127
    • Профил
Има ли начин да се шейпнат бг нета и интрнешънъла без да се маркират пакети в iptables.

само с tc и filter ??

може ли така да стане?
Активен

PEOPLE = S H I T!

gat3way

  • Напреднали
  • *****
  • Публикации: 6050
  • Relentless troll
    • Профил
    • WWW
Шейпване на бг и инт нет само с tc?
« Отговор #1 -: Oct 31, 2006, 09:43 »
с u32 филтри предполагам ще стане. Не съм сигурен дали подържат CIDR маски обаче, би трябвало, но ако не подържат ще се окаже много приятна занимавка...
Активен

"Knowledge is power" - France is Bacon

0FF1

  • Напреднали
  • *****
  • Публикации: 127
    • Профил
Шейпване на бг и инт нет само с tc?
« Отговор #2 -: Oct 31, 2006, 11:54 »
какви са тези CIDR маски?
Активен

PEOPLE = S H I T!

Hapkoc

  • Напреднали
  • *****
  • Публикации: 2117
    • Профил
Шейпване на бг и инт нет само с tc?
« Отговор #3 -: Oct 31, 2006, 11:58 »
http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

Просто префикси, примерно: 192.168.1/24
Активен

0FF1

  • Напреднали
  • *****
  • Публикации: 127
    • Профил
Шейпване на бг и инт нет само с tc?
« Отговор #4 -: Oct 31, 2006, 12:30 »
ааа незнаех че така се наименоват ... моя грешка .. иначе имам тука един примерен скрипт и мисля по него да работя ..

Примерен код

...
$tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 62.44.96.0/19 flowid 2:2
...


и така ще взема всички бг мрежи от ip.ludost.net

надявам се да стане, защото сега целия трафик общо се шейпва + това маркирането с iptables ми се вижда много по-сложно
Активен

PEOPLE = S H I T!

VladSun

  • Напреднали
  • *****
  • Публикации: 2166
    • Профил
Шейпване на бг и инт нет само с tc?
« Отговор #5 -: Nov 01, 2006, 15:33 »
Хм, интересно - пиши, ако успееш.
Въпреки, че на мен ми се струва, че така ще стане още-по сложно, отколкото с iptables маркиране  '<img'>

И веднага ти казвам за един проблем - ако ползваш маскиране на частни ИП-адреси, то няма начин да правиш ограничение за трафика за всяко ИП по отношение на upload-a (освен, ако не ползваш IMQ). Причината е, че логически TC-то работи след POSTROUTING-a.



Активен

KISS Principle ( Keep-It-Short-and-Simple )
http://openfmi.net/projects/flattc/
Има 10 вида хора на този свят - разбиращи двоичния код и тези, които не го разбират :P

gat3way

  • Напреднали
  • *****
  • Публикации: 6050
  • Relentless troll
    • Профил
    • WWW
Шейпване на бг и инт нет само с tc?
« Отговор #6 -: Nov 01, 2006, 16:10 »
Сещам се един груб начин това ограничение да се преодолее и да се шейпва индивидуално изходящият трафик на всеки клиент зад НАТ-а, стига да не са много клиентите '<img'>

На НАТ-ващата машина вдигаш за всички клиенти по един alias с адрес, който се ползва като default gw от конкретен клиент с частен адрес. В последствие набиваш на машината нещо от сорта на:

ip route add client_address_N  dev ethX:alias_N realm N
tc filter add dev ethX parent _parent_ protocol ip route from N classid _classid_

За всеки един клиент.

Не съм го пробвал но предполагам че ще проработи. Въпросът е че е дървен метод, по един alias за всеки клиент (разхищение на адресно пространство най-малкото).

--------------
Поправка: няма да стане, статичния рутинг не признава алиаси верно
# ifconfig eth0:1 5.5.5.5 up
# ip rou add 5.5.5.5  dev eth0:1 realm 2
# ip rou ls
5.5.5.6 dev eth0  scope link realm 2
...
5.0.0.0/8 dev eth0  proto kernel  scope link  src 5.5.5.5

Ммммдам...няма да стане..



Активен

"Knowledge is power" - France is Bacon

0FF1

  • Напреднали
  • *****
  • Публикации: 127
    • Профил
Шейпване на бг и инт нет само с tc?
« Отговор #7 -: Nov 01, 2006, 20:17 »
Примерен код

#!/bin/bash

# eye?aou ei?aooaeo
dev=eth0

# on? a? tc
tc=/sbin/tc

htb_stats ()
{
# show class stats
$tc -s -d class show dev $dev
# show qdisc stats
$tc -s -d qdisc show dev $dev
} #htb_stats

htb_stop ()
{
# remove all qdiscs from $dev
$tc qdisc del dev $dev root &>/dev/null
} # htb_stop

htb_start ()
{
set -x

# attach root discipline
$tc qdisc add dev $dev root handle 2: htb default 500


###################################################
# default iiao, ? i?e?? o?oaaa? ?oeaie ?o?aiaie
# ya iau? yaaaioia 64I?e?a
################

bg=1000kbps
int=100kbps
#www=10kbps


#################
# Default Class #
#################
/sbin/tc class add dev $dev parent 2:0 classid 2:500 htb rate 8kbit prio 10
/sbin/tc qdisc add dev $dev parent 2:500 sfq perturb 10






#################
# Peering Class #
#################
/sbin/tc class add dev $dev parent 2:0 classid 2:1 htb rate $bg ceil $bg prio 3
/sbin/tc qdisc add dev $dev parent 2:1 sfq perturb 1

/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 62.44.96.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 62.73.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 62.176.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 62.200.195.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 62.204.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 62.213.160.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 80.72.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 80.80.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 80.95.16.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 80.246.192.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 80.253.48.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 81.161.208.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 81.161.240.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.101.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.103.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.118.224.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.119.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.137.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.146.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.147.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 82.199.192.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.97.24.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.97.64.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.142.16.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.143.144.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.143.176.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.143.248.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.148.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.222.160.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.222.176.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.222.188.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 83.228.0.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.1.240.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.21.192.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.22.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.38.240.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.43.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.54.128.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.201.192.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.238.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.242.128.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.252.0.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 84.254.179.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.11.128.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.14.0.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.91.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.95.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.118.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.118.192.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.130.0.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.187.0.0/16 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.196.128.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.217.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.239.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.255.128.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 85.255.160.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.97.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.116.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.118.128.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.119.64.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.120.0.0/15 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.126.0.0/16 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.227.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.239.152.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.246.0.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.247.248.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 87.252.160.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 88.80.96.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 88.80.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 88.87.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 88.203.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 88.213.192.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 89.25.0.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 89.106.96.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 89.186.192.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 89.190.192.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 89.215.0.0/16 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 89.252.192.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 89.253.128.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 91.92.0.0/16 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 91.139.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 161.123.0.0/16 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 192.92.129.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.16.102.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.16.157.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.16.246.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.17.229.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.19.172.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.22.103.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.22.248.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.23.52.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.24.240.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.25.162.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.26.14.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.26.216.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.28.250.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.29.55.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.30.228.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.41.64.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.41.182.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.41.188.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.41.206.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.43.26.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.47.74.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.68.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.68.96.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.68.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.84.86.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.93.24.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.108.24.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.108.32.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.109.54.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.110.82.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.110.132.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.110.159.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.110.216.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.111.89.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.111.194.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.138.67.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.151.20.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.151.80.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.178.152.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.178.166.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.178.222.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.192.48.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.192.56.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.193.162.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.193.164.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.193.182.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.194.140.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.194.156.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.200.0.0/16 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.201.114.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.201.172.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.201.240.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.202.43.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.202.91.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 193.254.29.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.8.53.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.8.60.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.9.6.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.12.224.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.34.12.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.50.73.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.50.76.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.50.122.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.54.140.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.63.136.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.79.12.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.88.228.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.88.250.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.141.0.0/16 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.145.63.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.145.160.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.146.232.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.150.116.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.150.180.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.153.145.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.187.132.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 194.246.110.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.8.222.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.10.193.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.14.10.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.20.20.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.20.24.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.22.146.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.24.32.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.24.88.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.34.96.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.39.198.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.39.212.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.47.193.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.62.22.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.64.160.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.68.200.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.68.214.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.69.108.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.69.120.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.69.164.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.72.112.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.74.85.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.85.215.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.96.224.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.114.112.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.128.224.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.137.252.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.138.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.149.248.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.170.166.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.177.218.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.177.248.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.178.98.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.189.224.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.214.248.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.225.124.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.225.252.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.230.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.234.84.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.234.236.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.238.84.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.242.106.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.242.126.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.242.240.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 195.246.240.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.5.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.7.192.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.21.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.24.116.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.25.32.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.36.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.39.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.50.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.56.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.72.192.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.73.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.91.160.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.95.160.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.104.96.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.116.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.122.160.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 212.124.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.16.32.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.91.128.0/17 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.130.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.137.32.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.137.48.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.137.50.0/23 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.137.52.0/22 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.137.56.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.145.96.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.167.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.169.32.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.174.0.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.191.192.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.222.32.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.226.0.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 213.240.192.0/18 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.9.224.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.10.240.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.17.55.0/24 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.17.56.0/21 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.18.240.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.30.208.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.75.128.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.79.32.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.79.64.0/19 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.145.80.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.145.160.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.174.144.0/20 flowid 2:1
/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 1 u32 match ip src 217.197.128.0/20 flowid 2:1




#######################
# International Class #
#######################
/sbin/tc class add dev $dev parent 2:0 classid 2:2 htb rate $int ceil $int prio 1
/sbin/tc qdisc add dev $dev parent 2:2 sfq perturb 10

/sbin/tc filter add dev $dev parent 2:0 protocol ip prio 8 u32 match ip src 0.0.0.0/0 flowid 2:2




##Set filter for internal network

/sbin/tc filter add dev $dev parent 2:1 protocol ip prio 6 u32 match ip dst 192.168.0.1/24 flowid 2:11
/sbin/tc filter add dev $dev parent 2:2 protocol ip prio 2 u32 match ip dst 192.168.0.1/24 flowid 2:12




} # htb_start

case "$1" in

    ### START ###
    start)
        htb_start
    ;;

    ### STOP ###
    stop)
        htb_stop
    ;;

    ### RESTART ###
    restart)
        $0 stop
        $0 start
    ;;

    ### STATS ###
    stats)
        htb_stats
    ;;

    ### default ###
    *)
        echo "Usage: " `basename $0` "{start|stop|restart|stats}"
esac




Ето това сътворих и доклокото тествах .... шейпва доунлода правилно... обаче ако не мога да шейпвам ъплоада както казвате ... май ще трябва да маркирам пакети  ':ok:'  ':crazy:'  ':crazy:'  ':angry:'
Активен

PEOPLE = S H I T!

0FF1

  • Напреднали
  • *****
  • Публикации: 127
    • Профил
Шейпване на бг и инт нет само с tc?
« Отговор #8 -: Nov 22, 2006, 18:40 »
хора може ли да ми дадете елементарен файъруол с маркираране на пакети БГ/INT UP/DOWN от една C клас мрежа '<img'>

Искам някакъв работещ пример... четох някви неща но те са накъсани и не  мога да ги сглобя ... все нещо не сработва..

По-горния пример с маркиране от tc не работи както трябва .. .: '<img'>



Активен

PEOPLE = S H I T!