Arno Wilhelm
2003-01-17
Copy the pppoe server sources from /home/software/6.2/SRPMS/rp-pppoe-3.5-1.src.rpm to your netfence box under the directory /usr/src/redhat/SRPMS/. Then issue the following commands:
> rpm -rebuild rp-pppoe-3.5.1.src.rpm
> cd ../RPMS/i386/
> rpm -Uvh rp-pppoe-3.5-1.i386.rpm
In the /etc/ppp/ directory there are now two configuration files:
-rw-r-r- 1 root root 4562 Jan 17 15:43 pppoe.conf
-rw-r-r- 1 root root 104 Jan 17 15:43 pppoe-server-options
require-pap
login
lcp-echo-interval 10
lcp-echo-failur 4
# Secrets for authentication using PAP
# client server secret IP addresses
MyUserName * CX2345 192.168.232.65
This entry in the pap-secrets file means that the ppp client with the username ``MyUserName'' and password ``CX2345'' can login from any server and gets assigned the ip address 192.168.232.65 then.
Make sure the ethernet device on which the pppoe server should listen is clean and up:
The client and the server are included in the same rpm. So you have to install the sources only once:
As already described in the server configuration you have to add the
user and his password to the /etc/ppp/pap-secrets file:
# Secrets for authentication using PAP
# client server secret IP addresses
MyUser * CX2345 192.168.232.65
This entry in the pap-secrets file means that the ppp client uses the username ``MyUser'' and password ``CX2345'' when connecting to a ppp-server.
For running the client you have to issue a quite complicated command.
This command is assembled out of two commands: one for the ppp daemon
and one for the pppoe client. In fact you call the pppd daemon with
an option that starts the pppoe client that sets up the line before
the pppd daemon can make the authentication etc. Since the command
is too complicated ( and too long :-) I just enumerate the single
steps and enclose a shell scripts that shows the details. The shell
script was inspired by the adsl-start script from redhat. For further
info on the single command line parameters and options see man
pppoe and man pppd.
These are the single steps:
#########################
# Fill in your options here: #
#########################
USER="MyUser" # username: when using pap authentication itmust be listed in /etc/ppp/pap-secrets
DEV="pppoe" # device
PPPOE_PIDFILE="${DEV}.pppoe" # pidfile for pppoe
PPPD_PIDFILE="${DEV}.pppd" # pidfile for pppd daemon
TIMEOUT=30 # connection timout in seconds
MTU=1412 # MTU
AC="bugs" # Access concentrators name -> see also the pppoe-server -C option
SERVICENAME= # We are not using a service name
SYNCHRON=no # Put here a -s if you want to use synchronous mode
LCP_INTERVAL=20 # Testing the line every LCP_INTERVAL seconds ...
LCP_FAILURE=3 # Shutting down the device when the line tests have failed a LCP_FAILURE time ...
PEERDNS="no" # Getting the dns server from the remote side ?
######################
# Path to programms: #
######################
SETSID=`which setsid` # setsid â run a program in a new session
PPPD=`which pppd`
PPPOE=`which pppoe`
IP=`which ip`
##############################################################
# Starting a pppoe connection means actually starting to programms: #
# -> The pppoe programm for preparing the line. #
# -> The pppd deamon for authentication etc. #
#############################################################
######################
# The pppoe command: #
######################
if test -n "$SERVICENAME" ; then
SERVICENAME="-S $SERVICENAME"
fi
if test -n "$AC" ; then
AC="-C $AC"
fi
if test -n "$MTU" ; then
MTU="-m $MTU"
fi
if test "$SYNCHRON" = "yes" ; then
PPPOE_SYNC="-s"
PPPD_SYNC="sync"
# Increase the chances of it working on Linux...
modprobe n_hdlc > /dev/null 2>&1
else
PPPOE_SYNC=""
PPPD_SYNC=""
fi
PPPOE_CMD="pppoe -p ${PPPOE_PIDFILE} -I ${DEV} -T ${TIMEOUT} ${PPPOE_SYNC} -U ${MTU} ${AC} ${SERVICNAME}"
echo "PPPOE Command:"
echo " ${PPPOE_CMD}"
echo
####################
# The ppp options: #
####################
if test "$DNSTYPE" = "SERVER" ; then
PEERDNS=yes
fi
if test "$PEERDNS" = "yes" ; then
PEERDNS="usepeerdns"
else
PEERDNS=""
fi
# Standard PPP options we always use
PPP_STD_OPTIONS="noipdefault noauth default-asyncmap defaultroute hide-password nodetach $PEERDNS mtu 1492 mru 1492 noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp user $USER lcp-echo-interval $LCP_INTERVAL lcp-echo-failure $LCP_FAILURE"
echo "PPP Options:"
echo " $PPP_STD_OPTIONS"
echo
#######################
# Preparing the device: #
#######################
${IP} link set dev ${DEV} down
${IP} link set mtu 1500 dev ${DEV}
${IP} link set dev ${DEV} up
#######################
# Loading the modules: #
#######################
# For 2.4 kernels. Will fail on 2.2.x, but who cares?
modprobe ppp_generic > /dev/null 2>&1
modprobe ppp_async > /dev/null 2>&1
modprobe ppp_synctty > /dev/null 2>&1
# for newer 2.5 kernels or patched 2.4 kernels !?
# if test -n "$LINUX_PLUGIN" ; then
# modprobe pppox > /dev/null 2>&1
# modprobe pppoe > /dev/null 2>&1
#######################
# The command itself: #
#######################
echo "The finished pppoe client command:"
echo ' ${SETSID} ${PPPD} pty "$PPPOE_CMD" $PPP_STD_OPTIONS $PPPD_SYNC &'
echo " ${SETSID} ${PPPD} pty \"${PPPOE_CMD}\" ${PPP_STD_OPTIONS} ${PPPD_SYNC} &"
echo
${SETSID} ${PPPD} pty "$PPPOE_CMD" $PPP_STD_OPTIONS $PPPD_SYNC &
echo "$!" > $PPPD_PIDFILE
Depending on the type of connection ( async, sync ) certain modules have to be installed and loaded before the pppoe client can be started.
Make sure you have following modules:
Make sure you have following modules:
It seems that in this kernels/plugins the modules pppox and ppoe have been added.
If you want to watch the pppoe packets, use the following tcpdump command:
This document was generated using the LaTeX2HTML translator Version 2002 (1.62)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -no_subdir -split 0 -show_section_numbers /tmp/lyx_tmpdir29963A7nznb/lyx_tmpbuf29963uqNzhq/Pppoe-Howto.tex