Configuring Dial-up for Linux ppp

Scripting a Connection

In order to manage a connection to the internet with Linux using this method, you will need the following files:

  • /etc/ppp/options
  • /etc/ppp/ppp-on-dialer
  • /etc/ppp/pap-secrets
  • /usr/sbin/ppp-on
  • /usr/sbin/ppp-off

You can download these files from our ftp server at ftp.kcnet.net/pub/linux and edit them as needed. Also, any of these files can be created in an editor such as Pico. If you create the files yourself, make sure you save them with the proper name and save them to the proper directory as specified above.


The /etc/ppp/options file should simply contain the following:

asyncmap 20A0000
crtscts
defaultroute
escape FF
lock
modem
netmask 255.255.255.0
noipdefault
debug
kdebug 0
user username@kcnet.come

Replace "username@kcnet.com" with your assigned KCnet username. 


The /etc/ppp/ ppp-on-dialer file should look as follows:

exec chat -v \
TIMEOUT 3 \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
'OK-+++\c-OK' ATH0 \
TIMEOUT 30 \
OK ATDT8165550000* \
CONNECT

*Replace the 8165550000 with the your "assigned access number".


The /etc/ppp/pap-secrets file should look as follows:
 

# Secrets for authentication using PAP 
# client       server      secret   IP addresses 
username@kcnet.com  *        
password

Replace username@kcnet.com with your assigned KCnet username and password with you KCnet password. Remember, your KCnet username and password are case sensitive. Put a star under the server entry to ensure that you will be able to connect to any of our access servers.


The /usr/sbin/ppp-on file should look as follows:
#!/bin/sh 
exec /usr/sbin/pppd /dev/cua1 115200

Replace "/dev/cua1 115200" with you correct modem and port speed.


Finally, here is how the file /usr/sbin/ppp-off should look:

#!/bin/sh
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
DEVICE=ppp0
else
DEVICE=$1
fi
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
kill -INT `cat /var/run/$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 /var/run/$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

  • To initiate your connection type "/sbin/ppp-on" from the command line.
  • To terminate your connection type "/sbin/ppp-off" from the command line.

 

Support Home

 

© 2000 KCnet, Inc.   All rights reserved. Terms of Service