Cover V06, I10
Article
Figure 1
Figure 2
Listing 1
Listing 2

oct97.tar


Listing 1: The rc.isdn script

#!/bin/sh
#
# BE SURE TO EDIT THIS FILE BEFORE USING IT !!!!!
# this is an example script to use with isdn4linux
# compiled into kernel
#
# don't forget to edit the files
#     /etc/ppp/pap-secrets or
#     /etc/ppp/chap-secrets
#

# Here are the user configuration items

# Your own ISDN number
LOCAL_NUMBER="505491119"

# The number of your ISP
REMOTE_NUMBER="1234567"

# These numbers are allowed to dial in
DIALIN_NUMBERS="595557057"

# Our local IP address
LOCAL_IP="192.168.1.1"

# Remote IP address (overridden once a connection
# is made
REMOTE_IP="192.168.1.2"

# Name of user dialin at ISP. Should also be present in
# pap-secrets and options file
NLUSER=""

HANGUP=120

DEVOUT="ippp0"
DEVIN="ippp4"

#
# End of configurable parameters (no serviceable parts below this line ;)
#




SYSPATH="/sbin"
TELESCTRL="/usr/sbin/telesctrl"
ISDNCTRL="/usr/sbin/isdnctrl"

# First insert the necessary modules
# Only used with P&P card
#/sbin/insmod slhc
#/sbin/insmod isdn
#/sbin/insmod hisax io0=0x580 io1=0x180 irq=11 type=4 protocol=2 id=MyTeles

#$TELESCTRL Teles 1 4      # enable verbose '4' mode

#
# Settings for the ISDN dialout device
#
$ISDNCTRL addif  $DEVOUT              # Create new interface 'DEVICE'
$ISDNCTRL addphone $DEVOUT out $REMOTE_NUMBER   # Set outgoung phone-number
$ISDNCTRL eaz $DEVOUT $LOCAL_NUMBER            # Set local EAZ ..
$ISDNCTRL l2_prot $DEVOUT hdlc        # for sync PPP: set Level 2 to HDLC
$ISDNCTRL l3_prot $DEVOUT trans       # not required, 'trans' is default
$ISDNCTRL encap $DEVOUT syncppp       # encap the IP Pakets in PPP frames
$ISDNCTRL huptimeout $DEVOUT $HANGUP  # Hangup-Timeout is 600 sec.
$ISDNCTRL chargehup $DEVOUT off       # Hangup before next Charge-Info
$ISDNCTRL secure $DEVOUT on           # Accept only configured phone-number

$SYSPATH/ifconfig $DEVOUT $LOCAL_IP pointopoint $REMOTE_IP metric 1
$SYSPATH/route add default $DEVOUT

$ISDNCTRL pppbind $DEVOUT `echo $DEVOUT | sed -e 's/.*\([0-9]\)/\1/'`

#
# Settings for the ISDN dialin device
#
$ISDNCTRL addif  $DEVIN               # Create new interface 'DEVICE'
#
for num in $DIALIN_NUMBERS
do
$ISDNCTRL addphone $DEVIN in $num   # Set incoming phone-number
done

$ISDNCTRL eaz $DEVIN $LOCAL_NUMBER    # Set local EAZ ..
$ISDNCTRL l2_prot $DEVIN hdlc         # for sync PPP: set Level 2 to HDLC
$ISDNCTRL l3_prot $DEVIN trans   # not really necessary, 'trans' is default
$ISDNCTRL encap $DEVIN syncppp   # encap the IP Pakets in PPP frames
$ISDNCTRL huptimeout $DEVIN $HANGUP   # Hangup-Timeout is 600 sec.
$ISDNCTRL chargehup $DEVIN off        # Hangup before next Charge-Info
$ISDNCTRL secure $DEVIN on            # Accept only configured phone-number

$SYSPATH/ifconfig $DEVIN pppisdn pointopoint ppp-61 metric 1

$ISDNCTRL pppbind $DEVIN `echo $DEVIN | sed -e 's/.*\([0-9]\)/\1/'`

# start the (new) deamon:
# -----------------------
# 'user myusername' : set username to get the right password from the
#    pap/chap-secrets file(s)
# ipcp-accept-local ipcp-accept-remote : accept every IP address
# -vjccomp -ac -pc  : _my_ remote side doesn't support this, so disable it
# -bsdcomp : i4l-syncPPP driver doesn't support bsd-compression
# debug    :  enable debugging, WARNING: ipppd will also log your password
# useifip  : get IP address information form the network interface
# /dev/ippp0 /dev/ippp1 /dev/ippp2 : connect to 3 devices for max.
#     three connections at the same time
#
/usr/sbin/ipppd ipcp-accept-local ipcp-accept-remote \
-vjccomp -ac -pc \
-detach \
mru 1524 \
-bsdcomp \
debug \
#    file /etc/ppp/options.dialout \
user $NLUSER \
/dev/ippp0 /dev/ippp1 &

/usr/sbin/ipppd -vjccomp -ac -pc \
-detach \
mru 1524 \
-bsdcomp \
debug \
useifip \
auth \
file /etc/ppp/options.dialin \
/dev/ippp4 &
# End of File