[RP-PPPoE] getting work ipv6 on pppoe

Blackhold blackholdmailer at gmail.com
Sun Nov 30 23:17:29 EST 2014


Finally I have taken it from /var/run/radattr.pppX file... I define
the router-client IP so then I'm able to search to database for its
IP...

#!/bin/bash

SERVER=`cat /etc/radiusclient/servers |awk '{print $1}' |tail -1`
SERVER_PASS=`cat /etc/radiusclient/servers |awk '{print $2}' |tail -1`

DEST4=`cat /var/run/radattr.${1} |grep Framed-IP-Address |awk '{print $2}'`

QUERY=`
mysql -u polaris-ppp -p********* -h $SERVER -Dradius << EOF
        select username from radreply where value='${DEST4}';
EOF`

#USERNAME=`tail -180 /var/log/pppoe.log  |awk '/name/ && /Response/ {
gsub("]","",$0); gsub("\"","",$0); print $8}' |tail -1`
USERNAME=`echo "$QUERY" |tail -1`

QUERY=`
mysql -u polaris-ppp -p****** -h $SERVER -Dradius << EOF
        select value from radcheck where username='$USERNAME';
EOF`

USER_PASS=`echo "$QUERY" |tail -1`


RADQUERY=$( radtest $USERNAME $USER_PASS ${SERVER}:1812 1 $SERVER_PASS )

IPv6=`echo "$RADQUERY" |grep Framed-IPv6-Prefix |awk '{print $3}'`

IP1=`grep $USERNAME /etc/capa8/* |grep IP1 |awk '{print $4}'`
IP2=`grep $USERNAME /etc/capa8/* |grep IP2 |awk '{print $4}'`

ip addr add ${IP1}/127 dev $1
ip route add $IPv6 via $IP2


More information about the RP-PPPoE mailing list