MachTen /etc/pppclient Script
MachTen contains a script file /etc/pppclient used to make the usage for /usr/libexecpppd for PPP client operations a smoother process. This script is used to the /usr/libexec/pppd with appropriate parameterization to: Other parameters for debug print out, packet (MRU) sizing are also available for specification.

Be very careful to make sure that the modem is properly configured. See Modem Configuration for more information. Also make sure that Macintosh-to-modem cabling is properly configured to match the selection of the MachTen Serial Device File. See MachTen Baud Rates and GPi Serial Cabling for more information.

Unfortunately, mis-configuration of any of these characteristics will lead to partially successful operation and, at the same time, will also lead to data loss during large transfers resulting in retranssion and apparent "slow" link utilization. Mis-configuration can also lead to intermittent resets of an operational link which is apparently receiving data at good effective data rates. Some of these mis-configurations are presented in MachTen Modem Interfacing. Enclosed below is the current version of /etc/pppclient:

#!/bin/sh

# pppclient script, version 1.4

PATH="$PATH:/usr/libexec:/usr/etc:/usr/bin:/usr/ucb:/sbin:/usr/sbin"
export PATH

# MachTen PPP dialout instructions:
# 1) Configure basic dialout access, see /etc/remote for instructions.
# 2) Edit the "/etc/pppclient" script, setup the LINE and PPPLOGIN parameters.
# 3) Always "chmod 755 /etc/pppclient" after editing.
# 4) Execute the "/etc/pppclient" script to establish a PPP connection.
# 5) To terminate a PPP connection, "kill" the "pppd" process.

# Note: Run pppclient with an argument of "debug" to enable debugging output.

# Note: To enable the pppclient script to be called at boottime,
# call it from the /etc/rc.local script.

# REQUIRED: Set the LINE device.
# This should be the same device that was configured in step #1.
#LINE="/dev/ttyfa 50" # "modem" port, 14400 baud, hardware flow control
#LINE="/dev/ttyfa 19200" # "modem" port, 19200 baud, hardware flow control
#LINE="/dev/ttyfa 75" # "modem" port, 28800 baud, hardware flow control
#LINE="/dev/ttyfa 38400" # "modem" port, 38400 baud, hardware flow control
#LINE="/dev/ttyfa 110" # "modem" port, 56700 baud, hardware flow control
LINE="/dev/ttyfa 134" # "modem" port, 115200 baud, hardware flow control
#LINE="/dev/ttycfa 134" # "modem" port, 115200 baud, hardware flow control, CD
#LINE="/dev/cm.out1" # communications toolbox port #1

# REQUIRED: The chat "script" negotiates the server login. Use "tip" for a
# manual login to determine the actual sequence required by the server from
# step #1.
# A chat script consists of pairs of strings: <match this> <send this>.
# See the manual page for the "chat" program for more detailed specifications.
# In the example, the user name is "ppp" and the password is "FooBar".
# The first "" "" sends a RETURN to wake up the server if needed.
# The "ogin:" matches the usual "Login:" prompt. Reply with user name "ppp".
# The "word:" matches the usual "Password:" prompt. Reply with "FooBar".
PPPLOGIN=/etc/ppplogin
echo >$PPPLOGIN
chown root $PPPLOGIN
chmod 700 $PPPLOGIN

# This example assumes direct access to the modem via /dev/ttyfa.
# The at&f1 prepares SupraFax modem for hardware flow control.
# &f1 = \N3, &K3, &Q5, &D0
# \N3 and &Q5 setup autoreliable, compression
# &K3 enable bidirection hardware flow control
# &D0 Ignore DTR - IMPORTANT!
# The atdt17085551212dials 1-708-555-1212.

cat >$PPPLOGIN <<'@EOF@'
"" at&f1&d0
OK atdt17085551212
CONNECT "\d\d"
ogin: "\duser"
word: "\dPassword"
.... "\d\d\d\d"
@EOF@

# This example is when you use the communications toolbox to dial out.

#cat >$PPPLOGIN <<'@EOF@'
#"" ""
#ogin: ppp
#word: FooBar
#@EOF@

# This example assumes direct access to the modem via /dev/ttyfa.
# The at&f1 prepares the modem for hardware flow control.
# The atdt17085551212 dials 1-708-555-1212.

#cat >$PPPLOGIN <<'@EOF@'
#"" at&f1&d0
#OK atdt17085551212
#CONNECT ""
#ogin: ppp
#word: FooBar
#@EOF@

# Set CLIENT address if client provides a "static" address to the server.
# You may have to specify the server address as well.
# Ask your PPP server's administrator.
#CLIENT="128.0.0.2"
CLIENT=""
SERVER=""

# OPTIONAL: ping a known host to detect disconnect, use "-" for the server.
# NOTE: This is a good thing to do on a 680X0 Macintosh.
#PING="-"

# OPTIONAL: restart ppp whenever it disconnects.
# NOTE: If you start ppp from /etc/rc.local, you probably want this too.
#PERSIST="yes"

# OPTIONAL: use lcp-echo to detect disconnect
# NOTE: Not all PPP servers support lcp-echo!
#LCPECHO="yes"

# OPTIONAL: Use small mru for better performance on slower lines.
# NOTE: This depends on the modems, line quality, etc...
#SMALLMRU="yes"

# OPTIONAL: Use the modem control lines.
# NOTE: Only a server would be interested.
#MODEM="yes"

############# DON'T CHANGE ANYTHING ELSE BELOW HERE ##########################

# Generate debugging output if the first argument is "debug".
# The "pppd" sends its debugging output to syslog priority "local2.debug".
# The "chat" sends its debugging output to syslog priority "local2.info".
case $1 in
debug)
PPPD_DEBUG="debug"
CHAT_DEBUG="-v"
echo "$0: Debug Enabled"
;;
*)
PPPD_DEBUG=""
CHAT_DEBUG=""
;;
esac

# Insure that LINE has been set.
[ "$LINE" ] || { logger -p local2.debug "$0: No LINE device"; exit 1; }

# Insure that PPPLOGIN exists.
[ -r $PPPLOGIN ] || { logger -p local2.debug "$0: No PPPLOGIN script"; exit 1; }

# If a static client address is used, insert the trailing ':'.
[ "$CLIENT" ] && CLIENT=$CLIENT:$SERVER

# Ping a known host to detect connection failure.
[ "$PING" ] && PING="ping $PING"

# Send an echo request to the server every 30 seconds.
# Hangup after 10 failures (5 minutes).
[ "$LCPECHO" ] && LCPECHO="lcp-echo-interval 30 lcp-echo-failure 10"

# Set MRU to 296 for slower lines.
[ "$SMALLMRU" ] && SMALLMRU="mru 296"

# Set modem flag to use modem control lines.
[ "$MODEM" ] && MODEM="modem"

# Restart ppp whenever it disconnects.
[ "$PERSIST" ] && PERSIST="persist"

# The "defaultroute" set the server as the client's "gateway".
/usr/libexec/pppd \
$PPPD_DEBUG \
defaultroute \
$PING \
$PERSIST \
$LCPECHO \
$SMALLMRU \
$MODEM \
connect "chat $CHAT_DEBUG -f $PPPLOGIN" \
$LINE \
$CLIENT

| Tenon Home | Products | Order | Contact Us | About Tenon | Register | Tech Support | Resources | Press Room | Mailing Lists |

Powered By iTools

Copyright©2009 Tenon Intersystems, 232 Anacapa Street, Santa Barbara, CA 93101. All rights reserved.
Questions about our website - Contact: webmaster@tenon.com.