MachTen /etc/pppserver Script

MachTen contains a script to help parameterize the execution of /usr/libexec/pppd for PPP server operations. This script contains step-by-step instructions for configuring and executing /etc/pppserver. Be very careful to make sure that the modem is properly configured for receiving incoming phone calls. 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. The /etc/pppserver script is presented below.

#!/bin/sh

# pppserver script, version 1.3

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

# This script is executed as the login "shell" for PPP dialin accounts.

# MachTen PPP dialin instructions:
# 0) Check "Enable IP Forwarding" in the MachTen Controls "Networking" dialog.
# 1) Configure basic dialin access, see /etc/ttys for instructions.
# 2) Edit the /etc/pppserver script, set up the SERVER and CLIENT addresses.
# 3) Always "chmod 755 /etc/pppserver" after editing.
# 4) Give the user "ppp" a password with the "passwd ppp" command.
# At this point, PPP clients should be able to connect.
# Other users can be created using "/etc/pppserver" for a shell to
# allow multiple ppp dialins with different passwords.
# 5) To terminate a PPP connection, "kill" the "pppd" process.

# OPTIONAL: Set the contents of the debug variable to "debug" to enable
# debugging output to the system console.
#DEBUG="yes"

# OPTIONAL: use modem control lines on the serial port
MODEM="yes"

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

# OPTIONAL: Use small mru for better performance on slower lines.
#SMALLMRU="yes"

# REQUIRED: The server's IP Address. This is the client's "gateway".
SERVER=192.83.246.8

# REQUIRED: Set a CLIENT address for each authorized dialin line.
# NOTE: Each dialin line must be enabled in the "/etc/ttys" file.
# Define an actual CLIENT address if the PPP server provides a "dynamic"
# address to the client.
# Define CLIENT="" if the PPP client provides a "static"
# address to the server.
case $TTY in
#/dev/ttya) SMALLMRU="yes"; CLIENT=128.0.0.2 ;; # "modem" port, no flow control
/dev/ttyfa) CLIENT=192.83.246.33 ;; # "modem" port, flow control
#/dev/ttycfa) CLIENT=128.0.0.5;; # "modem", flow control, CD active
#/dev/ttyfb) CLIENT="" ;; # "printer" port, flow control
#/dev/ttycfb) CLIENT=128.0.0.6;; # "printer", flow control, CD active
#/dev/cm.in1) CLIENT=128.0.0.3 ;; # communications toolbox port #1
#/dev/cm.in2) CLIENT=128.0.0.4 ;; # communications toolbox port #2
*) logger -p local2.debug "$0: Unauthorized line: $TTY"; exit 1;;
esac

# REQUIRED: Set a CLIENT address for each authorized PPP dialin account.
# Use CLIENT=$CLIENT if the address is define by line above.
case $USER in
ppp) CLIENT=$CLIENT ;; # user "ppp"
*) logger -p local2.debug "$0: Unauthorized user: $USER"; exit 1 ;;
esac

# insure that a server address has been specified
[ "$SERVER" ] || { logger -p local2.debug "$0: No SERVER address"; exit 1; }

# the debug option is "debug"
[ "$DEBUG" ] && DEBUG="debug"

# The "pppd" sends its debugging output to syslog priority "local2.debug".
[ "$DEBUG" ] && logger -p local2.debug "$0: Debugging PPP dialin $TTY $USER"

# the modem option is "modem"
[ "$MODEM" ] && MODEM="modem"

# Send an echo request to the client 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"

# The "passive" sets server operation.
# The "proxyarp" allows the client to share the server's subnet.
exec pppd $DEBUG passive proxyarp $MODEM $LCPECHO $SMALLMRU $SERVER:$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.