Set up PPP and SLIRP (Solaris)


Modem Connection with PPP
Terminal Connection with slirp or pppd
PAP with PPP to authenticate to the peer
Connection Script
PAP with slirp (talking PPP) or pppd to require the peer to authenticate
Script to turn off PPP

 

Setup Solaris for PPP modem connection

Launch admintool and select a port a to use pppd for a modem dial out. To see the screen shot of the settings, click here (9kB).


Setup Solaris for Slirp terminal connection

Launch admintool and select a port a to use slirp for a direct terminal connection . To see the screen shot of the settings, click here (10kB). Create a .slirp file in your home directory e.g:

ppp
baudrate 38400
mtu 1500
mru 1500
asyncmap FFFFFFFF
compress
ppp_exit

To use ppp instead of slirp, just change the "service" filed to /usr/local/bin/pppd and store the settings in the .ppprc file in your home directory e.g:

/dev/term/a
38400
<local_IP>:<remote_IP>
lock
crtscts
mru 1500
mtu 1500
asyncmap FFFFFFFF


How to enable PAP with pppd to authenticate to the peer

All you have to do is to add this line to the file /etc/ppp/pap-secrets (create it if it doesn't exist):

<username> * <password>

<username> is your login name and <password> the password you have received from your provider. The star indicates that pppd does not check the IP address of the provider.
pppd sends the PAP authentication automatically if the provider asks for it, to tell pppd which secret to use (you MUST to specify this option even if you have only one secret (one line in your pap-secrets file) ) add this:

user <username>

You don't need to specify +pap this is used to have the peer authenticate itself not to authenticate yourself to the peer.

This is my complete call for pppd:

pppd /dev/ttyb 19200 lock crtscts user <username> asyncmap FFFFFFFF noipdefault defaultroute connect $DIALER_SCRIPT

If you use ppp already for a terminal connection, you have to be aware of the fact the pppd always reads the configfile first and then the command line! Maybe you need to move the .ppprc file temporary.


Connection script to automate connection procedure

#!/bin/sh
 
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
 
exec chat -v \
 
TIMEOUT 5 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
"" ATZ \
TIMEOUT 30 \
OK ATDT<provider_phone_number> \
CONNECT \
< /dev/ttyb > /dev/ttyb


Enable PAP with slirp (talking PPP) or pppd to require the peer to authenticate

All you have to do is to add this line to the file ~/.pap-secrets (create it if it doesn't exist):

<username> * <password>

<username> is the login name and <password> the password you have to enter. Then you have to add the option +pap to your .slirp file. If you want to use an encrypted password, you need to add the option papencrypt to your .slirprc file this would look like this:

ppp
baudrate 38400
asyncmap FFFFFFFF
mtu 1500
mru 1500
crtscts
ppp_exit
+pap
papcrypt


To require the peer to authenticate on a ppp connection, just add the line: <username> * <password> to this file: /etc/ppp/pap-secrets (create it if it doesn't exist) and add the +pap option to your .ppprc file. If you want to use an encrypted password add papcrypt as well.

Script to turn off PPP

!/bin/sh
 
DEVICE=ppp0
######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
#
######################################################################
 
if [ -r /etc/ppp/$DEVICE.pid ]; then
  kill -INT `cat /etc/ppp/$DEVICE.pid`
 
# If the kill did not work then there is no process running for this pid.
# It may also mean that the lock file will be left. You may wish to delete
# the lock file at the same time.
 
  if [ ! "$?" = "0" ]; then
    rm -f /etc/ppp/$DEVICE.pid
    echo "ERROR: Removed stale pid file"
    exit 1
  fi
 
# Success. Let pppd clean up its own junk.
  echo "PPP link to $DEVICE terminated."
  exit 0
fi
 
# The ppp process is not running for ppp0
 
echo "ERROR: PPP link is not active on $DEVICE" exit 1



Home | About Me | TI-Stuff | Unix-Stuff | C3-Camp | Jokes