In vyatta add to : /etc/radiusclient-ng/dictionary
ATTRIBUTE PPPD-Upstream-Speed-Limit 230 integer ATTRIBUTE PPPD-Downstream-Speed-Limit 231 integer
In MikroBill server:
/usr/share/freeradius/dictionary
ATTRIBUTE PPPD-Upstream-Speed-Limit 230 integer ATTRIBUTE PPPD-Downstream-Speed-Limit 231 integer
In vyatta to file /etc/ppp/ip-pre-up.d/0006rename-pppoe-server add
export NEW_IFNAME DOWNSPEED=0 UPSPEED=0 AWK="/usr/bin/awk" logger $IFNAME if [ -f /var/run/radattr.$IFNAME ] then DOWNSPEED=`$AWK '/PPPD-Downstream-Speed-Limit/ {print $2}' /var/run/radattr.$IFNAME` UPSPEED=`$AWK '/PPPD-Upstream-Speed-Limit/ {print $2}' /var/run/radattr.$IFNAME` # Not logical / 1000 DOWNSPEED=$(($DOWNSPEED/1000)) UPSPEED=$(($UPSPEED/1000)) # Logical * 1.024 #DOWNSPEED=$(($DOWNSPEED*1.024)) #UPSPEED=$(($UPSPEED*1.024)) logger $DOWNSPEED logger $UPSPEED fi TC="/sbin/tc" IFNAME=$NEW_IFNAME logger $IFNAME $TC qdisc del dev $IFNAME root &>/dev/null $TC qdisc del dev $IFNAME ingress &>/dev/null if [ "$UPSPEED" != "0" ] ; then $TC qdisc add dev $IFNAME root tbf rate ${UPSPEED}bit burst 1540 limit 20kb fi if [ "$DOWNSPEED" != "0" ] ; then $TC qdisc add dev $IFNAME handle ffff: ingress $TC filter add dev $IFNAME parent ffff: protocol ip prio 1 u32 match u32 0 0 police rate ${DOWNSPEED}bit burst 96k drop flowid 1: fi
In MikroBill radius config set:
Custom radius attributes: YES
PPPD-Upstream-Speed-Limit = "{tx_rate_limit}" PPPD-Downstream-Speed-Limit = "{rx_rate_limit}"