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/.
Mam taki oto skrypt
#!/bin/sh # shaper.sh -- prosty i łatwy skrypt do zarz±dzania pasmem if [ "$1" == "stop" ] then echo "Zatrzymujemy shapera" tc qdisc del root dev eth1 2>/dev/null tc qdisc del root dev ppp0 2>/dev/null iptables -t mangle -D POSTROUTING -o ppp0 -j MYSHAPER-OUT 2>/dev/null iptables -t mangle -F MYSHAPER-OUT 2>/dev/null iptables -t mangle -X MYSHAPER-OUT 2>/dev/null exit fi if [ "$1" == "start" ] then # To co było wcze¶niej -- do pieca! :) echo "Uruchamiamy shapera" tc qdisc del root dev eth1 2>/dev/null tc qdisc del root dev ppp0 2>/dev/null iptables -t mangle -D POSTROUTING -o ppp0 -j MYSHAPER-OUT 2>/dev/null iptables -t mangle -F MYSHAPER-OUT 2>/dev/null iptables -t mangle -X MYSHAPER-OUT 2>/dev/null ########## DOWNLOAD tc qdisc add dev eth1 root handle 1:0 htb ######### DOWNLOAD ######### Teraz przydział pasma na kolejkę tc class add dev eth1 parent 1:0 classid 1:1 htb rate 99000kbit ceil 99000kbit quantum 1500 tc class add dev eth1 parent 1:1 classid 1:2 htb rate 1000kbit ceil 1100kbit quantum 1500 tc class add dev eth1 parent 1:1 classid 1:3 htb rate 98000kbit ceil 98000kbit quantum 1500 tc class add dev eth1 parent 1:2 classid 1:4 htb rate 125kbit ceil 1100kbit quantum 1500 #Yakub tc class add dev eth1 parent 1:2 classid 1:5 htb rate 125kbit ceil 300kbit quantum 1500 #Michal tc class add dev eth1 parent 1:2 classid 1:6 htb rate 125kbit ceil 300kbit quantum 1500 #Marek tc class add dev eth1 parent 1:2 classid 1:7 htb rate 125kbit ceil 300kbit quantum 1500 #Mazur tc class add dev eth1 parent 1:2 classid 1:8 htb rate 125kbit ceil 300kbit quantum 1500 #Wojtek tc class add dev eth1 parent 1:2 classid 1:9 htb rate 125kbit ceil 1000kbit quantum 1500 #Ewelina tc class add dev eth1 parent 1:2 classid 1:10 htb rate 125kbit ceil 300kbit quantum 1500 #Przemek tc class add dev eth1 parent 1:2 classid 1:11 htb rate 125kbit ceil 1100kbit quantum 1500 #Etch tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip src 192.168.2.1 flowid 1:3 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.2 flowid 1:4 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.3 flowid 1:5 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.4 flowid 1:6 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.5 flowid 1:7 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.6 flowid 1:8 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.7 flowid 1:9 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.8 flowid 1:10 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.9 flowid 1:11 tc qdisc add dev eth1 parent 1:3 handle 3:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:4 handle 4:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:5 handle 5:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:6 handle 6:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:7 handle 7:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:8 handle 8:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:9 handle 9:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:10 handle 10:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:11 handle 11:0 sfq perturb 10 ########## UPLOAD #tc qdisc del root dev ppp0 tc qdisc add dev ppp0 root handle 1:0 htb default 4 # przydział pasma Upload tc class add dev ppp0 parent 1:0 classid 1:1 htb rate 260kbit ceil 260kbit # podział całego pasma: www, ftp, inne tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 50kbit ceil 112kbit quantum 1500 prio 1 #www tc class add dev ppp0 parent 1:1 classid 1:3 htb rate 30kbit ceil 112kbit quantum 1500 prio 2 #ftp tc class add dev ppp0 parent 1:1 classid 1:4 htb rate 20kbit ceil 50kbit quantum 1500 prio 3 #reszta tc class add dev ppp0 parent 1:1 classid 1:5 htb rate 30kbit ceil 50kbit quantum 1500 prio 1 #dns # filtry: www i ftp tc filter add dev ppp0 protocol ip parent 1:0 u32 match ip sport 80 0xffff flowid 1:2 tc filter add dev ppp0 protocol ip parent 1:0 u32 match ip sport 20 0xffff flowid 1:3 tc filter add dev ppp0 protocol ip parent 1:0 u32 match ip sport 53 0xffff flowid 1:5 # wszystkim po równo tc qdisc add dev ppp0 parent 1:2 handle 2:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:3 handle 3:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:4 handle 4:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:5 handle 5:0 sfq perturb 10 iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o ppp0 -j MYSHAPER-OUT exit fi if [ "$1" == "status" ] then echo "eth1: " tc -s qdisc show dev eth1 echo "ppp0: " tc -s qdisc show dev ppp0 exit fi echo "$0 start|stop|status" ## KONIEC
Skrypt sprawdza sie dobrze, trzyma sztywno download i upload jednak chciałbym, aby mógł przydzielać każdemu z użytkowników inny transfer UPLOAD.
W jaki sposób przerobić ten skrypt?
Offline
tc qdisc add dev $wan root handle 1:0 htb default 1 tc class add dev $wan parent 1:0 classid 1:1 htb rate $max_up ceil $max_up #quantum 15 tc class add dev $wan parent 1:1 classid 1:9 htb rate $sp_up ceil $max_up #quantum 15 tc class add dev $wan parent 1:1 classid 1:3 htb rate $sp_up ceil $max_up #quantum 16 tc class add dev $wan parent 1:1 classid 1:4 htb rate $sp_up ceil $max_up #quantum 16 tc class add dev $wan parent 1:1 classid 1:5 htb rate $sp_up ceil $max_up #quantum 16 tc class add dev $wan parent 1:1 classid 1:6 htb rate $sp_up ceil $max_up #quantum 16 tc class add dev $wan parent 1:1 classid 1:7 htb rate $sp_up ceil $max_up tc qdisc add dev $wan parent 1:3 handle 3:0 sfq perturb 10 tc qdisc add dev $wan parent 1:4 handle 4:0 sfq perturb 10 tc qdisc add dev $wan parent 1:5 handle 5:0 sfq perturb 10 tc qdisc add dev $wan parent 1:6 handle 6:0 sfq perturb 10 tc qdisc add dev $wan parent 1:7 handle 7:0 sfq perturb 10 tc qdisc add dev $wan parent 1:9 handle 9:0 sfq perturb 10 tc filter add dev $wan protocol ip preference 1 parent 1:0 handle 1 fw flowid 1:9 tc filter add dev $wan protocol ip preference 1 parent 1:0 handle 21 fw flowid 1:3 tc filter add dev $wan protocol ip preference 1 parent 1:0 handle 22 fw flowid 1:4 tc filter add dev $wan protocol ip preference 1 parent 1:0 handle 23 fw flowid 1:5 tc filter add dev $wan protocol ip preference 1 parent 1:0 handle 24 fw flowid 1:6 tc filter add dev $wan protocol ip preference 1 parent 1:0 handle 25 fw flowid 1:7 iptables -t mangle -A OUTPUT -o $wan -j MARK --set-mark 1 iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o $wan -j MYSHAPER-OUT iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.2 -j MARK --set-mark 21 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.3 -j MARK --set-mark 22 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.4 -j MARK --set-mark 23 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.5 -j MARK --set-mark 24 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.1.6 -j MARK --set-mark 25 iptables -t mangle -A MYSHAPER-OUT -p udp -s 192.168.1.2 -j MARK --set-mark 21 iptables -t mangle -A MYSHAPER-OUT -p udp -s 192.168.1.3 -j MARK --set-mark 22 iptables -t mangle -A MYSHAPER-OUT -p udp -s 192.168.1.4 -j MARK --set-mark 23 iptables -t mangle -A MYSHAPER-OUT -p udp -s 192.168.1.5 -j MARK --set-mark 24 iptables -t mangle -A MYSHAPER-OUT -p udp -s 192.168.1.6 -j MARK --set-mark 25 exit
Offline
Poprzedni skrypt htb miałem napisany podobnie, tez markowałem pakiety, ale nie trzymał mi on Uploadu, gdy ktoś używał P2P w sieci.
Natomiast skrypt, który pokazałem w poprzednim poście, trzyma mi dobrze w ryzach P2P i cały ruch, ale chciałbym zrobić skrypt tak, żeby każdemu móc dowolnie regulować transfer za pomocą filtrów (www, ftp, ssh itp.)
Wiem, że są różne poglądy na temat filtrowania i część z was jest zdania, że lepiej filtrować protokoły TCP/UDP, a część uważa ze lepiej segregować ruch na portach.
W moim przypadku na razie lepiej wychodzi filtrowanie na portach.
Offline
też kiedyś miałem podobnie i nie trzymal ale to jest poprawione , nie od końca cie rozumiem. chcesz podzial do ip czy po usługach czy jedno i drugie? tzn po ip ale tez po usugach aby uzytkownikom prioretyzowac ruch.
Offline
Dokładnie ... podział na IP oraz przypisanie indywidualnie każdemu innego transferu wraz z filtracją na portach w zależności od potrzeb indywidualnych każdego użytkownika.
Ostatnio edytowany przez yakubek (2008-04-01 21:33:44)
Offline
to ja proponuje karzedeu klase (podzial po ip) i w niej podklasy na rozne porty z róznym prio.
Offline
tc class add dev $wan parent 1:1 classid 1:3 htb rate predkosc ceil predkosc tc class add dev $wan parent 1:3 classid 1:9 htb rate predkosc2 ceil predkosc2 tc class add dev $wan parent 1:3classid 1:99 htb rate predkosc3 predkosc3 tc class add dev $wan parent 1:3 classid 1:88 htb rate predkosc4 ceil predkosc4
ale predkosc 2+predkosc3+prwdkosc4<=predkosc
Offline
Powiedzmy, że mam taki skrypt
########## UPLOAD tc qdisc add dev ppp0 root handle 1:0 htb tc class add dev ppp0 parent 1:0 classid 1:1 htb rate 260kbit ceil 260kbit quantum 16 tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 24kbit ceil 240kbit quantum 4 #bramka tc class add dev ppp0 parent 1:1 classid 1:3 htb rate 24kbit ceil 100kbit quantum 4 #Yakub tc class add dev ppp0 parent 1:1 classid 1:4 htb rate 24kbit ceil 30kbit quantum 4 #Michal tc class add dev ppp0 parent 1:1 classid 1:5 htb rate 24kbit ceil 30kbit quantum 4 #Marek tc class add dev ppp0 parent 1:1 classid 1:6 htb rate 24kbit ceil 30kbit quantum 4 #Mazur tc class add dev ppp0 parent 1:1 classid 1:7 htb rate 24kbit ceil 30kbit quantum 4 #Wojtek tc class add dev ppp0 parent 1:1 classid 1:8 htb rate 24kbit ceil 30kbit quantum 4 #Ewelina tc class add dev ppp0 parent 1:1 classid 1:9 htb rate 24kbit ceil 30kbit quantum 4 #Przemek tc class add dev ppp0 parent 1:1 classid 1:10 htb rate 24kbit ceil 30kbit quantum 4 #Etch ####################### tc qdisc add dev ppp0 parent 1:2 handle 2:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:3 handle 3:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:4 handle 4:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:5 handle 5:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:6 handle 6:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:7 handle 7:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:8 handle 8:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:9 handle 9:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:10 handle 10:0 sfq perturb 10 ######################### tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 20 fw flowid 1:2 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 21 fw flowid 1:3 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 22 fw flowid 1:4 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 23 fw flowid 1:5 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 24 fw flowid 1:6 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 25 fw flowid 1:7 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 26 fw flowid 1:8 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 27 fw flowid 1:9 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 28 fw flowid 1:10 ############################ iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o ppp0 -j MYSHAPER-OUT iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.2 -j MARK --set-mark 21 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 -j MARK --set-mark 22 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.4 -j MARK --set-mark 23 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.5 -j MARK --set-mark 24 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.6 -j MARK --set-mark 25 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.7 -j MARK --set-mark 26 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.8 -j MARK --set-mark 27 iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.9 -j MARK --set-mark 28 iptables -t mangle -A MYSHAPER-OUT -m mark --mark 0 -j MARK --set-mark 20
I gdzie mam wstawić jeszcze filtrowanie po portach i odpowiednie dla nich prędkości ????
Kombinuję na różne sposoby, ale nie potrafię tego posklejać w jedna całość.
Offline
tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 24kbit ceil 240kbit quantum tc class add dev ppp0 parent 1:2 classid 1:20 htb rate 4kbit ceil 240kbit quantum tc class add dev ppp0 parent 1:2 classid 1:21 htb rate 20kbit ceil 240kbit quantum ..... tc qdisc add dev ppp0 parent 1:2 handle 2:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:20 handle 20:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:21 handle 21:0 sfq perturb 10 .... tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 21 fw flowid 1:2 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 200 fw flowid 1:20 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 201 fw flowid 1:21 .... zamarkuj np www markiem 200 zamarkuj cos innego markie 201 a cala reszta pujdzie tum: iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.2 -j MARK --set-mark 21
Ostatnio edytowany przez tomii (2008-04-02 23:07:08)
Offline
Czy o coś takiego chodzi:
########## UPLOAD #tc qdisc del root dev ppp0 tc qdisc add dev ppp0 root handle 1:0 htb default 21 tc class add dev ppp0 parent 1:0 classid 1:1 htb rate 260kbit ceil 260kbit #glowna kolejka ######################### tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 24kbit ceil 240kbit quantum tc class add dev ppp0 parent 1:2 classid 1:20 htb rate 4kbit ceil 240kbit quantum tc class add dev ppp0 parent 1:2 classid 1:21 htb rate 20kbit ceil 240kbit quantum ..... tc qdisc add dev ppp0 parent 1:2 handle 2:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:20 handle 20:0 sfq perturb 10 tc qdisc add dev ppp0 parent 1:21 handle 21:0 sfq perturb 10 .... tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 21 fw flowid 1:2 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 200 fw flowid 1:20 tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 201 fw flowid 1:21 .... #zamarkuj np www markiem 200 #zamarkuj cos innego markie 201 # filtry: www i ftp iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 80 -j MARK --set-mark 200 # www iptables -t mangle -A MYSHAPER-OUT -p tcp --sport 20 -j MARK --set-mark 201 # ftp #a cala reszta pujdzie tum: iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.2 -j MARK --set-mark 21
Prędkości rate i ceil nie ustawiałem więc nie zwracaj na to uwagi, chodzi mi tylko czy sposób mzrkowania www i ftp jest poprawny?
Offline
nie do konca bo markujesz ruch www iftp od wszystkich a nie od jedneego ip.
Offline
Nie mogę znaleźć w necie takiej informacji jak napisać taki filtr, który by markował mi usługę (np. www, ftp) dla danego IP użytkownika.
Chyba znalazłem jednak to
iptables -t mangle -A PREROUTING -p tcp -s 193.151.68.0/80 -j MARK --set-mark 200
Jeśli się mylę to proszę mnie poprawić
Ostatnio edytowany przez yakubek (2008-04-03 19:22:56)
Offline
a tak nie dziala?
iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.2 --sport 80 -j MARK --set-mark 21
Offline
Ten wspis:
#### UPLOAD tc qdisc add dev ppp0 root handle 1:0 htb # default 21 tc class add dev ppp0 parent 1:0 classid 1:1 htb rate 260kbit ceil 260kbit #glowna kolejka #### PODZIAL KOLEJKI NA KILKA PREDKOSCI tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 20kbit ceil 30kbit quantum # RESZTA Y tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 20kbit ceil 30kbit quantum # WWW Y tc class add dev ppp0 parent 1:1 classid 1:21 htb rate 20kbit ceil 300kbit quantum # FTP Y ### tc class add dev ppp0 parent 1:1 classid 1:22 htb rate 20kbit ceil 30kbit quantum # RESZTA M tc class add dev ppp0 parent 1:1 classid 1:202 htb rate 20kbit ceil 30kbit quantum # WWW M tc class add dev ppp0 parent 1:1 classid 1:212 htb rate 20kbit ceil 300kbit quantum # FTP M #### tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 21 fw flowid 1:2 #Y tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 200 fw flowid 1:20 #Y tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 201 fw flowid 1:21 #Y tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 31 fw flowid 1:22 #M tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 300 fw flowid 1:202 #M tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 301 fw flowid 1:212 #M ### tc qdisc add dev ppp0 parent 1:2 handle 22:0 sfq perturb 10 #Y tc qdisc add dev ppp0 parent 1:20 handle 202:0 sfq perturb 10 #Y tc qdisc add dev ppp0 parent 1:21 handle 212:0 sfq perturb 10 #Y tc qdisc add dev ppp0 parent 1:22 handle 2:0 sfq perturb 10 #M tc qdisc add dev ppp0 parent 1:202 handle 20:0 sfq perturb 10 #M tc qdisc add dev ppp0 parent 1:212 handle 21:0 sfq perturb 10 #M #### #zamarkuj np www markiem 200 #zamarkuj cos innego markie 201 # filtry: www i ftp iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.2 --sport 80 -j MARK --set-mark 200 # mark www dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.2 --sport 20 -j MARK --set-mark 201 # mark ftp dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.2 -j MARK --set-mark 21 # reszta ruchu Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 --sport 80 -j MARK --set-mark 300 # mark www dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 --sport 20 -j MARK --set-mark 301 # mark ftp dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 -j MARK --set-mark 31 # reszta ruchu Y
Wywala taki błąd
serwer:~# /etc/init.d/htb start Uruchamiamy shapera Command line is not complete. Try option "help" Command line is not complete. Try option "help" Command line is not complete. Try option "help" Command line is not complete. Try option "help" Command line is not complete. Try option "help" Command line is not complete. Try option "help" RTNETLINK answers: Invalid argument RTNETLINK answers: Invalid argument RTNETLINK answers: Invalid argument RTNETLINK answers: Invalid argument RTNETLINK answers: Invalid argument RTNETLINK answers: Invalid argument iptables: No chain/target/match by that name iptables: No chain/target/match by that name iptables: No chain/target/match by that name iptables: No chain/target/match by that name
Offline
pierwsze 6 spowodowales tym ze napisales quantym a nie napisales ile ono wynosi
ostatnie 4 nie wiem dlaczego wywala a te srodku nie wiem które linie powoduja, prosze sprawdz i podaj ktora linijka co wywala.
a tak z ciekawosci gdzie masz napisane cos o w stylu:
iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o ppp0 -j MYSHAPER-OUT
Ostatnio edytowany przez tomii (2008-04-05 09:26:48)
Offline
Błedy brały sie z tego, że był dwa razy zrobiomy wpis :
iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o ppp0 -j MYSHAPER-OUT
Mam teraz taki kod htb (oczywiście nie mam regół dla wszystkich jeszcze) ale przycina upload, nie wiem czy mam prawidłową kolejność poszczególnych klas i filtrów.
Dzieki za pomoc Tommi, jeśli możesz to zerknij jeszcze na skrypt i powiedz co mam poprawić zanim zabiorę się za ostateczne dopracowanie całości. Jak juz napiszę całość i sprawdzę na ludkach to wkleję go w całości z pewnością się przyda innym.
#!/bin/sh # shaper.sh -- prosty i łatwy skrypt do zarz±dzania pasmem if [ "$1" == "stop" ] then echo "Zatrzymujemy shapera" tc qdisc del root dev eth1 2>/dev/null tc qdisc del root dev ppp0 2>/dev/null iptables -t mangle -D POSTROUTING -o ppp0 -j MYSHAPER-OUT 2>/dev/null iptables -t mangle -F MYSHAPER-OUT 2>/dev/null iptables -t mangle -X MYSHAPER-OUT 2>/dev/null exit fi if [ "$1" == "start" ] then # To co było wcze¶niej -- do pieca! :) echo "Uruchamiamy shapera" tc qdisc del root dev eth1 2>/dev/null tc qdisc del root dev ppp0 2>/dev/null iptables -t mangle -D POSTROUTING -o ppp0 -j MYSHAPER-OUT 2>/dev/null iptables -t mangle -F MYSHAPER-OUT 2>/dev/null iptables -t mangle -X MYSHAPER-OUT 2>/dev/null ########## DOWNLOAD tc qdisc add dev eth1 root handle 1:0 htb ######### DOWNLOAD ######### Teraz przydział pasma na kolejkę tc class add dev eth1 parent 1:0 classid 1:1 htb rate 99000kbit ceil 99000kbit quantum 1500 tc class add dev eth1 parent 1:1 classid 1:2 htb rate 1000kbit ceil 1100kbit quantum 1500 tc class add dev eth1 parent 1:1 classid 1:3 htb rate 98000kbit ceil 98000kbit quantum 1500 tc class add dev eth1 parent 1:2 classid 1:4 htb rate 125kbit ceil 1100kbit quantum 1500 #Yakub tc class add dev eth1 parent 1:2 classid 1:5 htb rate 125kbit ceil 300kbit quantum 1500 #Michal tc class add dev eth1 parent 1:2 classid 1:6 htb rate 125kbit ceil 300kbit quantum 1500 #Marek tc class add dev eth1 parent 1:2 classid 1:7 htb rate 125kbit ceil 300kbit quantum 1500 #Mazur tc class add dev eth1 parent 1:2 classid 1:8 htb rate 125kbit ceil 300kbit quantum 1500 #Wojtek tc class add dev eth1 parent 1:2 classid 1:9 htb rate 125kbit ceil 300kbit quantum 1500 #Ewelina tc class add dev eth1 parent 1:2 classid 1:10 htb rate 125kbit ceil 300kbit quantum 1500 #Przemek tc class add dev eth1 parent 1:2 classid 1:11 htb rate 125kbit ceil 1100kbit quantum 1500 #Etch tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip src 192.168.2.1 flowid 1:3 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.2 flowid 1:4 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.3 flowid 1:5 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.4 flowid 1:6 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.5 flowid 1:7 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.6 flowid 1:8 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.7 flowid 1:9 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.8 flowid 1:10 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.9 flowid 1:11 tc qdisc add dev eth1 parent 1:3 handle 3:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:4 handle 4:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:5 handle 5:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:6 handle 6:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:7 handle 7:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:8 handle 8:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:9 handle 9:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:10 handle 10:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:11 handle 11:0 sfq perturb 10 #### UPLOAD tc qdisc add dev ppp0 root handle 1:0 htb # default 21 tc class add dev ppp0 parent 1:0 classid 1:1 htb rate 260kbit ceil 260kbit #glowna kolejka #### PODZIAL KOLEJKI NA KILKA PREDKOSCI #### YAKUBEK tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA Y tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 20kbit ceil 30kbit quantum 1500 # WWW Y tc class add dev ppp0 parent 1:1 classid 1:21 htb rate 20kbit ceil 300kbit quantum 1500 # FTP Y ### MAREK tc class add dev ppp0 parent 1:1 classid 1:22 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA M tc class add dev ppp0 parent 1:1 classid 1:202 htb rate 20kbit ceil 30kbit quantum 1500 # WWW M tc class add dev ppp0 parent 1:1 classid 1:212 htb rate 20kbit ceil 300kbit quantum 1500 # FTP M #### YAKUBEK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 21 fw flowid 1:2 #Y tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 200 fw flowid 1:20 #Y tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 201 fw flowid 1:21 #Y #### MAREK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 31 fw flowid 1:22 #M tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 300 fw flowid 1:202 #M tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 301 fw flowid 1:212 #M ### tc qdisc add dev ppp0 parent 1:2 handle 22:0 sfq perturb 10 #Y tc qdisc add dev ppp0 parent 1:20 handle 202:0 sfq perturb 10 #Y tc qdisc add dev ppp0 parent 1:21 handle 212:0 sfq perturb 10 #Y tc qdisc add dev ppp0 parent 1:22 handle 2:0 sfq perturb 10 #M tc qdisc add dev ppp0 parent 1:202 handle 20:0 sfq perturb 10 #M tc qdisc add dev ppp0 parent 1:212 handle 21:0 sfq perturb 10 #M #### #zamarkuj np www markiem 200 #zamarkuj cos innego markie 201 # filtry: www i ftp iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o ppp0 -j MYSHAPER-OUT ### YAKUBEK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.9 --sport 80 -j MARK --set-mark 200 # mark www dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.9 --sport 20 -j MARK --set-mark 201 # mark ftp dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.9 -j MARK --set-mark 21 # reszta ruchu Y ### MAREK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 --sport 80 -j MARK --set-mark 300 # mark www dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 --sport 20 -j MARK --set-mark 301 # mark ftp dla Y iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 -j MARK --set-mark 31 # reszta ruchu Y exit fi if [ "$1" == "status" ] then echo "eth1: " tc -s qdisc show dev eth1 echo "ppp0: " tc -s qdisc show dev ppp0 exit fi echo "$0 start|stop|status" ## KONIEC
Ostatnio edytowany przez yakubek (2008-04-05 20:00:30)
Offline
tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA Y tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 20kbit ceil 30kbit quantum 1500 # WWW Y tc class add dev ppp0 parent 1:1 classid 1:21 htb rate 20kbit ceil 300kbit quantum 1500 # FTP Y ### MAREK tc class add dev ppp0 parent 1:1 classid 1:22 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA M tc class add dev ppp0 parent 1:1 classid 1:202 htb rate 20kbit ceil 30kbit quantum 1500 # WWW M tc class add dev ppp0 parent 1:1 classid 1:212 htb rate 20kbit ceil 300kbit quantum 1500 # FTP M
mial miec kazdy klase i podklasy prawda? a tu kazdy ma po 3 klasy.
Offline
prosty schemat :
klasa 1 klasa 11 rodzic klasa1 klasa 111 rodzic klasa 1 klasa 2 klasa 22 rodzic 2 klsas 222 rodzic 2 klsaa 3 klasa 33 rodzic 3 klasa 333 rodzic 3
moze to ci pomoze.
a pozniej zostaje przekierowanie pakietow do odpowiedniej klasy. i dodanie sfq.
Ostatnio edytowany przez tomii (2008-04-06 20:39:08)
Offline
OK zrozumiałem o co chodzi już, zastanawiam się tylko dlaczego nawet przeglądając strony www większość ruchu odbywa sie poza portem 80 (nie stosuję proxy) zmiana prędkości w htb dla portu 80 nic nie daje, natomiast zmieniając prędkość dla reszty portów spoza klasy mogę dowolnie ustalać transfery.
Znalazłem też coś takiego w necie i dodałem w htb:
iptables -t mangle -A MYSHAPER-OUT -m ipp2p --ipp2p -j MARK --set-mark 1000 # MARK DLA P2P
i podglądając co gdzie wpada zauważyłem, że część połączeń wpada do kolejki dla p2p (testowałem uzywając Utorrenta). Dodam też, że stosuję w firewallu opcję do ograniczania ilości połączeń dla p2p i reszty ruchu w sieci.
Offline
pokaż jak teraz wyglada twoj skrypt. i co to znaczy spoza klasy.
Ostatnio edytowany przez tomii (2008-04-06 23:01:14)
Offline
#!/bin/sh # shaper.sh -- prosty i łatwy skrypt do zarz±dzania pasmem if [ "$1" == "stop" ] then echo "Zatrzymujemy shapera" tc qdisc del root dev eth1 2>/dev/null tc qdisc del root dev ppp0 2>/dev/null iptables -t mangle -D POSTROUTING -o ppp0 -j MYSHAPER-OUT 2>/dev/null iptables -t mangle -F MYSHAPER-OUT 2>/dev/null iptables -t mangle -X MYSHAPER-OUT 2>/dev/null exit fi if [ "$1" == "start" ] then # To co było wcze¶niej -- do pieca! :) echo "Uruchamiamy shapera" tc qdisc del root dev eth1 2>/dev/null tc qdisc del root dev ppp0 2>/dev/null iptables -t mangle -D POSTROUTING -o ppp0 -j MYSHAPER-OUT 2>/dev/null iptables -t mangle -F MYSHAPER-OUT 2>/dev/null iptables -t mangle -X MYSHAPER-OUT 2>/dev/null ########## DOWNLOAD tc qdisc add dev eth1 root handle 1:0 htb ######### DOWNLOAD ######### Teraz przydział pasma na kolejkę tc class add dev eth1 parent 1:0 classid 1:1 htb rate 99000kbit ceil 99000kbit quantum 1500 tc class add dev eth1 parent 1:1 classid 1:2 htb rate 1000kbit ceil 1100kbit quantum 1500 tc class add dev eth1 parent 1:1 classid 1:3 htb rate 98000kbit ceil 98000kbit quantum 1500 tc class add dev eth1 parent 1:2 classid 1:4 htb rate 125kbit ceil 1100kbit quantum 1500 #Yakub tc class add dev eth1 parent 1:2 classid 1:5 htb rate 125kbit ceil 300kbit quantum 1500 #Michal tc class add dev eth1 parent 1:2 classid 1:6 htb rate 125kbit ceil 300kbit quantum 1500 #Marek tc class add dev eth1 parent 1:2 classid 1:7 htb rate 125kbit ceil 300kbit quantum 1500 #Mazur tc class add dev eth1 parent 1:2 classid 1:8 htb rate 125kbit ceil 300kbit quantum 1500 #Wojtek tc class add dev eth1 parent 1:2 classid 1:9 htb rate 125kbit ceil 300kbit quantum 1500 #Ewelina tc class add dev eth1 parent 1:2 classid 1:10 htb rate 125kbit ceil 300kbit quantum 1500 #Przemek tc class add dev eth1 parent 1:2 classid 1:11 htb rate 125kbit ceil 1100kbit quantum 1500 #Etch tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip src 192.168.2.1 flowid 1:3 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.2 flowid 1:4 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.3 flowid 1:5 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.4 flowid 1:6 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.5 flowid 1:7 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.6 flowid 1:8 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.7 flowid 1:9 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.8 flowid 1:10 tc filter add dev eth1 protocol ip preference 1 parent 1:0 u32 match ip dst 192.168.2.9 flowid 1:11 tc qdisc add dev eth1 parent 1:3 handle 3:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:4 handle 4:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:5 handle 5:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:6 handle 6:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:7 handle 7:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:8 handle 8:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:9 handle 9:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:10 handle 10:0 sfq perturb 10 tc qdisc add dev eth1 parent 1:11 handle 11:0 sfq perturb 10 ################################ UPLOAD ############################## tc qdisc add dev ppp0 root handle 1:0 htb # default 21 tc class add dev ppp0 parent 1:0 classid 1:1 htb rate 260kbit ceil 260kbit #glowna kolejka #### PODZIAL KOLEJKI NA KILKA PREDKOSCI #### IBM tc class add dev ppp0 parent 1:1 classid 1:2 htb rate 20kbit ceil 50kbit quantum 1500 # RESZTA IBM tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 20kbit ceil 30kbit quantum 1500 # WWW IBM ### MICHAL tc class add dev ppp0 parent 1:1 classid 1:22 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA MICHAL tc class add dev ppp0 parent 1:1 classid 1:202 htb rate 20kbit ceil 30kbit quantum 1500 # WWW MICHAL ### MAREK tc class add dev ppp0 parent 1:1 classid 1:3 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA MAREK tc class add dev ppp0 parent 1:1 classid 1:30 htb rate 20kbit ceil 30kbit quantum 1500 # WWW MAREK ### MAZUR tc class add dev ppp0 parent 1:1 classid 1:4 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA MAZUR tc class add dev ppp0 parent 1:1 classid 1:40 htb rate 20kbit ceil 30kbit quantum 1500 # WWW MAZUR ### WOJTEK tc class add dev ppp0 parent 1:1 classid 1:5 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA WOJTEK tc class add dev ppp0 parent 1:1 classid 1:50 htb rate 20kbit ceil 30kbit quantum 1500 # WWW WOJTEK ### EWELINA tc class add dev ppp0 parent 1:1 classid 1:6 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA EWELINA tc class add dev ppp0 parent 1:1 classid 1:60 htb rate 20kbit ceil 30kbit quantum 1500 # WWW EWELINA ### PRZEMEK tc class add dev ppp0 parent 1:1 classid 1:7 htb rate 20kbit ceil 30kbit quantum 1500 # RESZTA EWELINA tc class add dev ppp0 parent 1:1 classid 1:70 htb rate 20kbit ceil 30kbit quantum 1500 # WWW EWELINA ###P2P tc class add dev ppp0 parent 1:1 classid 1:90 htb rate 5kbit ceil 10kbit quantum 1500 # P2P ##################################################################### ### IBM tc qdisc add dev ppp0 parent 1:2 handle 2:0 sfq perturb 10 #IBM tc qdisc add dev ppp0 parent 1:20 handle 20:0 sfq perturb 10 #IBM ### MICHAL tc qdisc add dev ppp0 parent 1:22 handle 22:0 sfq perturb 10 #MICHAL tc qdisc add dev ppp0 parent 1:202 handle 202:0 sfq perturb 10 #MICHAL ### MAREK tc qdisc add dev ppp0 parent 1:3 handle 3:0 sfq perturb 10 #MAREK tc qdisc add dev ppp0 parent 1:30 handle 30:0 sfq perturb 10 #MAREK ### MAZUR tc qdisc add dev ppp0 parent 1:4 handle 4:0 sfq perturb 10 #MAZUR tc qdisc add dev ppp0 parent 1:40 handle 40:0 sfq perturb 10 #MAZUR ### WOJTEK tc qdisc add dev ppp0 parent 1:5 handle 5:0 sfq perturb 10 #WOJTEK tc qdisc add dev ppp0 parent 1:50 handle 50:0 sfq perturb 10 #WOJTEK ### EWELINA tc qdisc add dev ppp0 parent 1:6 handle 6:0 sfq perturb 10 #EWELINA tc qdisc add dev ppp0 parent 1:60 handle 60:0 sfq perturb 10 #EWELINA ### PRZEMEK tc qdisc add dev ppp0 parent 1:7 handle 7:0 sfq perturb 10 #PRZEMEK tc qdisc add dev ppp0 parent 1:70 handle 70:0 sfq perturb 10 #PRZEMEK ### P2P tc qdisc add dev ppp0 parent 1:90 handle 90:0 sfq perturb 10 #P2P ###################################################################### #### IBM tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 21 fw flowid 1:2 #IBM tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 200 fw flowid 1:20 #IBM #### MICHAL tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 31 fw flowid 1:22 #MICHAL tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 300 fw flowid 1:202 #MICHAL #### MAREK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 41 fw flowid 1:3 #MAREK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 400 fw flowid 1:30 #MAREK #### MAZUR tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 51 fw flowid 1:4 #MAZUR tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 500 fw flowid 1:40 #MAZUR #### WOJTEK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 61 fw flowid 1:5 #WOJTEK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 600 fw flowid 1:50 #WOJTEK #### EWELINA tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 71 fw flowid 1:6 #EWELINA tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 700 fw flowid 1:60 #EWELINA #### PRZEMEK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 81 fw flowid 1:7 #PRZEMEK tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 800 fw flowid 1:70 #PRZEMEK ###P2P tc filter add dev ppp0 protocol ip preference 1 parent 1:0 handle 1000 fw flowid 1:90 #P2P ################################# ZNAKOWANIE PAKIETOW ############### #zamarkuj np www markiem 200 #zamarkuj cos innego markie 201 # filtry: www i ftp iptables -t mangle -N MYSHAPER-OUT iptables -t mangle -I POSTROUTING -o ppp0 -j MYSHAPER-OUT ### Markowanie p2p iptables -t mangle -A MYSHAPER-OUT -m ipp2p --ipp2p -j MARK --set-mark 1000 # MARK DLA P2P ### YAKUBEK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.9 --sport 80 -j MARK --set-mark 200 # mark www IBM iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.9 -j MARK --set-mark 21 # reszta ruchu IBM ### MICHAL iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 --sport 80 -j MARK --set-mark 300 # mark www dla MICHAL iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.3 -j MARK --set-mark 31 # reszta ruchu MICHAL ### MAREK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.4 --sport 80 -j MARK --set-mark 400 # mark www dla MAREK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.4 -j MARK --set-mark 41 # reszta ruchu MAREK ### MAZUR iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.5 --sport 80 -j MARK --set-mark 500 # mark www dla MAZUR iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.5 -j MARK --set-mark 51 # reszta ruchu MAZUR ### WOJTEK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.6 --sport 80 -j MARK --set-mark 600 # mark www dla WOJTEK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.6 -j MARK --set-mark 61 # reszta ruchu WOJTEK ### EWELINA iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.7 --sport 80 -j MARK --set-mark 700 # mark www dla EWELINA iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.7 -j MARK --set-mark 71 # reszta ruchu EWELINA ### PRZEMEK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.8 --sport 80 -j MARK --set-mark 800 # mark www dla PRZEMEK iptables -t mangle -A MYSHAPER-OUT -p tcp -s 192.168.2.8 -j MARK --set-mark 81 # reszta ruchu PRZEMEK exit fi if [ "$1" == "status" ] then echo "eth1: " tc -s qdisc show dev eth1 echo "ppp0: " tc -s qdisc show dev ppp0 exit fi echo "$0 start|stop|status" ## KONIEC
Skrypt jest jeszcze nie zrobiony z podziałem na klasy i podklasy tak jak opisles w ostatnio (brak czasu).
co to znaczy spoza klasy
Chodziło mi o to, ze ruch generowany otwieraniem stron www nie trafia do kolejki dla portu 80 tylko do kolejki "reszta ruchu"
Wpis w htb do markowania p2p byl wpisany na test tylko, chcialem sprawdzic czy htb nie wywali bledow.
Ostatnio edytowany przez yakubek (2008-04-06 23:18:15)
Offline