Okay, this question is for you BSD people. I have a box setup here that is serving PPPoE, and when a user connects, /etc/ppp/ppp.linkup is ran. This file is setup to 1) cross reference a username to a customer bandwidth and 2) use those settings to traffic shape their connection.
The file is /etc/ppp/users.conf, formatted like so:
joesixpack 256 256
/etc/ppp/addclient.sh (ran by ppp.linkup):
usernum=`grep -n ""$user"" /etc/ppp/users.conf | cut -d":" -f1`
inkbps=`grep ""$user"" /etc/ppp/users.conf | cut -d" " -f2`
outkbps=`grep ""$user"" /etc/ppp/users.conf | cut -d" " -f3`
pipein=`echo "$usernum"*2 | bc`
pipeout=`expr $pipein + 1`
fwrulein=`expr $pipein + 1000`
fwruleout=`expr $fwrulein + 1`
$fwcmd pipe $pipein config bw ${inkbps}Kbit/s
$fwcmd pipe $pipeout config bw ${outkbps}Kbit/s
$fwcmd add $fwrulein pipe $pipein ip from any to $clientip
$fwcmd add $fwruleout pipe $pipeout ip from $clientip to any
This *DOES* add in the appropriate things to IPFW. A quick ipfw show gives me:
01002 5544 4920726 pipe 2 ip from any to 192.168.1.53
01003 4289 383102 pipe 3 ip from 192.168.1.53 to any
65535 0 0 deny ip from any to any
and ipfw pipe show gives me:
00002: 256.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
00003: 256.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
So, ipfw sure thinks that it's giving me 256kbps. Here in the lab though, my actual throughput is exactly 128kbps.
Any ideas?
randal
The file is /etc/ppp/users.conf, formatted like so:
joesixpack 256 256
/etc/ppp/addclient.sh (ran by ppp.linkup):
usernum=`grep -n ""$user"" /etc/ppp/users.conf | cut -d":" -f1`
inkbps=`grep ""$user"" /etc/ppp/users.conf | cut -d" " -f2`
outkbps=`grep ""$user"" /etc/ppp/users.conf | cut -d" " -f3`
pipein=`echo "$usernum"*2 | bc`
pipeout=`expr $pipein + 1`
fwrulein=`expr $pipein + 1000`
fwruleout=`expr $fwrulein + 1`
$fwcmd pipe $pipein config bw ${inkbps}Kbit/s
$fwcmd pipe $pipeout config bw ${outkbps}Kbit/s
$fwcmd add $fwrulein pipe $pipein ip from any to $clientip
$fwcmd add $fwruleout pipe $pipeout ip from $clientip to any
This *DOES* add in the appropriate things to IPFW. A quick ipfw show gives me:
01002 5544 4920726 pipe 2 ip from any to 192.168.1.53
01003 4289 383102 pipe 3 ip from 192.168.1.53 to any
65535 0 0 deny ip from any to any
and ipfw pipe show gives me:
00002: 256.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
00003: 256.000 Kbit/s 0 ms 50 sl. 1 queues (1 buckets) droptail
So, ipfw sure thinks that it's giving me 256kbps. Here in the lab though, my actual throughput is exactly 128kbps.
Any ideas?
randal