Jan 6, 2012

Configuration/Installaton of PPPOE Server in Linux

We have faced a situation in which I will need to create a Linux PPPOE Server that is connected a DSLAM.

The DSLAM contains 3 VPI/VCIs and routers are connected via RJ45. This routers send username and password for authentication.


I found it strange that a search in Google yields no result.


Below are the steps to create and configure a PPPOE Server in Linux that is connected to a DSLAM.


1)   Obtain the VLAN id from DSLAM

Normally each VPI/VCI is mapped to a VLAN.
For my case below is the information:
VPI/VCI-VLAN
0/10 -10
0/20-20
8/30-830
The command line to obtain the VLAN based on VPI/VCI is manufacturer specific and the DSLAM command line reference manual should be consulted.

2) Create the VLAN interfaces on the Linux server

Below is an example in Ubuntu to create VLAN 10 in /etc/network/interfaces file.
auto eth0.10
iface eth0.10 inet static
address 192.168.10.1
netmask 255.255.255.0
vlan_raw_device eth0

3) Create /etc/ppp/options file

This contains option for the PPPOE Server.
defaultroute
ipcp-accept-local
require-pap
refuse-eap
ms-dns 8.8.8.8
ms-dns 8.8.4.4
asyncmap 0
auth
crtscts
lock
hide-password
modem
proxyarp
lcp-echo-interval 30
lcp-echo-failure 4
noipx
auth indicates server will authenticate user name and password.

3) Create /etc/ppp/pap-secrets

This file contains the user name and password. The user public IP can also be specified.
Example content of user with static public IP
#Name-Host IP-Password-Point to point IP
user     *                        user123              1.2.3.4
Example content of user with dynamic public IP
#Name-Host IP-Password-Point to point IP
user     *                        user123              *
The  dynamic IP is specified when the pppoe-server is started.
Refer to Step 4.

4) Create the pppoe daemon file

Below is an example with VLAN 10,20 and 830 as well as no VLAN.
case "$1" in
start)
echo -n "Starting PPPoE Server"
pppoe-server -r -I eth0 -L 192.168.2.1 -R 192.168.2.2
pppoe-server -r -I eth0.10 -L 192.168.10.1 -R 192.168.10.2
pppoe-server -r -I eth0.100 -L 192.168.20.1 -R 192.168.20.2
pppoe-server -r -I eth0.835 -L 192.168.830.1 -R 192.168.830.2
if [ $? = 0 ] ; then
echo "start successful"
else
echo "start fail"
fi
echo ""
;;
esac




No comments:

Post a Comment