海运的博客

OpenWRT安装配置PPPoe服务器

发布时间:May 26, 2013 // 分类:OpenWrt // 1 Comment

OpenWRT安装PPPoe:

opkg update
opkg install rp-pppoe-server

配置PPPoe:

cat > pppoe-server-options << EOF
# PPP options for the PPPoE server
# LIC: GPL
require-chap
login
lcp-echo-interval 10
lcp-echo-failure 2
ms-dns 8.8.8.8
EOF

设置PPPoe账号、密码:

cat >/etc/ppp/chap-secrets << EOF
#USERNAME  PROVIDER  PASSWORD  IPADDRESS
www.haiyun.me * www.haiyun.me *
EOF

启动PPPoe服务脚本:

cat >/etc/init.d/pppoe-server << EOF
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50

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 eth1.1 -N 100 -L 10.0.1.1 -R 10.0.1.2
}

stop() {
        iptables -t nat -D POSTROUTING -s 10.0.1.0/24 -j MASQUERADE
    killall pppoe-server
}
EOF
chmod +x /etc/init.d/pppoe-server

遇到的问题1,客户端连接错误代码619,使用tcpdump监听数据包:

Generic-Error "RP-PPPoE: Child pppd process terminated"

查看pppoe错误日志:

May 26 13:31:07 OpenWrt daemon.notice pppd[4972]: Connect: ppp0 <--> /dev/pts/1
May 26 13:31:07 OpenWrt daemon.notice pppd[4972]: Modem hangup
May 26 13:31:07 OpenWrt daemon.notice pppd[4972]: Connection terminated.

解决方法:启动参数加-k,加载内核pppoe模块启动。
遇到的问题2,客户端连接错误代码691,原因:

用户名或密码填写错误
require-chap账号密码文件确认为chap-secrets

标签:openwrt, pppoe, adsl

有一条 关于" OpenWRT安装配置PPPoe服务器 "的评论

  1. wism wism

    openwrt 14 安装rp-pppoe-server

    问题1,客户端连接错误代码619,使用tcpdump监听数据包:
    Generic-Error "RP-PPPoE: Child pppd process terminated"
    按照你的解决方法添加-k 后还是提示这个错误

    12:00:10.161454 PPPoE PADI [Service-Name] [Host-Uniq 0x00000C54]
    12:00:10.161571 PPPoE PADO [AC-Name "OpenWrt"] [Service-Name] [AC-Cookie 0xA504C4232736AC9E2359C68043BA2D73012C0000] [Host-Uniq 0x00000C54]
    12:00:10.162160 PPPoE PADR [Service-Name] [Host-Uniq 0x00000C54] [AC-Cookie 0xA504C4232736AC9E2359C68043BA2D73012C0000]
    12:00:10.162497 PPPoE PADS [ses 0x9] [Service-Name] [Host-Uniq 0x00000C54]
    12:00:10.165063 PPPoE PADT [ses 0x9] [Generic-Error "RP-PPPoE: Child pppd process terminated"]
    12:00:12.857058 PPPoE PADI [Service-Name] [Host-Uniq 0x34000000000000005B000000]
    12:00:12.857183 PPPoE PADO [AC-Name "OpenWrt"] [Service-Name] [AC-Cookie 0xB85BDDBF4C5A475A02FE7A95B9C8521A012C0000] [Host-Uniq 0x34000000000000005B000000]
    12:00:12.857714 PPPoE PADR [Service-Name] [Host-Uniq 0x34000000000000005C000000] [AC-Cookie 0xB85BDDBF4C5A475A02FE7A95B9C8521A012C0000]
    12:00:12.858054 PPPoE PADS [ses 0xa] [Service-Name] [Host-Uniq 0x34000000000000005C000000]
    12:00:12.860312 PPPoE PADT [ses 0xa] [Generic-Error "RP-PPPoE: Child pppd process terminated"]
    12:00:12.861512 PPPoE PADT [ses 0xa]

评论已关闭

分类
最新文章
最近回复
  • 海运: 正常情况下编译整个内核执行make menuconfig后就不会出现此提示,当单独编译单个模块...
  • oijq: 就是用的armbian的配置文件哈,按你的教程做的,在执行make LOCALVERSION=...
  • 海运: 使用armbian的配置文件,其它添加或修改自己懂的部分,不懂的就不要碰了。
  • oijq: 编译时这些选项全部选Y吗?Actions Semi Platforms (ARCH_ACTIO...
  • 海运: n1编译bbr内核模块参考这个:https://www.haiyun.me/archives/...
  • jiqz: make M=net/ipv4/ CONFIG_TCP_CONG_BBR=m modules编...
  • ruralhunter: 哦,文档里应该是对的,是.config
  • ruralhunter: cp /mnt/boot/config-4.18.7-aml-s9xxx .config这里应...
  • 海运: 你是编译不成功呢?还是编译后不能运行呢?还是运行后不能访问web界面呢?
  • 白墨: 可能不清楚就是编译安装后启动后访问不了web界面