1#!/bin/sh
2#
3# A sample script to establish PPP session(s) via rsh
4#
5# Adi Masputra <adi.masputra@sun.com>
6# Jan 24, 2000
7#
8
9#
10# You'd definitely want to change the following addresses to suit
11# your network configuration
12#
13LOC_IP=10.0.0.1
14REM_IP=10.0.0.2
15NETMASK=255.255.0.0
16
17export LOC_IP REM_IP
18
19#
20# This is the remote peer where in.rshd is running, either
21# its hostname or IP address
22#
23PPPD_RHOST=myremotehost
24
25#
26# For this example, we assume that pppd on both local and remote
27# machines reside in the same place, /usr/local/bin/pppd
28#
29PPPD_LOC=/usr/local/bin/pppd
30
31#
32# The location of local options file (where rsh client is running).
33# Note that the sample options file included in the distribution
34# may need further customizations, depending on your needs. The 'noauth'
35# option specified in the file is there to simplify the example. In
36# reality, you'd probably want to remove such option.
37#
38PPPD_LOC_OPT=/etc/ppp/options-rsh-loc
39
40#
41# The location of remote options file (where in.rshd daemon is running).
42# Note that the sample options file included in the distribution
43# may need further customizations, depending on your needs. The 'noauth'
44# option specified in the file is there to simplify the example. In
45# reality, you'd probably want to remove such option. Also note that
46# the remote options file need to include the 'notty' option for this
47# to work
48#
49PPPD_REM_OPT=/etc/ppp/options-rsh-rem
50
51#
52# The location of rsh client on the local machine
53#
54RSH_LOC=/bin/rsh
55
56export PPPD_LOC PPPD_LOC_OPT PPPD_REM_OPT PPPD_RHOST RSH_LOC
57
58#
59# Uncomment the following to enable IPv6, note that the IPv6 support 
60# needs to be enabled during compilation
61#
62# PPPD_IPV6='+ipv6 ipv6cp-use-ipaddr'
63export PPPD_IPV6
64
65#
66# And execute pppd with the pty option, specifying rsh client as the
67# slave side of the pseduo-tty master/slave pair.
68#
69exec $PPPD_LOC \
70        pty '$RSH_LOC $PPPD_RHOST $PPPD_LOC $REM_IP:$LOC_IP $PPPD_IPV6 file $PPPD_REM_OPT' \
71        $LOC_IP:$REM_IP netmask $NETMASK $PPPD_IPV6 file $PPPD_LOC_OPT
72
73