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!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2009-04-13 22:41:11

  robertinog - Użytkownik

robertinog
Użytkownik
Zarejestrowany: 2008-07-20

htb + iptables

Witam chciałem zapytać szanownych kolegów czy mogliby zerknąć na te moje wypociny i ewentualnie wychwycić błędy. Problem z kolejkowaniem nie dzieli równo i skaczą transfery.

download

Kod:

#Gdzie eth0 karta po stronie lanu


tc qdisc del root dev eth0
tc qdisc add dev eth0 root handle 1:0 htb default 1 r2q 10

tc class add dev eth0 parent 1:0 classid 1:1 htb rate 99000kbit ceil 99000kbit quantum 7920

tc class add dev eth0 parent 1:1 classid 1:2 htb rate 1900kbit ceil 2000kbit quantum 152
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 98000kbit ceil 98000kbit quantum 7840



tc class add dev eth0 parent 1:2 classid 1:4 htb rate 500kbit ceil 1900kbit quantum 32 prio 2
tc class add dev eth0 parent 1:2 classid 1:5 htb rate 500kbit ceil 1900kbit quantum 32 prio 2
tc class add dev eth0 parent 1:2 classid 1:6 htb rate 500kbit ceil 1900kbit quantum 32 prio 2


#filtry

tc filter add dev eth0 protocol ip  parent 1:0 u32 match ip src 193.168.1.1 flowid 1:3
tc filter add dev eth0 protocol ip  parent 1:0 u32 match ip dst 193.168.1.5 flowid 1:4
tc filter add dev eth0 protocol ip  parent 1:0 u32 match ip dst 193.168.1.3 flowid 1:5
tc filter add dev eth0 protocol ip  parent 1:0 u32 match ip dst 193.168.1.4 flowid 1:6

 

tc qdisc add dev eth0 parent 1:3 handle 3:0 sfq perturb 10
tc qdisc add dev eth0 parent 1:4 handle 4:0 sfq perturb 10
tc qdisc add dev eth0 parent 1:5 handle 5:0 sfq perturb 10
tc qdisc add dev eth0 parent 1:6 handle 6:0 sfq perturb 10

upload

Kod:

#Gdzie eth1 karta po stronie WAN
tc qdisc del root dev eth1
tc qdisc add dev eth1 root handle 2:0 htb default 4

tc class add dev eth1 parent 2:0 classid 1:1 htb rate 384kbit ceil 384kbit quantum 31

tc class add dev eth1 parent 2:1 classid 2:2 htb rate 100kbit ceil 384kbit quantum 8
tc class add dev eth1 parent 2:1 classid 2:3 htb rate 80kbit ceil 384kbit quantum 6
tc class add dev eth1 parent 2:1 classid 2:4 htb rate 70kbit ceil 120kbit quantum 6

#filtry na porty

tc filter add dev eth1 protocol ip parent 2:0 u32 match ip sport 80 0xffff flowid 2:2
tc filter add dev eth1 protocol ip parent 2:0 u32 match ip sport 20 0xffff flowid 2:4
tc filter add dev eth1 protocol ip parent 2:0 u32 match ip sport 22 0xffff flowid 2:4

#reszta
tc qdisc add dev eth1 parent 2:2 handle 2:0 sfq perturb 10
tc qdisc add dev eth1 parent 2:3 handle 3:0 sfq perturb 10
tc qdisc add dev eth1 parent 2:4 handle 4:0 sfq perturb 10

Pozdrawiam i dziękuje z góry

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
To nie jest tylko forum, to nasza mała ojczyzna ;-)

[ Generated in 0.006 seconds, 9 queries executed ]

Informacje debugowania

Time (s) Query
0.00010 SET CHARSET latin2
0.00004 SET NAMES latin2
0.00101 SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='3.133.117.107' WHERE u.id=1
0.00081 REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '3.133.117.107', 1732460398)
0.00041 SELECT * FROM punbb_online WHERE logged<1732460098
0.00044 SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=13934 AND t.moved_to IS NULL
0.00005 SELECT search_for, replace_with FROM punbb_censoring
0.00101 SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=13934 ORDER BY p.id LIMIT 0,25
0.00082 UPDATE punbb_topics SET num_views=num_views+1 WHERE id=13934
Total query time: 0.00469 s