pppoe server setup in ubuntu

The PPPoE (Point to Point Protocol over Ethernet) protocol provides extensive user management, network management and accounting benefits to ISPs and network administrators. Currently PPPoE is used mainly by ISPs to control client connections for xDSL and cable modems as well as plain Ethernet networks. PPPoE is an extension of the standard Point to Point Protocol (PPP).

Generally speaking, PPPoE is used to hand out IP addresses to clients based on authentication by username (and also if required, by workstation) as opposed to workstation only authentication where static IP addresses or DHCP are used. It is advised not to use static IP addresses or DHCP on the same interfaces as PPPoE for obvious security reasons.

The PPPoE client and server work over any Layer2 Ethernet level interface on the router – wireless 802.11 (Aironet, Cisco, WaveLan, Prism, Atheros), 10/100/1000 Mbit/s Ethernet, RadioLan and EoIP (Ethernet over IP tunnel).

Feature list

  • PPPoE server and client support;
  • Multilink PPP (MLPPP);
  • MLPPP over single link (ability to transmit full-sized frames);
  • BCP (Bridge Control Protocol) support – allows sending of raw Ethernet frames over PPP links;
  • MPPE 40bit and MPPE 128bit RSA encryption;
  • pap, chap, mschap v1/v2 authentication;
  • RADIUS support for client authentication and accounting.

————————————————————————-

Server side setup :—-

server install with ubuntu 14.04 server ,two interfaces and internet.

Network configuration for server side -Before editing any configuration file tack the backup of configuration the file.

#sudo cp /etc/network/interfaces /etc/network/interfaces.backup

#sudo vim /etc/network/interfaces

edit the network configuration.(If you are having internet it is fine just setup eth1 interface)

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static  #ucan configure dhcp also
address 172.31.254.128
netmask 255.255.254.0 #Your subnet mask
gateway 172.31.254.1 #Your gateway

auto eth1
iface eth1 inet static
address 192.168.1.254
netmask 255.255.255.0

#sudo cp  /etc/resolve.conf /etc/resolve.conf.backup

#sudo vim /etc/resolve.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
#ping google.com
#apt-get remove pppoe
#apt-get install ppp ppp-dev pppoeconf

Download latest  rp-pppoe from  roaringpenguin click here – Link

wget https://www.roaringpenguin.com/files/download/rp-pppoe-3.11.tar.gz

Extract it

tar xvf rp-pppoe-3.11.tar.gz
cd rp-pppoe-3.10/src/
./configure
make && make install
sudo cp /etc/ppp/pppoe-server-options /etc/ppp/pppoe-server-options.backup

vim /etc/ppp/pppoe-server-options

# PPP options for the PPPoE server
# LIC: GPL
debug
#plugin /etc/ppp/plugins/rp-pppoe.so
require-pap
mtu 1492
mru 1492
ktune
proxyarp
lcp-echo-interval 10
lcp-echo-failure 2
nobsdcomp
noccp
novj
noipx 
#cp /etc/ppp/pap-secrets /etc/ppp/pap-secrets.backup

#vim /etc/ppp/pap-secrets

# Secrets for authentication using PAP
# client server secret IP addresses
user1       *    wifi       *
user2       *    wifi       *
#sudo vim iptoassign
192.168.1.1-50
#pppoe-server -I eth0 -F
#pppoe-server -C isp -L 192.168.1.254 -p /etc/ppp/allip -I eth1
#iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

Client side Configuration:—-

#apt-get remove pppoe
#apt-get install ppp ppp-dev pppoeconf

Download latest  rp-pppoe from  roaringpenguin click here – Link

wget https://www.roaringpenguin.com/files/download/rp-pppoe-3.11.tar.gz

Extract it

tar xvf rp-pppoe-3.11.tar.gz
cd rp-pppoe-3.10/src/
./configure
make && make install
#sudo cp /etc/ppp/pppoe.conf /etc/ppp/pppoe.conf.backup
#sudo vim /etc/ppp/pppoe.conf
ETH=eth0
USER=user1 #user delcarared from pap in server 
DEMAND=no
DNSTYPE=SERVER
PEERDNS=yes
DNS1=8.8.8.8
DNS2=8.8.4.4
DEFAULTROUTE=yes
CONNECT_TIMEOUT=30
CONNECT_POLL=2
ACNAME=
SERVICENAME=
PING="."
CF_BASE=`basename $CONFIG`
PIDFILE="/var/run/$CF_BASE-pppoe.pid"
SYNCHRONOUS=no
CLAMPMSS=1412
LCP_INTERVAL=20
LCP_FAILURE=3
PPPOE_TIMEOUT=80
FIREWALL=NONE
PPPOE_EXTRA=""
PPPD_EXTRA=""

Its testing Time :-

On server side –

#pppoe-server -C isp -L 192.168.1.254 -p /etc/ppp/allip -I eth1 -F

1

#ifconfig

server side ifconfig with eth1 192.168.1.254.ppp0 with 192.168.1.1

On client side :-

#pppoe-start -I eth0 user1

2

#ifconfig

@@——————–Troubleshooting——————-@@

On Server side :-

>>check the process runing on server :-

#pgrep pppoe

>>check teh value in file /proc/sys/net/ipv4/ip_forward is one,

 #cat /proc/sys/net/ipv4/ip_forward

>>check the iptables using following command

 #iptables -t nat -L | grep '192.168.1.0/24'

On client side :-

>>check internet connection from client machine.If you are unable to ping 8.8.8.8

and it gives error as

#ping 8.8.8.8
network unavailable 

# check if you are able to get the internet.check the default route

If there is no default route then add the default route using command.

#ip route default via 192.168.254.1
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s