Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Witam! W oparciu o art z tej stronki napisałem coś takiego:
# UPLOAD eth0
tc qdisc del root dev eth0
tc qdisc add dev eth0 root handle 1:0 htb
tc class add dev eth0 parent 1:0 classid 1:1 htb rate 256kbit ceil 256kbit
tc class add dev eth0 parent 1:1 classid 1:2 htb rate 50kbit ceil 50kbit
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 50kbit ceil 50kbit
tc class add dev eth0 parent 1:1 classid 1:4 htb rate 50kbit ceil 50kbit
tc class add dev eth0 parent 1:1 classid 1:5 htb rate 50kbit ceil 50kbit
tc class add dev eth0 parent 1:1 classid 1:6 htb rate 50kbit ceil 50kbit
tc filter add dev eth0 protocol ip parent 1:0 u32 match ip src 192.168.100.3 flowid 1:2
tc filter add dev eth0 protocol ip parent 1:0 u32 match ip src 192.168.100.7 flowid 1:3
tc filter add dev eth0 protocol ip parent 1:0 u32 match ip src 192.168.100.10 flowid 1:4
tc filter add dev eth0 protocol ip parent 1:0 u32 match ip src 192.168.100.15 flowid 1:5
tc filter add dev eth0 protocol ip parent 1:0 u32 match ip src 192.168.100.17 flowid 1:6
# DOWNLOAD eth1
tc qdisc del root dev eth1
tc qdisc add dev eth1 root handle 2:0 htb
tc class add dev eth1 parent 2:0 classid 2:1 htb rate 1024kbit ceil 1024kbit
tc class add dev eth1 parent 2:1 classid 2:2 htb rate 128kbit ceil 128kbit
tc class add dev eth1 parent 2:1 classid 2:3 htb rate 128kbit ceil 128kbit
tc class add dev eth1 parent 2:1 classid 2:4 htb rate 128kbit ceil 128kbit
tc class add dev eth1 parent 2:1 classid 2:5 htb rate 128kbit ceil 128kbit
tc class add dev eth1 parent 2:1 classid 2:6 htb rate 128kbit ceil 128kbit
tc filter add dev eth1 protocol ip parent 2:0 u32 match ip dst 192.168.100.3 flowid 2:2
tc filter add dev eth1 protocol ip parent 2:0 u32 match ip dst 192.168.100.7 flowid 2:3
tc filter add dev eth1 protocol ip parent 2:0 u32 match ip dst 192.168.100.10 flowid 2:4
tc filter add dev eth1 protocol ip parent 2:0 u32 match ip dst 192.168.100.15 flowid 2:5
tc filter add dev eth1 protocol ip parent 2:0 u32 match ip dst 192.168.100.17 flowid 2:6
Download bardzo ładnie tnie tak jak jest ustawione, natomiast z uploadem nic nie robi. Domyślam się, że bład jest w sekcji: src 192.168.100.3 itp. bo chyba źródłem jest interfejs wewnętrzny a nie poszczególne IP kompów wewnątrz sieci. Markować je i jakoś przpeuszczać przez HTB, jeśli tak to jak, a może jest jakiś inny spsób.
Pozdrawiam
Offline
Przeczytaj dokladnie artykul i tam jest upload zrobiony przez markowanie pakietow.
Offline
Uploadu nie tnie Ci dlatego, że maskujesz (NAT / MASQUARADE) adresu. Pakiety, wychodząc z interfejsu, mają już adres źródłowy bramki, a nie 102.168.0.3, 192.168.0.7 itd. Dlatego na te filtry nie załapują się pakiety. W tej sytuacji musisz opznaczać pakiety na firewallu (iptables -t mangle ... -j MARK ...). Natomiast przy pomocy tc ustawiasz filtry wyłapujące pakiety na podstawie tychże oznaczeń (a nie adresów źródłowych). Skorzystaj z artykułu wskazanego przez BiExi. Tam jest właśnie takie podejście.
Offline
tu jest świetny opis:
http://linio.terramail.pl/htb.pdf
Offline