IMQ-devnames

IMQ-devnames is a modification of IMQ with ability to have devices with different numbers (original idea was to have fully customizable names, hence the name of project) so it becomes much easier to work with VLANs as they may use many noncontiguous tags. With IMQ-devnames you can have IMQs with any numbers from 0 to 100.

usage

Load the module...

# modprobe imq numdevs=5 devnames=11,12,1,24,25

Check the results...

# ip a li | grep imq
14: imq11: <NOARP,UP> mtu 1500 qdisc htb qlen 30
15: imq12: <NOARP,UP> mtu 1500 qdisc htb qlen 30
16: imq1: <NOARP,UP> mtu 1500 qdisc htb qlen 30
17: imq24: <NOARP,UP> mtu 1500 qdisc htb qlen 30
18: imq25: <NOARP,UP> mtu 1500 qdisc htb qlen 30

Redirect incoming traffic to proper IMQs...

iptables -t mangle -A PREROUTING -i eth1 -j IMQ --todev 1
iptables -t mangle -A PREROUTING -i eth0.11 -j IMQ --todev 11
iptables -t mangle -A PREROUTING -i eth0.12 -j IMQ --todev 12
iptables -t mangle -A PREROUTING -i eth0.24 -j IMQ --todev 24
iptables -t mangle -A PREROUTING -i eth0.25 -j IMQ --todev 25

At last you don't have to remember which VLAN is connected with which IMQ. Also your scripts will be happy to operate only on a single number refering both to VLAN and IMQ.

With no 'devnames' parameter you get traditional imq0...numdevs interfaces.

Patches below are to be applied to Linux kernel source. Patch for 2.4.31 was created on mostly-vanilla kernel. Patch for 2.6.17 was created on kernel sources from Fedora Core 4. For iptables use standard patch from IMQ website.

IMQ-devnames for 2.4 kernel is working in high load enviroment stable for more than one year. 2.6 patch is working for a few weeks and appears to be stable.

files

Patch for Linux-2.4.31 (for vanilla kernel)
Patch for Linux-2.6.17 (for Fedora 4 kernel)