How-to Use Solaris ASPPP with PPPoE

home


Introduction

The Point to Point Protocol over Ethernet (PPPoE) describes a method to use ethernet (rather than a serial interface and cable) as the means for connecting a computer to a broadband modem. Use of PPPoE is typical for many Digital Subscriber Loop (DSL) Internet service providers. From a user's point of view, PPPoE creates a service environment much like dial-up Internet access.

The practical problem with PPPoE is overcoming the limitations of dial-up PPP software. PPP software usually associates itself with serial interfaces and analog telephone modems. Thus, using PPP with ethernet requires special client software for both Windows as well as Solaris. Here we describe the situation, and solutions, for Solaris ASPPP.

An effective way to avoid PPPoE is to avoid, if possible, the broadband Internet service providers that require it. In this modern age of "always-on" residential broadband service, traditional IP over ethernet technology is already well suited. Requiring PPPoE broadband technology that simulates the connect, authenticate, and disconnect feature disadvantages of dial-up service is a major step backwards.

Solaris and PPPoE

Solaris 8 and earlier releases include a bundled aspppd (Solaris ASPPP) executable useful for PPP dial-up connectivity with Internet service providers. Sun also supports an optional and alternate PPP implemention known as Solistice PPP. However, neither product directly supports PPP over an ethernet interface. One method to solve this is to replace the Solaris PPP with open-source products. The typical choice is to use Australian National University (ANU) PPP with Roaring Penguin PPPoE. However, ANU PPP on Solaris traditionally left items to be desired (and some may have since been corrected), such as trouble free 64-bit kernel support.

It is possible to leave a native Solaris PPP installation as is, and redirect PPP to and from an ethernet interface. This may be accomplished with clever use of a pseudo-terminal redirector and Roaring Penguin PPPoE. The redirector creates a virtual serial interface for PPP and mediates traffic to RP-PPPoE. RP-PPPoE, in turn, manages ethernet communications. In this HOW-TO, we describe the necessary setup tricks to use Solaris ASPPP in PPPoE situations. Similar methods here should also work with Solstice PPP.

In the Solaris 8 10/2001 release and later, Sun PPP 4.0 (pppd) replaces both ASPPP and Solistice PPP. These Solaris releases also include utilities that natively support PPPoE, and additional third party software is no longer necessary. This PPP/PPPoE implementation is very different from their earlier counterparts. Thus, this HOW-TO does not apply to any of the PPP versions that Sun bundles with Solaris 8 10/2001 and later.

Installing PPP

First make sure Solaris has its PPP support packages installed. The pkginfo utility is useful for this purpose. For Solaris (version 8 and before), the following are the bundled ASPPP packages:
# pkginfo | grep -i ppp
system      SUNWapppr      PPP/IP Asynchronous PPP daemon configuration files

system      SUNWapppu      PPP/IP Asynchronous PPP daemon and PPP login service
system      SUNWpppk       PPP/IP and IPdialup Device Drivers
#

If you have 64-bit Solaris, the following should also appear:
system      SUNWpppkx      PPP/IP and IPdialup Device Drivers  (64-bit)
ASPPP also requires several UUCP support packages. They are:
# pkginfo | grep -i bnu
system      SUNWbnur       Networking UUCP Utilities, (Root)
system      SUNWbnuu       Networking UUCP Utilities, (Usr)
#
If  pkginfo shows another PPP implementation (such as Solstice) is already installed, you need to decide whether to keep and use that installation or not. If not, then remove those PPP installations from the system with the pkgrm utility. Multiple PPP installations, on the same workstation, can interfere with each other.

The Solaris ASPPP packages are available on the Solaris CD-ROMs. Solaris includes these by default when selecting the "Entire Distribution plus OEM support" or the "Entire Distribution" install options. "Developer System Support", "End User System Support", and "Core System Support" options require reconfiguration to include PPP. Otherwise you can install PPP manually at a later time.

Assuming PPP is not already installed, locate the Solaris product directory on the CD-ROM, then use pkgadd. The order of package installation is important. You install the device drivers first:
# pkgadd -d . SUNWpppk
# pkgadd -d . SUNWpppkx    # For 64-bit Solaris, if needed
# pkgadd -d . SUNWapppr
# pkgadd -d . SUNWapppu
# pkgadd -d . SUNWbnur
# pkgadd -d . SUNWbnuu
# reboot -- -r             # Reboot and reconfigure devices
Finally, aspppd should be patched after installation. Many first customer ship (FCS) versions had all sorts of bugs and problems. Patches for aspppd, if any, are available from SunSolve.

Downloads

The table below shows the essential downloads necessary to assist in configuring Solaris ASPPP for networking environments that require PPPoE.
 
rp-pppoe-3.3.tar.gz
Roaring Penguin's PPPoE product
An open-source PPPoE implementation for Solaris/Linux that manages PPP traffic over ethernet. Note RP-PPPoE does not implement PPP itself.
ptysh2-sysv.c
A pseudo terminal (pty) redirector
It's from O'Reilly's book Using and Managing PPP . This redirector creates a virtual serial interface with /bin/sh functioning as the modem.

Roaring Penguin's PPPoE requires the C library function snprintf and derivatives. This function is absent in Solaris 2.5.1 releases and earlier. To use RP-PPPoE in this situation, you'll also need to download the following:

snprintf_2.2.tar.gz
snprintf, a portable implementation by Mark Martinec
Includes vsnprintf.c, asnprintf, vasnprintf, asprintf, and vasprintf.

All these downloads are C language source code and require compilation and installation before use. A C compiler is a necessary tool which Solaris does not provide by default. Some available Solaris C compilers include gcc, in binary executable form at sunfreeware.com, and Sun Microsystems Workshop.

Compiling, Installing, and Testing

The compilation instructions here are for an ancient SPARC Solaris system with the following configuration:
The Sun C compiler is cc. In contrast, the gnu C compiler is gcc. Thus the procedures here will vary if your development environment differs. The instructions here work for RP-PPPoE version 3.3. Later versions may require tweaking compilation procedures.

Snprintf

Snprintf is only necessary for Solaris 2.5.1 and earlier. Solaris 2.6 and later already include this function in the standard C library. You can skip to the next section as needed.
$ gunzip -c snprintf_2.2.tar.gz | tar xf -
$ cd snprintf_2.2
$ ls
INSTALL        README         snprintf.h
LICENSE.txt    README.html    test.c
Makefile       snprintf.c     with_autoconf
$ cc -c snprintf.c
$
The desired output file is snprintf.o, which may be left in the snprintf_2.2 source directory for later use.

RP-PPPoE

First uncompress and extract the RP-PPPoE source code. Then cd to the directory shown, and run the configure script:
$ gunzip -c rp-pppoe-3.3.tar.gz | tar xf -
$ cd rp-pppoe-3.3
$ ls
README         doc            gui            scripts
SERVPOET       go             man            src
configs        go-gui         rp-pppoe.spec
$ cd src
$ ./configure
. . .

-n checking for Linux 2.4.X kernel-mode PPPoE support...
no

*** Oops!  I couldn't find pppd, the PPP daemon anywhere.
*** You must install pppd, version 2.3.10 or later.
*** I will keep going, but it may not work.

./configure: NOTFOUND: not found

*** Oops.  I cannot figure out what version of pppd you have.
*** All I got back was ''
*** I will keep going, but it may not work.

-n checking packing order of bit fields...
normal
 

Type 'make' to compile the software.
$

RP-PPPoE expects to work with an ANU PPP installation. Because we plan to use Solaris ASPPP instead, the configure script will complain that pppd is not found. We can safely ignore this error. Next we run make:

$ make
. . .

cc -o pppoe-server pppoe-server.o if.o debug.o common.o md5.o
Undefined                       first referenced
 symbol                             in file
snprintf                            pppoe-server.o
ld: fatal: Symbol referencing errors. No output written to pppoe-server
*** Error code 1
make: Fatal error: Command failed for target `pppoe-server'
$

The above is a compilation failure on Solaris 2.5.1, because of the aforementioned missing snprintf. We can correct this by manually invoking a variation of the failed compile command. Then run make again to finish up.

$ cc -o pppoe-server pppoe-server.o if.o debug.o common.o md5.o ../../snprintf_2.2/snprintf.o
$ make
. . .

Type 'make install' as root to install the software.
$

The make install recommendation causes RP-PPPoE to scribble itself throughout the system, including writing files in /usr/sbin, /usr/doc, /usr/man, and /etc/ppp. For the purpose of this document, the only file of critical importance is the pppoe client program. Therefore, we'll just install pppoe by copying it.
$ su
Password:
# cp pppoe /usr/local/bin
#

Now execute pppoe as follows. This detects the presence of any functioning access concentrators, via broadband ADSL modem, that are available through the workstation's ethernet interface, le0.
# /usr/local/bin/pppoe -I/dev/le0 -A
Access-Concentrator: adsl
Got a cookie: e2 6a 40 25 f3 72 5a 1b 59 f8 15 70 d4 0c e8 2d 17 07 00 00
--------------------------------------------------
AC-Ethernet-Address: 00:50:ba:89:7c:e1
--------------------------------------------------
#
If no access concentrators were found, then PPPoE won't work. Low level troubleshooting (Is ADSL modem powered? Is network hub and wiring ok?) would be the next steps. However, if all is well, then continue on.

ptysh2-sysv

The pseudo terminal redirector, ptysh2-sysv, is straight forward to compile and install.
$ cc -o ptysh2-sysv ptysh2-sysv.c
$ su
Password:
# cp ptysh2-sysv /usr/local/bin
#

To execute the redirector, specify a single argument for a device name the redirector will create. The redirector then sets up a symbolic link to a pseudo terminal and attaches it to /bin/sh. Here we will use /dev/pppoe as the device name. All the PPP setup procedures later will reference this device name.
# /usr/local/bin/ptysh2-sysv /dev/pppoe &
# ls -la /dev/pppoe
lrwxrwxrwx   1 root     other         10 Dec 24 18:47 /dev/pppoe -> /dev/pts/1
#
Beware that there may be local workstation security implications by running a root pty redirector that's attached to a root shell.

Next, we test the redirector using the Solaris tip utility:
# tip -9600 /dev/pppoe
connected

# # ^D
Connection Closed
[EOT]
#

The redirector is functioning correctly if tip successfully connects, and we receive a shell prompt after sending a carriage return.

Configuration

The major configuration tasks to use aspppd with PPPoE include first establishing a chat script and then setting up PPP. Once PPP is functioning, additional network setup tasks are necessary to be able to actually use the connection.

The Chat Script

A chat script is normally responsible for controlling a dial-up modem, in order to setup the communications pathways for a PPP data stream. Typically, these scripts incorporate AT modem command strings. For our PPPoE scenario, the basic idea is the same. We use a chat script to interact with the UNIX shell and invoke the pppoe client. This client, in turn, establishes the ethernet communication pathways for PPP.

Solaris ASPPP utilizes UUCP chat. There are several files in /etc/uucp that require configuration. They are:

/etc/uucp/Systems

# name time type class phone login
adsl   Any  p3oe 9600  -     "" P_ZERO "" "" #--# stty\sraw\s-echo;exec\s/usr/local/bin/pppoe\s-I/dev/le0
/etc/uucp/Devices
# type device - speed modemprofile
p3oe   pppoe  - Any   direct
/etc/uucp/Dialers
# modemprofile 801codes chat
direct
We use adsl as the target name to invoke a PPP connection. The main purpose for the script is to execute the UNIX command string:
stty raw -echo;exec /usr/local/bin/pppoe -I/dev/le0
If necessary, the string /dev/le0 may need to be changed to match the device name of your workstation's ethernet interface.

This chat script may be tested as follows:
# chmod 666 /dev/pppoe; cu -d -L adsl
conn(adsl)

Trying entry from '/etc/uucp/Systems' - device type p3oe.
Device Type p3oe wanted
Trying device entry 'pppoe' from '/etc/uucp/Devices'.
processdev: calling setdevcfg(cu, p3oe)
fd_mklock: ok
fixline(6, 9600)
gdial(direct) called
Trying caller script 'direct' from '/etc/uucp/Dialers'.
getto ret 6
expect: ("")
got it
expect: ("")
got it
""
sendthem (^M)
expect: (#)
^M^J#got it
sendthem (stty raw -echo;exec /usr/local/bin/pppoe -I/dev/le0^M)
device status for fd=6
F_GETFL=2,iflag=`12005',oflag=`0',cflag=`2275',lflag=`0',line=`0'
cc[0]=`3',[1]=`34',[2]=`177',[3]=`25',[4]=`1',[5]=`0',[6]=`0',[7]=`0',
call _mode(1)
Connected
_receive started
 # stty raw -echo;exec /usr/local/bin/pppoe -I/dev/le0
transmit started
~ÿ}#À!}!}!} }2}!}$}%Ô}#}$À#}%}&}5}?ðHÚ­~~ÿ}#À!}!}!} }2}!}$}%Ô}#}$À#}%}&}5}?ðHÚ­~~ÿ}#À!}!}!} }2}!}$}%Ô}#}$À#}%}&}5}?ðHÚ~­

call _rcvdead(4)

Lost Carrier
call _bye(16)

Disconnected
call cleanup(4)
call _mode(0)
#
The apparent junk characters are PPP frames, and indicate the chat script and pppoe are definitely working. Another possibility is to encounter a pppoe error message. Finally, you might also encounter an ADSL service access concentrator that doesn't respond at all, because it's waiting for your workstation to start PPP traffic first.

ASPPP Settings

PPP has many parameters which control its operation. In PPPoE configurations, PPPoE itself imposes requirements on PPP settings. These requirements, for both PPP communication directions, are:
The settings which control the operation of aspppd are in configuration file /etc/asppp.cf. The following sample configuration incorporates PPP settings for PPPoE and settings for service access to typical ISPs.

/etc/asppp.cf
ifconfig ipdptp0 plumb 10.1.1.1 10.2.2.2 mtu 1492 up

path
        interface ipdptp0
        peer_system_name adsl
        lcp_mru 1492
        lcp_compression off
        will_do_authentication pap
        pap_id username
        pap_password password
        negotiate_address on
        default_route
        inactivity_timeout 600
        debug_level 8
Configuration keywords important for PPPoE are lcp_compression (ACFC), the absence of ipcp_async_map (ACCM), lcp_mru (MRU), and mtu. Solaris ASPPP does not support alternative FCS and will automatically reject that option.

If the service provider requires CHAP authentication (rather than PAP), change the three lines in /etc/asppp.cf that contain "pap" to:
        will_do_authentication chap
chap_name username
chap_secret password
The descriptions for other configuration keywords, including keywords not mentioned here, are in the man page for aspppd.

Running Aspppd

Work in progress...
text
# /etc/init.d/asppp start
# ifconfig ipdptp0
ipdptp0: flags=8d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1492
        inet 10.1.1.1 --> 10.2.2.2 netmask ff000000
        ether 0:0:0:0:0:0
# ping 10.2.2.2
text
# cd /var/adm/log
# more asppp.log

21:09:34 process_ipd_msg: ipdptp0 needs connection
conn(adsl)
Trying entry from '/etc/uucp/Systems' - device type p3oe.
Device Type p3oe wanted
Trying device entry 'pppoe' from '/etc/uucp/Devices'.
processdev: calling setdevcfg(ppp, p3oe)
fd_mklock: ok
fixline(10, 9600)
gdial(direct) called
Trying caller script 'direct' from '/etc/uucp/Dialers'.
getto ret 10
expect: ("")
got it
expect: ("")
got it
""
sendthem (^M)
expect: (#)
^M^J#got it
sendthem (stty raw -echo;exec /usr/local/bin/pppoe -I/dev/le0^M)
call cleanup(0)
text
21:09:41 002065 ipdptp1916 ppp_diag: PPP DIAG OPEN
21:09:41 002066 ipdptp0 ppp_diag: SEND PPP ASYNC 19 Octets LCP Config-Req  ID=66 LEN=14 MRU=1492 MAG#=2c9fbcd5
21:09:41 002067 ipdptp0 ppp_diag: RECEIVE {Unescaped characters} PPP ASYNC 24 Octets {BAD FCS} {Unrecognized protocol:  820 }
21:09:42 002068 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 23 Octets LCP Config-Req  ID=01 LEN=18 MRU=1492 Auth=PAP MAG#=0319ff20
21:09:42 002069 ipdptp0 ppp_diag: SEND PPP ASYNC 19 Octets LCP Config-Req  ID=67 LEN=14 MRU=1492 MAG#=2c9fbcd5
21:09:42 002070 ipdptp0 ppp_diag: SEND PPP ASYNC 23 Octets LCP Config-ACK  ID=01 LEN=18 MRU=1492 Auth=PAP MAG#=0319ff20
21:09:42 002071 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 19 Octets LCP Config-ACK  ID=67 LEN=14 MRU=1492 MAG#=2c9fbcd5
21:09:42 002072 ipdptp0 ppp_diag: SEND PPP ASYNC 27 Octets AuthPAP Authenticate  ID=01 LEN=22 Peer-ID-Length= 8 Peer-ID: 75 73 65 72 6e 61 6d 65 Passwd-Length= 8 Passwd: 70 61 73 73 77 6f 72 64
21:09:42 002073 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 13 Octets LCP Echo-REQ  ID=00 LEN=8 MAG#=0319ff20 Req_info:
21:09:42 002074 ipdptp0 ppp_diag: SEND PPP ASYNC 13 Octets LCP Echo-REPLY  ID=00 LEN=8 MAG#=2c9fbcd5 Req_info:
21:09:42 002075 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 18 Octets AuthPAP Auth ACK  ID=01 LEN=13 Msg-Length= 8 Login ok
21:09:42 002076 ipdptp0 ppp_diag: SEND PPP ASYNC 21 Octets IP_NCP Config-Req  ID=68 LEN=16 VJCOMP MAXSID=15 Sid-comp-OK IPADDR=0.0.0.0
21:09:42 002077 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 21 Octets IP_NCP Config-Req  ID=01 LEN=16 IPADDR=10.0.0.1 VJCOMP MAXSID=15 Sid-comp-OK
21:09:42 start_ip: IP up on interface ipdptp0, timeout set for 600 seconds
21:09:42 002078 ipdptp0 ppp_diag: SEND PPP ASYNC 21 Octets IP_NCP Config-ACK  ID=01 LEN=16 IPADDR=10.0.0.1 VJCOMP MAXSID=15 Sid-comp-OK
21:09:42 002079 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 15 Octets IP_NCP Config-NACK  ID=68 LEN=10 IPADDR=10.67.15.22
21:09:42 002080 ipdptp0 ppp_diag: SEND PPP ASYNC 21 Octets IP_NCP Config-Req  ID=69 LEN=16 VJCOMP MAXSID=15 Sid-comp-OK IPADDR=10.67.15.22
21:09:42 002081 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 21 Octets IP_NCP Config-ACK  ID=69 LEN=16 VJCOMP MAXSID=15 Sid-comp-OK IPADDR=10.67.15.22
21:09:42 002082 ipdptp0 ppp_diag: SEND PPP ASYNC 89 Octets IP_PROTO


21:09:42 002090 ipdptp0 ppp_diag: SEND PPP ASYNC 89 Octets IP_PROTO
21:09:42 002091 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 89 Octets IP_PROTO
21:09:52 002092 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 13 Octets LCP Echo-REQ  ID=01 LEN=8 MAG#=0319ff20 Req_info:
21:09:52 002093 ipdptp0 ppp_diag: SEND PPP ASYNC 13 Octets LCP Echo-REPLY  ID=01 LEN=8 MAG#=2c9fbcd5 Req_info:


21:13:52 002140 ipdptp0 ppp_diag: RECEIVE PPP ASYNC 13 Octets LCP Echo-REQ  ID=19 LEN=8 MAG#=0319ff20 Req_info:
21:13:52 002141 ipdptp0 ppp_diag: SEND PPP ASYNC 13 Octets LCP Echo-REPLY  ID=19 LEN=8 MAG#=2c9fbcd5 Req_info:
21:13:53 process_ipd_msg: interface ipdptp0 has disconnected
21:13:53 disconnect: disconnected connection from  ipdptp0
21:13:53 002142 ipdptp0 ppp_diag: PPP ASYNC DEVICE HANGUP
21:13:53 002143 ipdptp0 ppp_diag: PPP DIAG CLOSE

Links


  RFC2516 describes the full details of the PPPoE protocol.