From: gypsy <gypsy@iswest.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] tc is giving an error: RTNETLINK answers: File exists
Date: Fri, 15 Sep 2006 04:36:16 +0000 [thread overview]
Message-ID: <450A2DC0.4ABC84FC@iswest.com> (raw)
In-Reply-To: <1158272090.7705.25.camel@glyph.velotech.net>
fourcentsshy wrote:
>
> Hello,
>
> I'm using tc to limit the bandwidth of our wireless customers. I have a
> working script, but I'm not happy with it. I'm trying to write a more
> sophisticated script, but when I run it, it give me this error:
>
> RTNETLINK answers: File exists
>
> I have no idea what this error means or how to fix it.
It means pretty much what it says. There is already a record matching
closely enough that it is duplicated.
> Here is a portion
> of the script (the whole script shapes several interfaces):
>
> IDEV='eth5'
> TC='/sbin/tc'
> IPS='/etc/sysconfig/shaper/shape.ips'
> # high priority destination ports - I'll fill these in later (when this
> # thing works)
> HIGHPORT> # low priority destination ports
> LOWPORT>
> $TC qdisc add dev $IDEV root handle 1: cbq bandwidth 1600Kbit cell 8\
> avpkt 1000 mpu 64
> $TC class add dev $IDEV parent 1: classid 1:1 est 1sec 8sec cbq\
> bandwidth 1600Kbit rate 1500kbit allot 1514 maxburst 20 avpkt 1000\
> prio 0 bounded isolated
>
> cat $IPS | sed -e 's/#.*$//; s/^ *$//;' | while read IP RATE STATUS; do
> if [ "x$IP" = "x" ]; then
> continue
> fi
>
> # I use the last byte of the customer's IP's for the handle, which range
> # from 76 to 135 ATM.
>
> HANDLE="${IP##*.}"
>
> # I get the error from the next line. Because it fails to create the
> # qdisc all the rest fail too.
>
> $TC qdisc add dev $IDEV parent 1:1 handle 1:$HANDLE cbq\
> bandwidth 1600Kbit cell 8 avpkt 1000 mpu 64
>
> $TC class add dev $IDEV parent 1:$HANDLE classid $HANDLE:\
> est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
> maxburst 20 avpkt 1000 prio 1 bounded isolated
> $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:1\
> est 1sec 8sec cbq bandwidth 1600Kbit rate ${RATE}kbit allot 1514\
> maxburst 20 avpkt 1000 prio 2
> $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:2 est 1sec\
> 8sec cbq bandwidth 1600Kbit rate $[9*$RATE/10]kbit allot 1514\
> maxburst 20 avpkt 1000 prio 3
> $TC class add dev $IDEV parent $HANDLE: classid $HANDLE:3 est 1sec\
> 8sec cbq bandwidth 1600Kbit rate $[8*$RATE/10]kbit allot 1514\
> maxburst 20 avpkt 1000 prio 4
> $TC qdisc add dev $IDEV parent $HANDLE:1 sfq quantum 1514b\
> perturb 15
> $TC qdisc add dev $IDEV parent $HANDLE:2 sfq quantum 1514b\
> perturb 15
> $TC qdisc add dev $IDEV parent $HANDLE:3 sfq quantum 1514b\
> perturb 15
> $TC filter add dev $IDEV parent 1: protocol ip prio 16\
> u32 match ip src $IP flowid $HANDLE:
> $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 10\
> u32 match ip tos 0x10 0xff flowid $HANDLE:1
> $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 11\
> u32 match ip protocol 1 0xff flowid $HANDLE:1
> $TC filter add dev $IDEV parent $HANDLE: protocol ip prio 12\
> u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u16\
> 0x0000 0xffc0 at 2 flowid $HANDLE:1
>
> for a in $HIGHPORT; do
> $TC filter add dev $IDEV parent 1:0 protocol ip prio 14\
> u32 match ip dport $a 0xffff flowid $HANDLE:1
> done
> for a in $LOWPORT; do
> $TC filter add dev $IDEV parent 1:0 protocol ip prio 16\
> u32 match ip dport $a 0xffff flowid $HANDLE:3
> done
> $TC filter add dev $IDEV parent 1:0 protocol ip prio 15\
> u32 match ip dst 0.0.0.0/0 flowid $HANDLE:2
> done
>
> There are bound to other problems with this script, but until I can get
> past the current one, I'm dead in the water. TIA
You do not say which line or lines is causing the error so this is a
guess.
Run `tc -s filter show dev $IDEV' sending the output to a file because
there will be a lot of it. I think you will find a ton of "duplicate"
filters.
Set prio to the same value (16 or 10 perhaps) for each and every line in
your `$TC filter' lines.
--
gypsy
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
next prev parent reply other threads:[~2006-09-15 4:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-14 22:14 [LARTC] tc is giving an error: RTNETLINK answers: File exists fourcentsshy
2006-09-14 22:31 ` Leigh Sharpe
2006-09-14 23:11 ` fourcentsshy
2006-09-15 4:36 ` gypsy [this message]
2006-09-15 4:40 ` gypsy
2006-09-15 19:47 ` fourcentsshy
2006-09-16 16:14 ` gypsy
2006-09-18 20:33 ` fourcentsshy
2006-09-19 18:47 ` fourcentsshy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=450A2DC0.4ABC84FC@iswest.com \
--to=gypsy@iswest.com \
--cc=lartc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.