|
|
IMQ device: A virtual interface that can be used to shape traffic |
This patch will create virtual devices, imqx. You can't do much with them, except assign a qdisc. If you want to put packets in the devices, you have to patch iptables. After you did that, you can use -j IMQ to specify which packet enters the imq device. With the option --todev, you can specify the device (0 is default). All these iptables commands are processed after the other iptables commands.
iptables -t mangle -A PREROUTING -i ppp0 -j IMQ iptables -t mangle -A POSTROUTING -o ppp0 -j IMQ --todev 1 This works for ingress and for egress. For ingress, the rules are processed just after the mangle rules. So you can use iptables marks in the filter rules. This also means you can use egress qdiscs (CBQ/HTB,...) to control incoming traffic. For egress, the imq rules are matched after all other iptable rules. When a packet matches these iptables rules, it will also be checked by the other iptables rules. It's like marking a packet. The packet is marked to be put in the imq device after all iptables rules are used (and, of course, the packet has to pass the rules). Using an IMQ device to control incoming bandwidth seems handy, but it also introduces extra delays. The packet has to travel through an extra queue in the imq device before it can enter the box. When it leaves the box, it has to travel to a second queue, the one attached to the outgoing device. url : http://trash.net/~kaber/imq/ | |
| [Append to This Answer] |
| Next: |
|
| ||||||||