Install and configure PPPoE Server on Debian Squeeze

Valic —  November 3, 2011 — 5 Comments

For providing access via PPPoE it is required a PPPoE network access server (NAS) and a subscriber’s unit (PPPoE client).
In this guide as a PPPoE network access server it is used a freeware packet rp-pppoe.

Step1. First we need intenet access and 2 network cards (eth0 – WAN, eth1 – LAN).

vim /etc/network/interfaces

auto lo
iface lo inet loopback
iface eth0 inet static
address 89.xxx.xxx.xxx #Your public IP address
netmask 255.xxx.xxx.xxx  #Your subnet mask
gateway 89.xxx.xxx.xxx    #Your gateway

iface eth1 inet static
address 192.168.4.254
netmask 255.255.255.0

Step2. Install ppp daemon:

apt-get install ppp

Step3. Get rp-pppoe from here and install it.

wget http://www.roaringpenguin.com/files/download/rp-pppoe-3.10.tar.gz

Extract the archive:

tar -zxf rp-pppoe-3.10.tar.gz

 

Now compile it:

cd rp-pppoe-3.10/src/
./configure
make && make install
Step4. Edit the PPPoE server options:
vim /etc/ppp/pppoe-server-options
The file looks like this:
require-chap
login
lcp-echo-interval 10
lcp-echo-failure 2
ms-dns 8.8.8.8
ms-dns 8.8.4.4
netmask 255.255.255.0
defaultroute
noipdefault
usepeerdns
Step5. Add usernames and passwords in the /etc/ppp/chap-secrets file:
vim /etc/ppp/chap-secrets
The file looks like this:
# Secrets for authentication using CHAP
# client server secret IP addresses
#USERNAME       SERVER              PASSWORD                            CLIENT IP ADDRESS
"user1"                            *               "password1"                                                                                  192.168.4.100
"user2"                            *               "password2"                                                                                   192.168.4.101
Step6. Now set up the IP addresses pool:

We will assign the future clients one IP address from the 192.168.4.1 to 192.168.4.200  range.

echo "192.168.4.1-200" > /etc/ppp/allip
Step7.  Start  PPPoE server:
pppoe-server -C isp -L 192.168.4.254 -p /etc/ppp/allip -I eth1
Step8. Do not forget to enable packet forwarding between network interfaces:
echo 1 > /proc/sys/net/ipv4/ip_forward
And set up NAT in order to provide internet access to the LAN computers:
iptables -t nat -A POSTROUTING -s 192.168.4.0/24 -o eth0 -j MASQUERADE
Enjoy.

Valic

Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

5 responses to Install and configure PPPoE Server on Debian Squeeze

  1. please, don’t make slackware from debian :)

    debian has rp-pppoe source package since lenny at least:

    sudo apt-get build-dep rp-pppoe
    apt-get source rp-pppoe
    cd rp-pppoe-VERSION
    fakeroot debian/rules binary
    sudo dpkg -i ../pppoe-VERSION.deb

  2. Seems to be, than “-j MASQUERADE” do job only for ppp out connections. In my case — outgoing eth0 Ethernet interface with dhcp — MASQUERADE did non change the picture, so I use SNAT with specification outgoing (nat) interface’s address and without source address range specification:

    iptables -t nat -A POSTROUTING -o eth0 -j SNAT –to-source 89.xx.xx.xx

  3. From my configuration
    And set up NAT in order to provide internet access to the LAN computers:

    iptables -t nat -A POSTROUTING -s 192.168.4.0/24 -j MASQUERADE

    (without -o OUTGOING_INTERFACE)
    works !

  4. Thanks for post!

  5. On Debian Wheezy it is as simple as:

    apt-get install pppoe pppoeconf

    Then run pppoeconf and fill in the fields :)

    sudo pppoeconf

Leave a Reply