Install RP-PPPoE

  • sudo apt-get install ppp
  • wget https://www.roaringpenguin.com/files/download/rp-pppoe-3.12.tar.gz
  • tar zxvf rp-pppoe-3.12.tar.gz
  • cd rp-pppoe-3.12/src
  • ./configure
  • make
  • sudo make install

configure file

  • sudo nano /etc/ppp/pppoe-server-options require-chap auth lcp-echo-interval 10 lcp-echo-failure 2 ms-dns 8.8.8.8 ms-dns 8.8.4.4 logfile /var/log/pppd.log
  • 原始是 require-pap 跟 login 要改成 require-chap 跟 auth,ms-dns 則是傳送 dns server 給 user 設定。

User setup

  • sudo nano chap-secrets# Secrets for authentication using CHAP # client server secret IP addresses "user1" * "123456" *
  • client 為使用者名稱
  • secret 為使用者密碼

Enable internet connection

  • sudo su
  • echo 1 > /proc/sys/net/ipv4/ip_forward
  • uncomment net.ipv4.ip_forward=1 in /etc/sysctl.conf for permanent settings
  • iptables -A POSTROUTING -t nat -s 10.10.10.0/24 -j MASQUERADE
  • exit

start pppoe server

  • sudo pppoe-server -I eno1 -L 10.10.10.1 -R 10.10.10.100 -N 100
  • -I 為網卡名稱,預設為 eth0。
  • -L 為派發給使用者的 gateway ip。
  • -R 為派發給使用者的 ip 起始位置。
  • -N 允許同時上線的使用者。
  • sudo killall pppoe-server

Debug

  • $ ./configure checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/home/enos/rp-pppoe-3.12/src': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details 解決方式: sudo apt-get install gcc
  • checking for Linux 2.4.X kernel-mode PPPoE support... yes configure: WARNING: *** Oops! I couldn't find pppd, the PPP daemon anywhere. configure: WARNING: *** You must install pppd, version 2.3.10 or later. configure: WARNING: *** I will keep going, but it may not work. configure: WARNING: *** Oops. I cannot figure out what version of pppd you have. configure: WARNING: *** All I got back was '' configure: WARNING: *** I will keep going, but it may not work. 解決方式: sudo apt-get install ppp

參考

創作者介紹
創作者 台南小新 的頭像
台南小新

邱小新の工作筆記

台南小新 發表在 痞客邦 留言(0) 人氣()