
Данные передаются в :
/var/run/radattr.ppp1 :
MS-CHAP2-Success \324S=6A3D7B909E2B063800513832929F6254ADBACA34
MS-MPPE-Recv-Key \222\271\350\204F\011\260_\231\377:\311\213\027\340\007\240&9s~\035\364+.[\274\037v\302_e;\324
MS-MPPE-Send-Key \235xA\367q\274\333\015\262\336\327$\023\345\266\345\203F\207\012\335\334\305\344\2335\341\316]"\302\363\211\351
MS-MPPE-Encryption-Policy
MS-MPPE-Encryption-Types
Session-Timeout 2165313
Session-Octets-Limit 79691776
PPPD-Downstream-Speed-Limit 16
Acct-Interim-Interval 60
PPPD-Upstream-Speed-Limit 16
Octets-Direction Sum
Framed-IP-Address 192.168.1.2
Framed-IP-Netmask 255.255.255.0
Файла /etc/ppp/ip-up.local небыло, я его создал, назначил права запуска, тоесть вот:
-rwxr-xr-x 1 root root 1645 Сен 5 22:18 /etc/ppp/ip-up.local
Вот его содержимое:
if [ -f /var/run/radattr.$1 ]
then
DOWNSPEED=`/bin/awk '/PPPD-Downstream-Speed-Limit/ {print $2}' /var/run/radattr.$1`
UPSPEED=`/bin/awk '/PPPD-Upstream-Speed-Limit/ {print $2}' /var/run/radattr.$1`
FILTERS=`/bin/awk '/Filter-Id/ {print $2}' /var/run/radattr.$1`
#echo $DOWNSPEED
#echo $UPSPEED
#echo $FILTERS
/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
fi
Содержимое файла /etc/ppp/ip-up :
#!/bin/bash
# this is a script which is executed after connecting the ppp interface.
# look at man pppd for details
# the followings parameters are available:
# $1 = interface-name
# $2 = tty-device
# $3 = speed
# $4 = local-IP-address
# $5 = remote-IP-address
# $6 = ipparam
if [ "$USEPEERDNS" ]; then
if [ -x /sbin/resolvconf ]; then
conf="# Generated by ppp for $1\n"
[ -n "$DNS1" ] && conf="${conf}nameserver $DNS1\n"
[ -n "$DNS2" ] && conf="${conf}nameserver $DNS2\n"
echo -e "$conf" | resolvconf -a "$1"
else
# add the server supplied DNS entries to /etc/resolv.conf
# (taken from debian's 0000usepeerdns)
# follow any symlink to find the real file
REALRESOLVCONF=$(readlink --canonicalize /etc/resolv.conf)
if [ "$REALRESOLVCONF" != "/etc/ppp/resolv.conf" ]; then
# merge the new nameservers with the other options from the old configuration
{
grep --invert-match '^nameserver[[:space:]]' $REALRESOLVCONF
cat /etc/ppp/resolv.conf
} > $REALRESOLVCONF.tmp
# backup the old configuration and install the new one
cp -dpP $REALRESOLVCONF $REALRESOLVCONF.pppd-backup
mv $REALRESOLVCONF.tmp $REALRESOLVCONF
# correct permissions
chmod 0644 /etc/resolv.conf
chown root:root /etc/resolv.conf
fi
fi
fi
if [ -x /etc/init.d/net.$1 ]; then
if ! /etc/init.d/net.$1 --quiet status ; then
export IN_BACKGROUND="true"
/etc/init.d/net.$1 --quiet start
fi
fi
[ -f /etc/ppp/ip-up.local ] && . /etc/ppp/ip-up.local "$@"
Помогите пожалуйста разобраться с этой проблемой. Очень нужно это ограничение по скорости
