PPTPD Bandwidth Shaping

EasyHorpak.com info at easyhorpak.com
Wed Jun 10 11:11:53 CEST 2009


by default with my method on Ubuntu 8.10 Server

I create directory /etc/ppp/radius and copy radiusclient config to that

list of files 

dictionary
issue
port-id-map
radiusclient.conf
realms
servers

and config the file /etc/ppp/pptpd-options to point the radius config file.

plugin radius.so
plugin radattr.so
radius-config-file /etc/ppp/radius/radiusclient.conf


when connect you with get the radattr.ppp0

and you will see the 

WISPr-Bandwidth-Max-Up   ...               
WISPr-Bandwidth-Max-Down  ...


and you can cat the value of attribute and set to 

wondershaper by

wondershaper $1 $down $up


Cheer!!              





¢ÍáÊ´§¤ÇÒÁ¹Ñº¶×Í
Best Regards

ªÇ¹ ¨Ø´ÒºØµÃ
Chuan Chudabut
66-081-7499093, 66-02-691-6382
============================================================================================================
http://www.EasyZoneCorp.net - EasyZone Radius Billing 5.0, EasyZone PPPoE Billing 2.5, EasyZone Hotspot Billing 2.7, EasyZone VPN Billing 1.0, EasyZone File Server
  ----- Original Message ----- 
  From: Neville 
  To: freeradius-users at lists.freeradius.org 
  Sent: Wednesday, June 10, 2009 4:45 AM
  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:-


  Framed-IP-Address 192.168.0.70
  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
  1\370\266\212?_\377\262\324\215X\274\357
  MS-MPPE-Send-Key \235\342\367\325\243\210\020\217|H\314WkU0\201\352\374\364\023\
  220\220\315z\364\277\254\361\356["Ce\002
  MS-MPPE-Encryption-Policy 
  MS-MPPE-Encryption-Types 


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


  ++[exec] returns noop
  Sending Access-Accept of id 198 to 127.0.0.1 port 53025
          Framed-IP-Address := 192.168.0.70
          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 127.0.0.1 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 = 192.168.0.70
          NAS-IP-Address = 127.0.0.1
          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

  ip-up.local

  DOWNSPEED=256
  UPSPEED=768
     /sbin/tc qdisc del dev $1 root    > /dev/null
     /sbin/tc qdisc del dev $1 ingress > /dev/null
  ##### speed server->client
    if [ "$UPSPEED" != "0" ] ;
    then
      /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
    fi 
  ##### speed client->server
    if [ "$DOWNSPEED" != "0" ] ;
    then
      /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 0.0.0.0/0 police rate ${DOWNSPEED}kbit burst 12k drop flowid :1
    fi
  /sbin/ifconfig $1 mtu 1400



------------------------------------------------------------------------------


  -
  List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20090610/19abc011/attachment.html>


More information about the Freeradius-Users mailing list