PPTPD Bandwidth Shaping

Neville nev at itsnev.co.uk
Wed Jun 10 01:00:42 CEST 2009

Hi all again,

Ok, I've got WISPr-Bandwidth-Max-Down in /var/run/radattr.ppp0 but the value is all wrong.

I set WISPr-Bandwidth-Max-Down = 512000 (as a reply)

and in /var/run/radattr.ppp0 its show as - WISPr-Bandwidth-Max-Down -1062731706

I just basically copied the dictionary.wispr to /usr/share/radiusclient-ng as in order to get it loaded in radattr.ppp0 :-

[root at xxx radiusclient-ng]# more dictionary.wispr
ATTRIBUTE       WISPr-Location-ID                       1       string
ATTRIBUTE       WISPr-Location-Name                     2       string
ATTRIBUTE       WISPr-Logoff-URL                        3       string
ATTRIBUTE       WISPr-Redirection-URL                   4       string
ATTRIBUTE       WISPr-Bandwidth-Min-Up                  5       integer
ATTRIBUTE       WISPr-Bandwidth-Min-Down                6       integer
ATTRIBUTE       WISPr-Bandwidth-Max-Up                  7       integer
ATTRIBUTE       WISPr-Bandwidth-Max-Down                8       integer
#ATTRIBUTE      WISPr-Session-Terminate-Time            9       string
#ATTRIBUTE      WISPr-Session-Terminate-End-Of-Day      10      string
ATTRIBUTE       WISPr-Billing-Class-Of-Service          11      string

Any ideas please.

  ----- Original Message ----- 
  From: Neville 
  To: freeradius-users at lists.freeradius.org 
  Sent: Tuesday, June 09, 2009 10:45 PM
  Subject: Re: PPTPD Bandwidth Shaping

  Hi Chuan,

  Thx for reply amongst this heated discussion on DHCP....

  I've currently got install freeRadius 2.1.6 and Poptop 2.4.4 and I see no dictionary file in /etc/ppp/radius/dictionary. In fact I have no radius directory in /etc/ppp

  All freeradius dictionary's are located in /usr/share/freeradius....

  The question is, how can I pass WISPr-Bandwidth-Max-Down to ip-up.local as I was hoping it would be in in /var/run/radattr.pppX, but all thats in there is:-

  Session-Timeout 1646690
  MS-CHAP2-Success 7S=A8CF4948283C1C4BE11682787ADBD0EA9852E691
  MS-MPPE-Recv-Key \220\265J\372\250\336\342nD\226o\272\007\030I\372'\313\267 at J\36
  MS-MPPE-Send-Key \235\342\367\325\243\210\020\217|H\314WkU0\201\352\374\364\023\

  However we can see WISPr-Bandwidth-Max-Down being sucessfully passed to FreeRadius?

  ++[exec] returns noop
  Sending Access-Accept of id 198 to port 53025
          Framed-IP-Address :=
          WISPr-Bandwidth-Max-Down := 512000
          Session-Timeout = 1646690
          MS-CHAP2-Success = 0x37533d41384346343934383238334331433442453131363832373837414442443045413938353245363931
          MS-MPPE-Recv-Key = 0x0b660d35b65015368d107e57d97e2b55
          MS-MPPE-Send-Key = 0xc78164fb4478212fbd0d198389ee2d52
          MS-MPPE-Encryption-Policy = 0x00000001
          MS-MPPE-Encryption-Types = 0x00000006
  Finished request 3.
  Going to the next request
  Waking up in 4.9 seconds.
  Cleaning up request 3 ID 198 with timestamp +244
  Ready to process requests.
  rad_recv: Accounting-Request packet from host port 38836, id=199, length=98
          Acct-Session-Id = "4A2EE3A302FB00"
          User-Name = "test99"
          Acct-Status-Type = Start
          Service-Type = Framed-User
          Framed-Protocol = PPP
          Acct-Authentic = RADIUS
          NAS-Port-Type = Async
          Framed-IP-Address =
          NAS-IP-Address =
          NAS-Port = 0
          Acct-Delay-Time = 0
  +- entering group preacct {...}
  ++[preprocess] returns ok

  I would love to use WISPr as suggested, but cannot find out how to get this to work.

  Currently I've just defaulted EVERYONE to the same bandwidth restrictions by using the follow script in /etc/ppp/ip-up.local


     /sbin/tc qdisc del dev $1 root    > /dev/null
     /sbin/tc qdisc del dev $1 ingress > /dev/null
  ##### speed server->client
    if [ "$UPSPEED" != "0" ] ;
      /sbin/tc qdisc add dev $1 root handle 1: htb default 20 r2q 1
      /sbin/tc class add dev $1 parent 1: classid 1:1 htb rate ${UPSPEED}kbit burst 4k
      /sbin/tc class add dev $1 parent 1:1 classid 1:10 htb rate ${UPSPEED}kbit burst 4k prio 1
      /sbin/tc class add dev $1 parent 1:1 classid 1:20 htb rate ${UPSPEED}kbit burst 4k prio 2
      /sbin/tc qdisc add dev $1 parent 1:10 handle 10: sfq perturb 10 quantum 1500
      /sbin/tc qdisc add dev $1 parent 1:20 handle 20: sfq perturb 10 quantum 1500
      /sbin/tc filter add dev $1 parent 1:0 protocol ip prio 10 u32 match ip tos 0x10 0xff flowid 1:10
      /sbin/tc filter add dev $1 parent 1:0 protocol ip prio 10 u32 match ip protocol 1 0xff flowid 1:10
      /sbin/tc filter add dev $1 parent 1: protocol ip prio 10 u32 match ip protocol 6 0xff match u8 0x05 0x0f at 0 match u160x0000 0xffc0 at 2 match u8 0x10 
  0xff at 33 flowid 1:10
  ##### speed client->server
    if [ "$DOWNSPEED" != "0" ] ;
      /sbin/tc qdisc add dev $1 handle ffff: ingress
      /sbin/tc filter add dev $1 parent ffff: protocol ip prio 50 u32 match ip src police rate ${DOWNSPEED}kbit burst 12k drop flowid :1
  /sbin/ifconfig $1 mtu 1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090610/3551109d/attachment.html>

More information about the Freeradius-Users mailing list