# PPP options for the PPPoE server # LIC: GPL require-chap auth lcp-echo-interval 10 lcp-echo-failure 2 logfile /tmp/pppd.log
ms-dns 223.5.5.5 -pap +chap
"admin" * "admin" *
sudo pppoe-server -I eth0 -L 172.25.1.1 -R 172.25.1.100 -N 10
这里我在虚拟机里添加了两张网卡,其中一张正常 NAT 上网,另外一张网卡设置为 host only,静态 IP。用于拨号。ubuntu
sudo iptables -A POSTROUTING -t nat -s 172.25.1.0/24 -j MASQUERADE
用 PC 搭建浪费一台电脑,不如直接在路由器上用 OpenWrt 来搭建一个 PPPoe serverui
dest root / dest ram /tmp lists_dir ext /var/opkg-lists option overlay_root /overlay src/gz packages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages src/gz oldpackages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackages
opkg update
opkg install rp-pppoe-server
#debug logfile /dev/null noipdefault noaccomp nopcomp nocrtscts lock maxfail 0 lcp-echo-failure 5 lcp-echo-interval 1
# PPP options for the PPPoE server # LIC: GPL require-chap auth lcp-echo-interval 10 lcp-echo-failure 2 logfile /tmp/pppd.log
pppoe-server -k -I br-lan -L 172.25.1.1 -R 172.25.1.100 -N 10
iptables -t nat -A POSTROUTING -s 172.25.1.0/24 -j MASQUERADE
这里不能上外网,多是由于路由器自己的一些设置问题。尚未搞清楚 。debug