Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#13710 closed defect (invalid)

Starting bandwidth shaping: RTNETLINK answers: File exists RTNETLINK answers: File exists We have an error talking to the kernel done

Reported by: MarkM Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: kernel Version: Attitude Adjustment 12.09 Beta
Keywords: openwrt bandwidth shaping traffic control iptables kernel Cc:

Description

Dear Devs, I have resorted to creating a ticket as I have attempted to search for a solution for the past few hours and have not found any.

I get the following error when attempted to start the attached script:
"Starting bandwidth shaping: RTNETLINK answers: File exists
RTNETLINK answers: File exists
We have an error talking to the kernel
done
"

#!/bin/sh
#

insmod cls_fw >/dev/null 2>&1
insmod cls_u32 >/dev/null 2>&1
insmod sch_htb >/dev/null 2>&1
insmod sch_sfq >/dev/null 2>&1
insmod sch_ingress >/dev/null 2>&1
insmod act_police >/dev/null 2>&1

DEV="br-lan"
CLIENT_MAC=00:25:11:00:8e:79
CLIENT_IP=10.0.0.33
LIMIT_DOWN=200
LIMIT_DOWN_BURST=400
LIMIT_UP=400

start() {

tc qdisc del dev "$DEV" root handle 77:
tc qdisc add dev "$DEV" root handle 77: htb
tc class add dev "$DEV" parent 77: classid 77:1 htb rate 20000kbit
tc class add dev "$DEV" parent 77:1 classid 77:10 htb rate ${LIMIT_DOWN}kbit ceil ${LIMIT_DOWN_BURST}kbit prio 2
tc qdisc add dev "$DEV" parent 77:10 handle 78: sfq perturb 10
tc qdisc add dev "$DEV" ingress
tc filter add dev "$DEV" parent 77: protocol ip prio 2 handle 80 fw flowid 77:10
tc filter add dev "$DEV" parent ffff: protocol ip prio 1 handle 79 fw police rate ${LIMIT_UP}kbit mtu 6k burst 6k drop
iptables -t mangle -I PREROUTING -m mac --mac-source $CLIENT_MAC -j MARK --set-mark 79
iptables -t mangle -I POSTROUTING -d $CLIENT_IP -j MARK --set-mark 80

}

stop() {

tc qdisc del dev $DEV root
iptables -F -t mangle

}

restart() {

    stop
    sleep 1
    start

}

show() {

    tc -s qdisc ls dev $DEV

}

case "$1" in

  start)

    echo -n "Starting bandwidth shaping: "
    start
    echo "done"
    ;;

  stop)

    echo -n "Stopping bandwidth shaping: "
    stop
    echo "done"
    ;;

  restart)

    echo -n "Restarting bandwidth shaping: "
    restart
    echo "done"
    ;;

  show)

    echo "Bandwidth shaping status for $IF:"
    show
    echo ""
    ;;

  *)

    pwd=$(pwd)
    echo "Usage: tc.bash {start|stop|restart|show}"
    ;;

esac

exit 0

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by jow

  • Resolution set to invalid
  • Status changed from new to closed

a) this is no support forum
b) this script is not part of anything maintained by us
c) these messages quoted are no error but merely indicate that a given rule already exists

comment:2 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.