# 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