QOS on VPN Client Tunnel in Tomato

From this page, I was able to have QOS functioning on an OpenVPN tunnel in Tomato.

Essentially, I had to add the following snippet to the ADMIN->SCRIPTS->FIREWALL field (note the different device names used):

1
2
3
4
5
6
7
8
9
10
cp /etc/qos /tmp/qos-tun11
sed -i 's/vlan2/tun11/g' /tmp/qos-tun11
sed -i 's/imq0/imq1/g' /tmp/qos-tun11
chmod +x /tmp/qos-tun11
/tmp/qos-tun11
iptables -t mangle -A FORWARD -o tun11 -j QOSO
iptables -t mangle -A OUTPUT -o tun11 -j QOSO
iptables -t mangle -A PREROUTING -i tun11 -j CONNMARK --restore-mark --mask 0xff
iptables -t mangle -A PREROUTING -i tun11 -j IMQ --todev 1
ifconfig imq1 up