RE: tc is giving an error: RTNETLINK answers: File exists

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is usually because you are attempting to create a class ID or a Qdisc ID which already exists.
Check what value $HANDLE is on each iteration, perhaps using an echo on each pass to display it. I think you'll find it is trying to use the same value twice. 


Regards,
             Leigh
 
Leigh Sharpe
Network Systems Engineer
Pacific Wireless
Ph +61 3 9584 8966
Mob 0408 009 502
email lsharpe@xxxxxxxxxxxxxxxxxxxxxx
web www.pacificwireless.com.au

-----Original Message-----
From: fourcentsshy [mailto:fourcentsshy@xxxxxxxxxxxx] 
Sent: Friday, September 15, 2006 8:15 AM
To: lartc@xxxxxxxxxxxxxxx
Subject:  tc is giving an error: RTNETLINK answers: File exists

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. 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

William Murphy
Network Administrator
Velocity Technologies, Inc.


_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

_______________________________________________
LARTC mailing list
LARTC@xxxxxxxxxxxxxxx
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc


[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux