What's new

FlexQoS FlexQoS 1.0 - Flexible QoS Enhancement Script for Adaptive QoS

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Sorry Dave, luckily only a short outage (bandwidth is awful on lte, but better than no internet at all). Will run the command next time it happens (2 home office workers at the moment...).
 
Sorry Dave, luckily only a short outage (bandwidth is awful on lte, but better than no internet at all). Will run the command next time it happens (2 home office workers at the moment...).
I imagine your primary WAN QoS bandwidth settings would overwhelm the LTE backup? Not sure if there is a benefit to trying to make this work if it‘s usually a temporary situation. But send the data next time it happens anyway. :)
 
You imagine right Dave, that's why I implemented the following wan-event script:
Code:
case $1 in
        '0')
                case $2 in
                        'connected')
                                logger $(date) DSL verbunden
                                nvram set qos_ibw=92160
                                nvram set qos_obw=20480
                                service "restart_qos;restart_firewall"
                        ;;
                        'disconnected')
                                logger $(date) DSL getrennt
                        ;;
                esac
        ;;
        '1')
                case $2 in
                        'connected')
                                logger $(date) LTE-Backup verbunden
                                nvram set qos_ibw=10240
                                nvram set qos_obw=1024
                                service "restart_qos;restart_firewall"
                        ;;
                        'disconnected')
                                logger $(date) LTE-Backup getrennt
                        ;;
                esac
        ;;
esac

Sure it's not mandatory to have working qos on usb0 at the moment, but back in time there were days where lte was the main connection because the dsl line was faulty. Hopefully it doesn't happen again but who knows. But please don't focus on it, just thought maybe the errors could tell you somehing.

Best wishes,
chris
 
But please don't focus on it, just thought maybe the errors could tell you somehing.
Yes, the errors are because I only expect an “eth” interface name for tc, so I don’t even look for anything like usb0. So I will need to see what the situation looks like with usb0. You can run those commands now and post the results if they include any hint of usb0 in the output.
 
Yes, the errors are because I only expect an “eth” interface name for tc, so I don’t even look for anything like usb0.
Ok, so that's a valid explanation of course :D
So I will need to see what the situation looks like with usb0. You can run those commands now and post the results if they include any hint of usb0 in the output.
If I'm not completely wrong back in time this already worked because you were the one who told me the trick with setting nvram and restarting qos/firewall in wan-event to reinitialize the new bandwidth values. But nevertheless, here we go:

Code:
admin@router:/tmp/home/root# tc qdisc ls | grep root
qdisc htb 1: dev eth0 root refcnt 2 r2q 10 default 0 direct_packets_stat 521
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev br0 root refcnt 2 r2q 10 default 0 direct_packets_stat 32
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev tun21 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

admin@router:/tmp/home/root# cat /tmp/bwdpi/dev_wan
eth0
 
Ok, so that's a valid explanation of course :D

If I'm not completely wrong back in time this already worked because you were the one who told me the trick with setting nvram and restarting qos/firewall in wan-event to reinitialize the new bandwidth values. But nevertheless, here we go:

Code:
admin@router:/tmp/home/root# tc qdisc ls | grep root
qdisc htb 1: dev eth0 root refcnt 2 r2q 10 default 0 direct_packets_stat 521
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev br0 root refcnt 2 r2q 10 default 0 direct_packets_stat 32
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev tun21 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

admin@router:/tmp/home/root# cat /tmp/bwdpi/dev_wan
eth0
Add those 2 commands to the wan-start script after wan 1 is connected. It might be too soon after QoS restarts to get the results, but it might help catch it automatically. Log the output to a file.
 
Dave, I have some logging for you ;)

Code:
admin@router:/jffs# cat flexqos-failover-log-qdisc
qdisc pfifo_fast 0: dev eth0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

admin@router:/jffs# cat flexqos-failover-log-bwdpi
usb0
 
Last edited:
Dave, I have some logging for you ;)

Code:
admin@router:/jffs# cat flexqos-failover-log-qdisc
qdisc pfifo_fast 0: dev eth0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

admin@router:/jffs# cat flexqos-failover-log-bwdpi
usb0
I pushed a possible workaround to develop branch if you want to see if it helps next time.
 
Sure, thank you! Switching to dev right now. :) Should I implement any other logs for you in case a failover happens?
 
Sure, thank you! Switching to dev right now. :) Should I implement any other logs for you in case a failover happens?
No, but while you're running on primary, please post the output of the 2 commands again. I really want to make sure usb0 isn't in dev_wan when it's not primary.
 
Code:
admin@router:/tmp/home/root# tc qdisc ls | grep root
qdisc htb 1: dev eth0 root refcnt 2 r2q 10 default 0 direct_packets_stat 1202
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev br0 root refcnt 2 r2q 10 default 0 direct_packets_stat 27
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev tun21 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

admin@router:/tmp/home/root# cat /tmp/bwdpi/dev_wan
eth0
 
Code:
admin@router:/tmp/home/root# tc qdisc ls | grep root
qdisc htb 1: dev eth0 root refcnt 2 r2q 10 default 0 direct_packets_stat 1202
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev br0 root refcnt 2 r2q 10 default 0 direct_packets_stat 27
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev tun21 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1

admin@router:/tmp/home/root# cat /tmp/bwdpi/dev_wan
eth0
You can add this command to wan-start instead of the earlier ones:
Code:
cat /tmp/bwdpi/dev_wan
realtc qdisc ls | sed -n 's/qdisc htb.*dev \([^b][^r].*\) root.*/\1/p'
 
I'm getting this error on boot after upgrading to 1.0.4. It shows the below in the System Log"

Code:
May  5 01:06:07 FlexQoS: Applying AppDB rules and TC rates
May  5 01:06:07 FlexQoS: ERROR! Check /tmp/flexqos_tcrules.log

and when I pull /tmp/flexqos_tcrules.log it shows:

Code:
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:47
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:48
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:49
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:50
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:51
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:52
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:53
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:54

I'm not sure what's going wrong. Any ideas? Thank you!
 
I'm getting this error on boot after upgrading to 1.0.4. It shows the below in the System Log"

Code:
May  5 01:06:07 FlexQoS: Applying AppDB rules and TC rates
May  5 01:06:07 FlexQoS: ERROR! Check /tmp/flexqos_tcrules.log

and when I pull /tmp/flexqos_tcrules.log it shows:

Code:
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:47
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:48
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:49
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:50
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:51
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:52
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:53
RTNETLINK answers: No such file or directory
Command failed /tmp/flexqos_tcrules:54

I'm not sure what's going wrong. Any ideas? Thank you!
There has been a timing issue with FlexQoS on reboot and it usually starts too soon for Adaptive QoS to be initialized. I've just pushed a potential fix to the develop branch so that the FlexQoS startup process will wait until the necessary WAN interface is setup in Adaptive QoS.

I'm not willing to test it myself by rebooting my router since I'm on the verge of 60 days uptime (up 59 days, 9:17), but if you want to switch to the develop branch and try a reboot, it might resolve the startup issue. You can switch (temporarily) with flexqos develop

To switch back to stable, run flexqos stable
 
There has been a timing issue with FlexQoS on reboot and it usually starts too soon for Adaptive QoS to be initialized. I've just pushed a potential fix to the develop branch so that the FlexQoS startup process will wait until the necessary WAN interface is setup in Adaptive QoS.

I'm not willing to test it myself by rebooting my router since I'm on the verge of 60 days uptime (up 59 days, 9:17), but if you want to switch to the develop branch and try a reboot, it might resolve the startup issue. You can switch (temporarily) with flexqos develop

To switch back to stable, run flexqos stable

I try to avoid the the dev branch simply because I work from home and am connected to a virtual desktop 9 hours a day, so I'm a bit nervous about any hiccups in the dev branch. I did flexqos check after it fully booted and it said "No TC modifications necessary." If I were to stay on the stable branch (until the next version) does that mean A.QOS/FlexQOS is now working properly? Thank you very much!
 
I try to avoid the the dev branch simply because I work from home and am connected to a virtual desktop 8 hours a day, so I'm a bit nervous about any hiccups in the dev branch. I did flexqos check after it fully booted and it said "No TC modifications necessary." If I were to stay on the stable branch (until the next version) does that mean A.QOS/FlexQOS is now working properly? Thank you very much!
Yes, as long as the syslog shows that it eventually applies the appdb rules and custom rates correctly, there's no permanent problem. Just startup sequencing issues during a fresh reboot.

I feel your pain and concern. I wouldn't run develop on my router either, except some people expect me to test it before I publish it. ;) But as I mentioned, I'm going on almost 2 months of uptime, which means I need my router to be stable and available for my children and their Zoom classes, plus my inevitable work meetings.

Do like I do and wait for other volunteers to find the bugs. This one has been reported often enough that I will probably push it to stable branch fairly quickly once someone confirms it works better than the current version.
 
Hello - I just installed this.

FlexQoS v1.0.4 released 2020-10-18

Installing FlexQoS...
Checking firmware support...
Downloading WebUI files...
Adding FlexQoS entries to Merlin user scripts...
Adding nightly cron job...
Adding flexqos alias in profile.add...
FlexQoS installation complete!

FlexQoS v1.0.4 released 2020-10-18

Advanced configuration available via:
http://192.168.1.1/user1.asp

Would you like to restart QoS for modifications to take effect? [1=Yes 2=No]: 1

FlexQoS customizations will not take effect until QoS is restarted.


Notice at the end it said "Would you like to restart QoS for modifications to take effect?" and I entered "1" for "Yes" then still got a notice "FlexQoS customizations will not take effect until QoS is restarted." Does that mean it didn't restart?
 
Notice at the end it said "Would you like to restart QoS for modifications to take effect?" and I entered "1" for "Yes" then still got a notice "FlexQoS customizations will not take effect until QoS is restarted." Does that mean it didn't restart?
Correct, for one reason or another it didn't get the yes response, if maybe you accidentally added a space before or after the 1. Run flexqos restart to force the QoS restart.
 
You can add this command to wan-start instead of the earlier ones:
Code:
cat /tmp/bwdpi/dev_wan
realtc qdisc ls | sed -n 's/qdisc htb.*dev \([^b][^r].*\) root.*/\1/p'

Manually triggered a failover to get some logs for you while runnin on usb0:
Code:
admin@router:/jffs# tc qdisc ls | grep root
qdisc htb 1: dev eth0 root refcnt 2 r2q 10 default 0 direct_packets_stat 682
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev br0 root refcnt 2 r2q 10 default 0 direct_packets_stat 31
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev tun21 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
admin@router:/jffs# cat /tmp/bwdpi/dev_wan
usb0
admin@router:/jffs# realtc qdisc ls | sed -n 's/qdisc htb.*dev \([^b][^r].*\) root.*/\1/p'
eth0

No more errors in syslog:
Code:
Oct 21 06:25:19 nat: apply nat rules (/tmp/nat_rules_usb0_usb0)
Oct 21 06:25:19 custom_script: Running /jffs/scripts/nat-start
Oct 21 06:25:20 custom_script: Running /jffs/scripts/firewall-start (args: usb0)
Oct 21 06:25:21 custom_script: Running /jffs/scripts/service-event-end (args: restart wan_line)
Oct 21 06:25:25 FlexQoS: /jffs/addons/flexqos/flexqos.sh (pid=13813) called with 2 args: -start usb0
Oct 21 06:25:25 WAN(1)_Connection: Ethernet link down.
Oct 21 06:25:25 FlexQoS: [*] Killing Delayed Process (pid=12303)
Oct 21 06:25:25 FlexQoS: [*] 12303 admin     1572 S    sh /jffs/addons/flexqos/flexqos.sh -start usb0
Oct 21 06:25:27 FlexQoS: Applying iptables static rules
Oct 21 06:25:27 FlexQoS: Applying iptables custom rules
Oct 21 06:25:28 FlexQoS: Flushing conntrack table
Oct 21 06:25:30 FlexQoS: Applying AppDB rules and TC rates

On FlexQoS status page classification is done, speedtest states 10/1 as configured. Looking good so far in my opinion. :)
 
Manually triggered a failover to get some logs for you while runnin on usb0:
Code:
admin@router:/jffs# tc qdisc ls | grep root
qdisc htb 1: dev eth0 root refcnt 2 r2q 10 default 0 direct_packets_stat 682
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev br0 root refcnt 2 r2q 10 default 0 direct_packets_stat 31
qdisc pfifo_fast 0: dev wl0.1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev usb0 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev tun21 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
admin@router:/jffs# cat /tmp/bwdpi/dev_wan
usb0
admin@router:/jffs# realtc qdisc ls | sed -n 's/qdisc htb.*dev \([^b][^r].*\) root.*/\1/p'
eth0

No more errors in syslog:
Code:
Oct 21 06:25:19 nat: apply nat rules (/tmp/nat_rules_usb0_usb0)
Oct 21 06:25:19 custom_script: Running /jffs/scripts/nat-start
Oct 21 06:25:20 custom_script: Running /jffs/scripts/firewall-start (args: usb0)
Oct 21 06:25:21 custom_script: Running /jffs/scripts/service-event-end (args: restart wan_line)
Oct 21 06:25:25 FlexQoS: /jffs/addons/flexqos/flexqos.sh (pid=13813) called with 2 args: -start usb0
Oct 21 06:25:25 WAN(1)_Connection: Ethernet link down.
Oct 21 06:25:25 FlexQoS: [*] Killing Delayed Process (pid=12303)
Oct 21 06:25:25 FlexQoS: [*] 12303 admin     1572 S    sh /jffs/addons/flexqos/flexqos.sh -start usb0
Oct 21 06:25:27 FlexQoS: Applying iptables static rules
Oct 21 06:25:27 FlexQoS: Applying iptables custom rules
Oct 21 06:25:28 FlexQoS: Flushing conntrack table
Oct 21 06:25:30 FlexQoS: Applying AppDB rules and TC rates

On FlexQoS status page classification is done, speedtest states 10/1 as configured. Looking good so far in my opinion. :)
OK, this is interesting since I wasn’t expecting dev_wan to be different than the sed output. So it seems that Adaptive QoS doesn’t use the usb0 interface name with tc during a failover. I won’t trust dev_wan anymore as the primary source of the WAN interface name for tc. But I could potentially trust it for iptables setup if I don’t want to trigger a complete firewall restart. Will have to think about it some more.

Thanks for the feedback! Always helpful!
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top