K
K
Kukunin2013-08-19 23:02:14
linux
Kukunin, 2013-08-19 23:02:14

How to set up a shaper?

Good afternoon. There is a router rt-n56u, custom firmware. I want to set up a shaper to prevent situations where a torrent clogs the entire incoming and outgoing channel. I read it and clarified a lot. But there are some points that I want to clarify. In the router, this is approximately the order of interfaces:
eth2
ra0 -> br0 -> eth3 -> ppp0
rai1
where eth2 is the Ethernet local network, ra0 and rai1 are two WiFi zones, 2.4Ghz and 5Ghz, respectively; eth3 is the WAN port and ppp0 is the ADSL connection.
I have a few questions:
1. I have successfully shaped eth2channel (incoming traffic for Ethernet network users), but I'm confused by the presence of two more WiFi channels that the shaper does not know about. Accordingly, it cannot make a correct allocation of the channel (HTB is able to borrow the channel if it is not busy). Why can't I shape br0 . Do you need to raise an ifb device, redirect all traffic from eth2, ra0 and rai1 there, and only then shape it?
2. To shape outgoing traffic, do you need to configure the shaper on ppp0, eth3 or create another ifb interface? I'm afraid that ppp0 and eth3 will already have NATted packets, i.e. the source IP will be the external IP from the ISP (iptraf shows this on the ppp0 interface), and I won't be able to classify the traffic by IP.
3. Maybe HTB is not a good option, and in general, you need to shape it differently? Tell me, this is my first experience in such cases.
4. iptraf shows traffic only on eth2 and ppp0 interfaces. eth3, br0, ra0 and rai1 - by zeros. Why?
It turns out that you need to create two IFB interfaces, one to shape three channels at once together - LAN and two WiFi, and the second to shape outgoing traffic to NAT. Have I understood everything correctly?
Thank you very much

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Evseev, 2013-08-20
@Kukunin

1) The traffic (egress) always outgoing from the interface is shaped.
2) The bottleneck in this case is ppp0, so you only need to shape it.
3) Outgoing Internet can be shaped directly on ppp0.
4) For incoming (ingress) on ppp0, you can do polysing, but on a slow channel it will mess up.
5) Shaping of the incoming through ppp0 can be done by wrapping it on ifb0.
6) NAT is performed last at the exit, first at the entrance, so there will be no problems with IP addresses.
7) HTB works fine, is ubiquitous, no need to change it to anything (CBQ, HSMC).
8) Instead of the default pfifo, it is strongly recommended to hang SFQ on HTB leaves.
9) If something is not clear - ask. Shaper in Linux is IMHO not the most trivial thing to master.
We search Google for "shaping ppp0 ifb0", we immediately find:
- ventrill.blogspot.ru/2011/02/qos-shapingsh.html
- forum.nag.ru/forum/index.php?showtopic=61755&view=findpost&p=733864
... and many more examples.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question