[Linux] traffice shaping op 1 interface houden

Pagina: 1
Acties:

  • Keiichi
  • Registratie: Juni 2005
  • Laatst online: 21-02 15:21
Allereerst heb ik de volgende iptables staan om mijn pakjes te markeren die geshaped moeten worden:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Chain PREROUTING (policy ACCEPT 2984M packets, 1628G bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain INPUT (policy ACCEPT 2154M packets, 1091G bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain FORWARD (policy ACCEPT 830M packets, 537G bytes)
 pkts bytes target     prot opt in     out     source               destination
28658 2944K VLAN2OUT   all  --  eth0.2 ppp0    0.0.0.0/0            0.0.0.0/0
47073   64M VLAN2IN    all  --  ppp0   eth0.2  0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT 1937M packets, 1368G bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain POSTROUTING (policy ACCEPT 2767M packets, 1904G bytes)
 pkts bytes target     prot opt in     out     source               destination

Chain VLAN2IN (1 references)
 pkts bytes target     prot opt in     out     source               destination
32093   42M MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0           MARK set 0x14
39733   53M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0

Chain VLAN2OUT (1 references)
 pkts bytes target     prot opt in     out     source               destination
20559 2500K MARK       all  --  *      *       0.0.0.0/0            0.0.0.0/0           MARK set 0x15
28658 2944K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0


Voor de shaping heb ik hetvolgende script:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
tc qdisc del dev ppp0 root
tc qdisc add dev ppp0 root handle 1: htb

tc class add dev ppp0 parent 1: classid 1:1 htb rate 100mbit ceil 100mbit

tc class add dev ppp0 parent 1:1 classid 1:20 htb rate 1mbit ceil 1mbit
tc class add dev ppp0 parent 1:1 classid 1:21 htb rate 256kbit ceil 256kbit

tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 20 fw flowid 1:20
tc filter add dev ppp0 parent 1: prio 0 protocol ip handle 21 fw flowid 1:21

tc qdisc add dev ppp0 parent 1:20 handle 20: sfq perturb 10
tc qdisc add dev ppp0 parent 1:21 handle 21: sfq perturb 10


Dit werkt alleen voor de upload (256kbit). Alleen bij het toevoegen van een qdisc op het interne device kan ik de download shapen:

code:
1
2
3
4
5
6
7
8
tc qdisc del dev eth0.2 root
tc qdisc add dev eth0.2 root handle 1: htb
tc class add dev eth0.2 parent 1: classid 1:1 htb rate 100mbit ceil 100mbit
tc class add dev eth0.2 parent 1:1 classid 1:20 htb rate 1mbit ceil 1mbit
tc filter add dev eth0.2 parent 1: prio 0 protocol ip handle 20 fw flowid 1:20


tc qdisc add dev eth0.2 parent 1:20 handle 20: sfq perturb 10


Ok, het werkt nu wel, maar ik het nu niet voor elkaar krijgen om downloads van verschillende vlans (in dit geval) bij elkaar te kunnen shapen. Stel dat ik alle upload pakjes van alle eth0.x interfaces markeer met '21' wordt dit wel op 1 hoop gegooid, maar voor het downstream gedeelte werkt dit niet meer, hiervoor worden ze op aparte stapels gelegd en kan ik dit geheel niet meer als geheel afvlakken. Bepaalde packets voorgang geven word hiermee ook wat lastiger.

Hoe krijg ik het nu voor elkaar dat ik met een qdisc op ppp0 nu WEL de download geshaped kan krijgen?

Solar @ Dongen: http://solar.searchy.net/ - Penpal International: http://ppi.searchy.net/


  • Keiichi
  • Registratie: Juni 2005
  • Laatst online: 21-02 15:21
Kleine kick, vooralsnog is het me niet gelukt om alle shaping op dev ppp0 te laten verlopen.

Heeft iemand nog suggesties?

Solar @ Dongen: http://solar.searchy.net/ - Penpal International: http://ppi.searchy.net/