http://imranasghar.blogspot.com/2009/05/pppoe-server-under-ubuntudebian.html

----------------------------

PPPoE Server Setup:
Operating System: Ubuntu Desktop(8.04)

1) Installation of Softwares:
Server Side
a) ppp
apt-get install ppp
b) pppoe
apt-get install pppoe
c) rp-pppoe (I used rp-pppoe-3.10.tar.gz)
RP PPPoE; can be obtained from,
http://www.roaringpenguin.com/products/pppoe
After download
Move it to some place e.g /var/tmp, unpack and change permission

root@pppoe:/var/tmp# mv /home/imran/Desktop/rp-pppoe-3.10.tar.gz /var/tmp/

root@pppoe:/var/tmp# tar -xvf rp-pppoe-3.10.tar.gz

root@pppoe:/var/tmp# chown imran:imran rp-pppoe-3.10

root@pppoe:/var/tmp# ls -l

total 220

drwxr-xr-x 8 imran imran   4096 2008-06-30 16:00 rp-pppoe-3.10

-rw-r--r-- 1 imran imran 215288 2009-10-19 10:31 rp-pppoe-3.10.tar.gz

root@pppoe:/var/tmp#

Open README file and go through it.There are 3 methods I shall go for first one, QuickStart method.

QUICKSTART Method: "If you're lucky, the "quickstart" method will work. After unpackingthe archive, become root and type"
root@pppoe:/var/tmp# cd rp-pppoe-3.10/
root@pppoe:/var/tmp/rp-pppoe-3.10# ./go

I got some gcc error, fixed it by installing "build-essential", This will install gcc and a some other files that need to build something from source.

sudo aptitude install build-essential

root@pppoe:/var/tmp/rp-pppoe-3.10# ./go

** Summary of what you entered **

Ethernet Interface: eth1
User name:          test
Activate-on-demand: No
Primary DNS:        82.196.201.43
Secondary DNS:      82.196.193.143
Firewalling:        NONE

>>> Accept these settings and adjust configuration files (y/n)? y
Adjusting /etc/ppp/pppoe.conf
Adjusting /etc/resolv.conf
 (But first backing it up to /etc/resolv.conf-bak)
Adjusting /etc/ppp/pap-secrets and /etc/ppp/chap-secrets
 (But first backing it up to /etc/ppp/pap-secrets-bak)
 (But first backing it up to /etc/ppp/chap-secrets-bak)

You will get messeg, "Congratulations, it should be all set up!"
Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring
it down. Type 'pppoe-status' to see the link status.

Client Side :
# apt-get install pppoeconf

This will use to connect the pppoe server.

2) Configuration
Server side: Go the to /etc/ppp,

root@pppoe:/var/tmp# cd /etc/ppp
root@pppoe:/etc/ppp# ls
chap-secrets              ip-down.d    options          pppoe.conf-bak
chap-secrets-bak          ip-up        pap-secrets      pppoe_on_boot
firewall-masq             ip-up.d      pap-secrets-bak  pppoe-server-options
firewall-masq-3.10        ipv6-down    peers            pppoe-server-options-example
firewall-standalone       ipv6-down.d  plugins          pppoe-up
firewall-standalone-3.10  ipv6-up      pppoe.conf       resolv
ip-down                   ipv6-up.d    pppoe.conf-3.10
root@pppoe:/etc/ppp#

Many files, but interested are , pppoe-server-options, pppoe.conf, options,pap-secrets,chap-secrets
PAP is default authentication method, I let it.
root@pppoe:/etc/ppp# nano pap-secrets

#
# /etc/ppp/pap-secrets
#

# INBOUND connections

# Every regular user can use PPP and has to use passwords from /etc/passwd
*       hostname        ""      *

# UserIDs that cannot use PPP at all. Check your /etc/passwd and add any
# other accounts that should not be able to use pppd!
guest   hostname        "*"     -
master  hostname        "*"     -
root    hostname        "*"     -
support hostname        "*"     -
stats   hostname        "*"     -
# OUTBOUND connections

# Here you should add your userid password to connect to your providers via
# PAP. The * means that the password is to be used for ANY host you connect
# to. Thus you do not have to worry about the foreign machine name. Just
# replace password with your password.
# If you have different providers with different passwords then you better
# remove the following line.
#       *       password

"test"  *       "test"

You can change the authenticaion method from follwing file
root@pppoe:/etc/ppp# nano pppoe-server-options

# PPP options for the PPPoE server
# LIC: GPL
require-pap
#require-chap
login
lcp-echo-interval 10
lcp-echo-failure 2

a) Change following in /etc/ppp/options file, some to them already uncommented.
In case of chap as authentication, the file looks like
root@pppoe:/etc/ppp# nano chap-secrets

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses

"test"          *        "test"         *
"test1"         *        "test"         *
"test2"         *       "test"          10.10.220.3
"test3"         *       "test"          10.10.220.4

Script that start the PPPoE server with NAT option
Create a script pppoe-up and chmod to 755.
root@pppoe:/etc/ppp# nano pppoe-up
root@pppoe:/etc/ppp# chmod 755 pppoe-up

#!/bin/bash
# ----------------------------------------------------

# Starts the PPPoE server and turns on NAT

# ----------------------------------------------------

# MAX is the maximum number of addresses your server

# is allowed to hand out.
PROV=pppoe
MAX=5

# BASE is the lowest IP address your server is allowed

# to hand out.

#BASE=192.168.1.238
#PLA=192.168.1.0/24

BASE=10.10.220.2
PLA=10.10.220.4

# NAT is the set of addresses which your server will

# NAT behind it. Other addresses behind your server

# WILL NOT be NATed.

#NAT=10.10.220.0/8

# MYIP is the public IP address of this server.

MYIP=10.10.220.1

##########################################

# Here is where the script actually starts executing.
##########################################

# Disable IP spoofing on the external interface.

#/sbin/iptables -A INPUT -i eth0 -s $NAT -j DROP

# Enable NAT for the private addresses we hand out.

#/sbin/iptables -t nat -A POSTROUTING -s $NAT -j $NAT --to-source $MYIP

# Launch the server.

/usr/sbin/pppoe-server pty -T 60 -I eth1 -L $MYIP -N $MAX -C $PROV -S $PROV -R $PLA

#echo "1" > "/proc/sys/net/ipv4/ip_forward"

Client side
Install pppoeconf, which may be already installed.
apt-get install pppoeconf

Run the Server

Execute the pppoe-up script in server.
root@pppoe:/etc/ppp# ./pppoe-up

Connection of client
Run pppoeconf in client's console,
client# pppoeconf

It will search for pppoe server on ethernet server. Once it found on, in this case in eth0 it will prompt for user name: test and passwd: test

Testing and Troubleshooting
Open the /var/log/syslog in server and monitor,

da:72:54 (10.10.220.1) on eth1 using Service-Name ''

Oct 19 12:58:11 pppoe pppd[6248]: pppd 2.4.4 started by root, uid 0

Oct 19 12:58:11 pppoe pppd[6248]: Using interface ppp0

Oct 19 12:58:11 pppoe pppd[6248]: Connect: ppp0 <--> /dev/pts/2

Oct 19 12:58:17 pppoe pppd[6248]: PAP peer authentication failed for test

Oct 19 12:58:17 pppoe pppd[6248]: Connection terminated.

Oct 19 12:58:17 pppoe pppoe[6250]: read (asyncReadFromPPP): Session 2: Input/output error

Oct 19 12:58:17 pppoe pppd[6248]: Exit.

Oct 19 12:58:17 pppoe pppoe-server[5908]: Session 2 closed for client 00:1e:37:da:72:54 (10.10.220.1) on eth1

Oct 19 12:58:17 pppoe pppoe-server[5908]: Sent PADT

There are some problems which need to fix
After fixing the issue, reconnect the client and monitor the log on server.
client# pppoeconf

Oct 19 13:19:18 pppoe pppd[8724]: pppd 2.4.4 started by root, uid 0
Oct 19 13:19:18 pppoe pppd[8724]: Using interface ppp0
Oct 19 13:19:18 pppoe pppd[8724]: Connect: ppp0 <--> /dev/pts/2
Oct 19 13:19:21 pppoe pppd[8724]: Cannot determine ethernet address for proxy ARP
Oct 19 13:19:21 pppoe pppd[8724]: local  IP address 10.10.220.1
Oct 19 13:19:21 pppoe pppd[8724]: remote IP address 10.10.220.2

It setted up ultimatley, I spent some time, checking the script carefully, running and testing several times before it was fixed.

Final testing, Both client and server will get the ip and they are able to ping each other.

Server side
root@pppoe:/etc/ppp# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:25:ed:fd:e2
         inet addr:192.168.1.249  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::211:25ff:feed:fde2/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:8943 errors:0 dropped:0 overruns:0 frame:0
         TX packets:3137 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:100
         RX bytes:4222424 (4.0 MB)  TX bytes:833756 (814.2 KB)
         Base address:0x4000 Memory:d0080000-d00a0000

eth1      Link encap:Ethernet  HWaddr 00:08:a1:be:1d:65
         inet6 addr: fe80::208:a1ff:febe:1d65/64 Scope:Link
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         RX packets:648 errors:0 dropped:0 overruns:0 frame:0
         TX packets:776 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:39320 (38.3 KB)  TX bytes:50994 (49.7 KB)
         Interrupt:21 Base address:0x6000
eth1:avahi Link encap:Ethernet  HWaddr 00:08:a1:be:1d:65
         inet addr:169.254.5.242  Bcast:169.254.255.255  Mask:255.255.0.0
         UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
         Interrupt:21 Base address:0x6000

lo        Link encap:Local Loopback
         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host
         UP LOOPBACK RUNNING  MTU:16436  Metric:1
         RX packets:2215 errors:0 dropped:0 overruns:0 frame:0
         TX packets:2215 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:0
         RX bytes:113003 (110.3 KB)  TX bytes:113003 (110.3 KB)

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:10.10.220.1  P-t-P:10.10.220.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
         RX bytes:724 (724.0 B)  TX bytes:382 (382.0 B)

Ping from srver to client

root@pppoe:/etc/ppp# ping 10.10.220.2
PING 10.10.220.2 (10.10.220.2) 56(84) bytes of data.

PPPoE Server Under Ubuntu/Debian的更多相关文章

  1. How to create a PPPoE Server on Ubuntu? (Untested)

    How to create a PPPoE Server on Ubuntu? March 30, 2011 coder_commenter Leave a comment Go to comment ...

  2. How to Install and Configure Bind 9 (DNS Server) on Ubuntu / Debian System

    by Pradeep Kumar · Published November 19, 2017 · Updated November 19, 2017 DNS or Domain Name System ...

  3. Ubuntu上架设PPPoE Server

    一.安裝 PPPoE Server Software1)sudo apt-get install ppp2)rp-pppoe(非apt套件)wget -c http://www.roaringpeng ...

  4. Install and Enable Telnet server in Ubuntu Linux

    转:http://ubuntuguide.net/install-and-enable-telnet-server-in-ubuntu-linux 参考:http://auxnet.org/index ...

  5. pppoe server 搭建

    Ubuntu 上搭建 pppoe server sudo apt-get install pppoe $ cat /etc/ppp/pppoe-server-options # PPP options ...

  6. install dns server on ubuntu

    参考 CSDN/Ubuntu环境下安装和配置DNS服务器 在 Ubuntu 上安裝 DNS server Install BIND 9 on Ubuntu and Configure It for U ...

  7. How to set up an FTP server on Ubuntu 14.04

    How to set up an FTP server on Ubuntu 14.04 Setting up a fully-functional and highly secure FTP serv ...

  8. Ubuntu上配置SQL Server Always On Availability Group(Configure Always On Availability Group for SQL Server on Ubuntu)

    下面简单介绍一下如何在Ubuntu上一步一步创建一个SQL Server AG(Always On Availability Group),以及配置过程中遇到的坑的填充方法. 目前在Linux上可以搭 ...

  9. Ubuntu/Debian 8 安装 Intel realsense 摄像头驱动

    ## Make Ubuntu/Debian Up-to-date1. sudo apt-get update && sudo apt-get upgrade && su ...

随机推荐

  1. jQuery 插件模板

    1.为每一个DOM对象创建一个插件对象 模板定义: (function($) { $.pluginName = function(element, options) { var defaults = ...

  2. 关于HSL和HSV颜色空间的详细论述

    目前在计算机视觉领域存在着较多类型的颜色空间(color space).HSL和HSV是两种最常见的圆柱坐标表示的颜色模型,它重新影射了RGB模型,从而能够视觉上比RGB模型更具有视觉直观性. HSV ...

  3. 【HDOJ】1262 寻找素数对

    典型的二分决策树.而且本身两数和是偶数. #include <stdio.h> #include <string.h> #define MAXNUM 10001 int isP ...

  4. JavaScript里的类和继承

    JavaScript与大部分客户端语言有几点明显的不同: JS是 动态解释性语言,没有编译过程,它在程序运行过程中被逐行解释执行JS是 弱类型语言,它的变量没有严格类型限制JS是面向对象语言,但 没有 ...

  5. HDU-1896 Stones

    http://acm.hdu.edu.cn/showproblem.php?pid=1896 题意:一个人从0开始走起,遇到偶数个石头就踢.要是同一位置有多个石头,则先扔最重的石头(也就是扔的最近的那 ...

  6. 转:ndk-stack打印崩溃堆栈

            接下来详细说明ndk-stack的使用方法.         第一步:首先获得发生崩溃的共享库.                 如果你是利用ndk-build应用的话,共享库会在$P ...

  7. kafka在虚拟机环境的优化

    首先是,多磁盘的并发的问题.不管怎么说,虚拟机环境至少剥夺了单个kafka同时使用多个磁盘的优势.也就意味着,在同一个虚拟机,同一个topic,最好只有一partition:当然,不同topic之间p ...

  8. HTML5 SSE自动推送

    前端页面: <!doctype html> <html> <head> <meta charset="UTF-8"> <tit ...

  9. ACM2032

    杨辉三角 Problem Description 还记得中学时候学过的杨辉三角吗?具体的定义这里不再描述,你可以参考以下的图形:11 11 2 11 3 3 11 4 6 4 11 5 10 10 5 ...

  10. Esper系列(五)Order by、Limit、构建事件流、Updating an Insert Stream

    Order by 与SQL语法类似类似,默认为升序排列; 注意: 如果order by的子句中出现了聚合函数,那么该聚合函数必须出现在select的子句中. 出现在select中的expression ...