Installing PPPoE on OpenWRT:
12 |
opkg update
opkg install rp-pppoe-server
|
Configuring PPPoE:
123456789 |
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
|
Setting up PPPoE account and password:
1234 |
cat > /etc/ppp/chap-secrets << EOF
#USERNAME PROVIDER PASSWORD IPADDRESS
www.haiyun.me * www.haiyun.me *
EOF
|
Starting the PPPoE service script:
1234567891011121314151617 |
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
|
Problem encountered 1, client connection error code 619, using tcpdump to listen to packets:
1 |
Generic-Error "RP-PPPoE: Child pppd process terminated"
|
Check PPPoE error log:
123 |
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.
|
Solution: Add -k to the startup parameters, load the kernel PPPoE module to start. Problem encountered 2, client connection error code 691, reason:
12 |
Username or password is incorrect
require-chap account password file must be confirmed as chap-secrets
|