Setting up a Linux system to establish a PPP connection with CSD.Have the following information available:
Linux PPP Setup Scripts for Use With CSD.NETThese customized scripts are based on "Linux PPP HOWTO" by Robert Hart, hartr@hedland.edu.au and a copy is available from http://www.linux.org/docs/ldp/howto/PPP-HOWTO/index.html. Most distributions also include a copy of this HOWTO with their CD's. These scripts have been tested on an Intel box running RedHat 5.1. Check your paths to the files pppd and chat. They should be in /usr/sbin. If not, modify the scripts below to their correct paths. Many distributions include a graphical setup program for PPP. These programs somewhat automate the creation of these scripts. Due to the many variations, their use is not covered. Please refer to their included documentation. References: Man pages ... pppd, chat, chmod, and the PPP HOWTO. Linux does not use name server IP's sent from CSD.NET like Windows
95 clients do. Edit your /etc/resolv.conf file as follows: Also check that the /etc/host.conf is set up correctly. It should
look like this:
PAP AUTHENTICATIONStep one is to su to root. If you do not have the root password, then your administrator will need to install these scripts. To connect to CSD.NET, five files will be needed. Cut and paste each of these, edit to your settings, and place in /etc/ppp/. Shift-Click here to download a tar/gz archive of the 5 files below. The first file is /etc/ppp/csd-on ... The second file is /etc/ppp/ppp-on-dialer
... The third file is /etc/ppp/options. Edit the LOGIN-NAME
to your value. See the man page of pppd for an explanation of the options. The forth file is /etc/ppp/pap-secrets. Edit
the To log off from CSD.NET, use the fifth file /etc/ppp/ppp-off
: (Shift-Click here to download ppp-off) The next step sets the file permissions of the files. As root, issue these commands: To allow any user to activate the PPP Link, suid as root the file /usr/sbin/pppd. This is needed because the pppd daemon can be run only by root. Programs that run "suid root" are a potential security hole. Many programs are written to minimize this problem (including pppd) so it should be safe. For other options, such as using group permissions, see the HOWTO. As root, issue this command: An optional final touch for ease of use is to add two global aliases to the /etc/bashrc file. This will allow a user to connect to CSD.NET by typing csdon in a xterm window and disconnect by typing csdoff. alias csdon='exec /etc/ppp/csd-on &' That's all! When your ppp-link is up, you can start any of the fine applications available. Steve Grunwald (vian@csd.net) File: /etc/ppp/csd-on ---------------------------------------------------------------------- #!/bin/sh # /etc/ppp/csd-on # # Script to initiate a ppp connection. This is the first part of the # pair of scripts. This is not a secure pair of scripts as the codes # are visible with the 'ps' command. However, it is simple. # # # This is the location of the script which dials the phone and logs # in. Please use the absolute file name as the $PATH variable is not # used on the connect option. (To do so on a 'root' account would be # a security hole so don't ask.) # DIALER_SCRIPT=/etc/ppp/ppp-on-dialer # # Initiate the connection # # Most of the common options are in /etc/ppp/options. Please, don't # forget the 'lock' option or some programs such as mgetty will not # work. The asyncmap and escape will permit the PPP link to work with # a telnet or rlogin connection. You are welcome to make any changes # as desired. Don't use the 'defaultroute' option if you currently # have a default route to an ethernet gateway. # exec /usr/sbin/pppd connect $DIALER_SCRIPT --------------------------------------------------------------------- File: /etc/ppp/ppp-on-dialer
------------------------------------------------------------------
#!/bin/sh
# /etc/ppp/ppp-on-dialer
#
# This is part 2. It dials CSD.NET and will perform the connection
# protocol for the desired connection. This file will not require editing.
#
exec /usr/sbin/chat -v \
TIMEOUT 3 \
ABORT '\nNO DIAL TONE\r' \
ABORT '\nBUSY\r' \
ABORT '\nNO ANSWER\r' \
ABORT '\nRINGING\r\n\r\nRINGING\r' \
'' \rAT \
'OK-+++\c-OK' ATH0 \
TIMEOUT 30 \
OK ATDT3035833000 \
CONNECT
-------------------------------------------------------------------
File: /etc/ppp/options ------------------------------------------------------------------- # /etc/ppp/options # /dev/modem 57600 -detach modem lock crtscts defaultroute domain csd.net user LOGIN-NAME asyncmap 0 -------------------------------------------------------------------- File: /etc/ppp/pap-secrets -------------------------------------------------------------------- # /etc/ppp/pap-secrets # Secrets for authentication using PAP # client server secret IP addresses <username> ppp0 <password> --------------------------------------------------------------------- File: /etc/ppp/ppp-off
---------------------------------------------------------------------
#!/bin/sh
# /etc/ppp/ppp-off
#
# 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
---------------------------------------------------------------
|