ABillS: Настройка PPPoE Ubuntu 16.04

FREERADIUS

Добавляем атрибуты /usr/local/freeradius/etc/raddb/dictionary

# Limit session traffic
ATTRIBUTE       Session-Octets-Limit            227     integer
# What to assume as limit - 0 in+out, 1 in, 2 out, 3 max(in,out)
ATTRIBUTE       Octets-Direction                228     integer
# Connection Speed Limit
ATTRIBUTE       PPPD-Upstream-Speed-Limit       230     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit     231     integer
ATTRIBUTE       PPPD-Upstream-Speed-Limit-1     232     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit-1   233     integer
ATTRIBUTE       PPPD-Upstream-Speed-Limit-2     234     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit-2   235     integer
ATTRIBUTE       PPPD-Upstream-Speed-Limit-3     236     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit-3   237     integer
ATTRIBUTE       Acct-Interim-Interval           85      integer
ATTRIBUTE       Acct-Input-Gigawords            52      integer
ATTRIBUTE       Acct-Output-Gigawords           53      integer

RADIUSCLIENT

apt-get install radiusclient1

/etc/radiusclient/servers

 127.0.0.1    radsecret

Для того, чтобы нужные атрибуты распознавались радиусом и радиус-клиентом, нужно добавить их в соответствующие словари /etc/radiusclient/dictionary

# Limit session traffic 
ATTRIBUTE       Session-Octets-Limit            227     integer
# What to assume as limit - 0 in+out, 1 in, 2 out, 3 max(in,out)
ATTRIBUTE       Octets-Direction                228     integer
# Connection Speed Limit
ATTRIBUTE       PPPD-Upstream-Speed-Limit       230     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit     231     integer
ATTRIBUTE       PPPD-Upstream-Speed-Limit-1     232     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit-1   233     integer
ATTRIBUTE       PPPD-Upstream-Speed-Limit-2     234     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit-2   235     integer
ATTRIBUTE       PPPD-Upstream-Speed-Limit-3     236     integer
ATTRIBUTE       PPPD-Downstream-Speed-Limit-3   237     integer
ATTRIBUTE       Acct-Interim-Interval            85     integer
ATTRIBUTE       Acct-Input-Gigawords             52     integer
ATTRIBUTE       Acct-Output-Gigawords            53     integer

PPPOE

apt-get install ppp-dev
apt-get install gcc binutils
cd /usr/src
wget http://www.roaringpenguin.com/files/download/rp-pppoe-3.10.tar.gz
tar xvzf rp-pppoe-3.10.tar.gz
cd rp-pppoe-3.10/src/
./configure --enable-plugin=/usr/lib/pppd/2.4.5/rp-pppoe.so
make
make install

Проверяем

pppoe-server -I eth0 -L 192.168.170.2 -N 255 -k

Если не ругнулся значит всё правильно Убиваем процес

killall pppoe-server

Редактируем опции

/etc/ppp/pppoe-server-options

# PPP options for the PPPoE server
# LIC: GPL
require-chap
require-mschap-v2
proxyarp
nologfd
#passive
#login
lcp-echo-interval 30
lcp-echo-failure 5
mtu 1500
mru 1500
ms-dns 8.8.4.4
ms-dns 8.8.8.8
debug
plugin radius.so
plugin radattr.so
logfile /var/log/pppoe-server.log

Делаем файл автозапуска /etc/init.d/pppoe

#!/bin/bash
### BEGIN INIT INFO
# Provides:          pppoe
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin
FLAGS="defaults 50"

LOCAL_IP=192.100.0.1
IFACE=eth0

case "$1" in
  start)
    echo "Starting PPPoE.... "
    echo "  Starting PPPoE on VLAN..."
    /usr/sbin/pppoe-server -N 1000 -k -L ${LOCAL_IP}  -I ${IFACE} 
    echo "pppoe."
    ;;
  stop)
    echo -n "Stopping PPPoE: "
    killall -9 pppd
    killall pppoe-server
    echo "pppoe."
    ;;
  force-reload|restart)
    echo "Restarting PPPoE: "
    sh $0 stop
    sh $0 start
    ;;
  *)
    echo "Usage: /etc/init.d/pppoe {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

exit 0

Сделаем его исполняемым

chmod +x /etc/init.d/pppoe

Добавляем в автозапуск

update-rc.d pppoe start 70 2 3 4 5 . stop 20 0 1 6 .

Стартуем

/etc/init.d/pppoe start

Шейпер

cp /usr/abills/misc/pppd/ip-up.local /etc/ppp

ABillS

/ Настройка / Сервера доступа/

Type: pppd
Alive: Интервал RADIUS Alive пакетов. Желательно значение 120
:Manage:
IP:PORT: IP-адрес и порт, на котором система сброса (pppd_kill) слушает команды
Password: Пароль
Radius Pairs: Дополнительные RADIUS атрибуты.

Who's online

There are currently 0 users and 3 guests online.