Hello,

I am using Xiaomi Mini with Pandorabox. I need to help with IPBandwidth . The problem is, that i can see/and set only LAN interface in ipbandwidth, and if i connect to guest (192.168.9.x) i don´t see that IP Address in the IPBandwidth and i can´t control bandwidth for that IP Adresses.

For example, there are my IP from interfaces:
LAN: Using 192.168.2.0/24
GUEST: Using 192.168.9.0/24

The IPBandwidth only works with LAN interface, i found that in /etc/init.d/bandiwdth there is set only LAN interface, please is there anyone who can help me, how can i set LAN and GUEST interface?
If i rewrite network_get_ipaddr ipaddr "lan" to network_get_ipaddr ipaddr "GUEST" i can see GUEST IP Clients, but the LAN clients are gone ofcourse.

Here is the file:

#!/bin/sh /etc/rc.common

START=90

. /lib/functions.sh
. /lib/functions/network.sh

cron_tmp="/tmp/tmp.cron"
network_find_wan wan_if
wan_phy_if=$(uci -P/var/state get network.${wan_if}.ifname)
interface=${wan_phy_if:-eth0.2}

load_modules()
{
    insmod cls_fw >&- 2>&-
    insmod sch_hfsc >&- 2>&-
    insmod sch_esfq >&- 2>&-
    insmod ifb >&- 2>&-
    insmod xt_multiport >&- 2>&-
    insmod cls_u32 >&- 2>&-
    #insmod showspeed >&- 2>&-
}

unload_modules()
{
    rmmod showspeed >&- 2>&-
    #rmmod cls_fw >&- 2>&-
    #rmmod sch_hfsc >&- 2>&-
    #rmmod sch_esfq >&- 2>&-
    #rmmod ifb >&- 2>&-
    #rmmod xt_multiport >&- 2>&-
    #rmmod cls_u32 >&- 2>&-    
}

crontabs_set()
{
    config_get type main type
    
    touch /etc/crontabs/root
    grep -v "/usr/bin/killall -USR1 bw" /etc/crontabs/root > $cron_tmp
    if [ "$1" = "start" ] ;then
        case "$type" in
            "monthly")
                config_get day main day
                config_get hour main hour
                echo 0 $hour $day \* \* /usr/bin/killall -USR1 bw >> $cron_tmp
                ;;
            "weekly")
                config_get week main week
                config_get hour main hour
                echo 0 $hour \* \* $week /usr/bin/killall -USR1 bw >> $cron_tmp
                ;;
            "daily")
                config_get hour main hour
                echo 0 $hour \* \* \* /usr/bin/killall -USR1 bw >> $cron_tmp
                ;;
            "hourly")
                echo 0 \*/1 \* \* \* /usr/bin/killall -USR1 bw >> $cron_tmp
                ;;
        esac
    fi
    
    mv $cron_tmp /etc/crontabs/root
    /etc/init.d/cron restart
    
}

stop()
{
    crontabs_set stop
    killall -USR2 bw >&- 2>&-
    iptables -t mangle -F bandwidth_forward >&- 2>&-
    iptables -t mangle -D FORWARD -j bandwidth_forward >&- 2>&-
    iptables -t mangle -X bandwidth_forward >&- 2>&-
    iptables -t mangle -F bandwidth_prerouting >&- 2>&-
    iptables -t mangle -D PREROUTING -j bandwidth_prerouting >&- 2>&-
    iptables -t mangle -X bandwidth_prerouting >&- 2>&-
    tc qdisc del dev $interface ingress >&- 2>&-
    tc qdisc del dev $interface root >&- 2>&-
    tc qdisc del dev ifb0 root >&- 2>&-
    #unload_modules
}

start()
{        
    config_load bandwidth
    config_get enabled main enabled
    netmask=`uci get network.lan.netmask`
    network_get_ipaddr ipaddr "lan"

    #stop
    unload_modules
    
    insmod showspeed >&- 2>&-
    
    if [ 1 -ne "$enabled" ]; then 
        bw -a $interface -m $netmask -g $ipaddr -o >/dev/null 2>/dev/null & 
    else
        load_modules
        crontabs_set start
        bw -a $interface -m $netmask -g $ipaddr >/dev/null 2>/dev/null & 
    fi
}

boot()
{
    #Do nothing here.Program is started by Hotplug.
    return 0
}

THANKS! smile