wifidog在Openwrt安装PPPOE-Server服务

Step1.安装rp-pppoe-server

opkg update 
opkg install rp-pppoe-server

Step2.配置/etc/ppp/pppoe-server-options

vi /etc/ppp/pppoe-server-options

--------------------------------------------------------------
# PPP options for the PPPoE server
# LIC: GPL
require-pap
#login
auth
mru 1480
mtu 1480
lcp-echo-interval 10
lcp-echo-failure 2
--------------------------------------------------------------

Step3.配置/etc/ppp/pap-secrets
这个文件配置验证时的帐号密码的。

vi /etc/ppp/chap-secrets
--------------------------------------------------------------
#USERNAME PROVIDER PASSWORD IPADDRESS
pppoe *    pppoe *
test     *   test      10.0.1.2
--------------------------------------------------------------

Step4.设置开机自启动

vi /etc/init.d/pppoe-server
--------------------------------------------------------------
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
DEFAULT=/etc/default/pppoe-server
start() {
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -j MASQUERADE 
/usr/sbin/pppoe-server -k -T 60 -I br-lan -N 100 -L 10.0.1.1 -R 10.0.1.2
}
stop() {
killall pppoe-server
}
--------------------------------------------------------------

Step5.运行pppoe-server

chmod +x /etc/init.d/pppoe-server 
/etc/init.d/pppoe-server enable
/etc/init.d/pppoe-server start

Step6.拨号
所有配置已经完成,接下来就可以拨号了。

Openwrt安装PPPOE-Server服务

pppoe-server参数
-L: 指定PPPOE服务器的IP地址
-R: 指定PPPOE拨入服务器分配给客户端的IP地址段
-N: 允许客户端同时拨入的数量(默认是64 最大是65534)
-k: 使用内核方式(不过好象无法使用)

root@OpenWrt:/etc# pppoe-server -help
Usage: pppoe-server [options]
Options:
   -I if_name     -- Specify interface (default eth0.)
   -T timeout     -- Specify inactivity timeout in seconds.
   -C name        -- Set access concentrator name.
   -m MSS         -- Clamp incoming and outgoing MSS options.
   -L ip          -- Set local IP address.
   -l             -- Increment local IP address for each session.
   -R ip          -- Set start address of remote IP pool.
   -S name        -- Advertise specified service-name.
   -O fname       -- Use PPPD options from specified file
                     (default /etc/ppp/pppoe-server-options).
   -p fname       -- Optain IP address pool from specified file.
   -N num         -- Allow 'num' concurrent sessions.
   -o offset      -- Assign session numbers starting at offset+1.
   -f disc:sess   -- Set Ethernet frame types (hex).
   -s             -- Use synchronous PPP mode.
   -k             -- Use kernel-mode PPPoE.
   -u             -- Pass 'unit' option to pppd.
   -r             -- Randomize session numbers.
   -d             -- Debug session creation.
   -x n           -- Limit to 'n' sessions/MAC address.
   -P             -- Check pool file for correctness and exit.
   -h             -- Print usage information.
PPPoE-Server Version 3.10, Copyright (C) 2001-2006 Roaring Penguin Software Inc.
PPPoE-Server comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under the terms of the GNU General Public License, version 2
or (at your option) any later version.

本文章由 http://www.wifidog.pro/2014/12/31/wifidog-openwrt-pppoe-server.html 整理编辑,转载请注明出处

标签: wifidog认证 wifidog安装 wifidog原理 wifidog分析 wifidog配置 wifidog流程 wifidog服务器 wifidog-ddwrt wifidog openwrt