Guideline to make ISDN work on Linux for World Access WXS


1. Introduction, Scope of this Guideline

This page describes how to setup your linux system to connect to World-Access WXS via ISDN.
It uses:

Using ISDN on World Access PLANET INTERNET means you have to setup your system to use dynamic IP addressing and CHAP for authority/access the verification procedure.
There are many ways you can configure your system. This is just one, and the only thing I can say is that it works fine with me and I hope it will do for you too.

Usefull references are: The Paul Slootman presentation and his HOWTO page
Here Paul describes how and where to get the correct patches for your kernel. This is important because on, for example, 2.0.30 it just doesn't work at all.
Also on http://www.sfs.nphil.uni-tuebingen.de/~hipp/isdn/isdn.html you can find usefull information.
And, of course, on the Gert-Jan Groen Nederlandse Homepage


Suggestions for improvement are always welcome. Mail me at: j.ploeg@planet.nl

2. This Example

The example files below are from my system. It might be handy to know the following when you try to read them:

3. Some files

To make things work you should, apart from building ISDN in your kernel and installing the isdn4linux utillity package, put a couple of configuration files and scripts on your system.

3.1 /usr/sbin/isdn-ppp-on

This isdn-ppp-on script will initialize everything necessary to start a ppp connection to World Access PLANET INTERNET, but it won't dial until you actually try to connect to something that requires a connection. So running this script won't start the cash-flow to PTT, but as soon as you do something simple as 'ping' it will call and then you start paying...
The script goes in /usr/sbin and should be executable (chmod +x)
    
    case $# in
    0 ) REMOTE=amf
        DEVICE=ippp0
        ;;
    1 ) REMOTE=$1
        DEVICE=ippp0
        ;;
    2 ) REMOTE=$1
        DEVICE=$2
        ;;
    * ) echo "usage:  isdn-ppp-on []   (amf is default)"
        exit
    esac
    
    echo $REMOTE
    
    
    set -x
    
    case $REMOTE in
    amf ) REMIP=193.172.250.17	# amersfoort
          REMMSN=0334645333	        # DN of amersfoort
          REMNAME=amf-isdn
          ;;
    * )   echo "usage:  isdn-ppp-on []   (amf is default)"
          exit
    esac
    
    
    MYUSER=ppp:jvdploe
    #MYIP=10.0.0.0		# dummy IP numbers
    MYIP=0.0.0.0		# dummy IP numbers
    MYMSN=356233608		# our MSN number, dial-out MSN for ppp
    
    
    PATH=$PATH:/sbin
    
    isdnlog -w10 -m5623 -l1527  /dev/isdnctrl0 < /dev/console > /dev/console 2>&1 &
    #isdnctrl verbose 4 
    isdnctrl verbose 0
    
    isdnctrl addif $DEVICE
    isdnctrl eaz $DEVICE $MYMSN
    isdnctrl addphone $DEVICE out $REMMSN
    isdnctrl huptimeout $DEVICE 180 # dynamic IP dus niet zo snel ophangen
    isdnctrl callback $DEVICE 'off'
    isdnctrl l2_prot $DEVICE 'hdlc'
    isdnctrl l3_prot $DEVICE 'trans'
    isdnctrl encap $DEVICE syncppp
    
    ifconfig $DEVICE $MYIP pointopoint $REMIP
    
    route add $REMIP $DEVICE
    route add default gw $REMIP metric 1
    #route add default $DEVICE
    ifconfig $DEVICE -arp -broadcast
    
    ipppd user $MYUSER $MYIP:$REMIP \
    	remotename $REMNAME     \
    	noipdefault		\
    	ipcp-accept-local	\
    	ipcp-accept-remote	\
    	-vj                     \
    	-vjccomp -ac -pc        \
    	-detach                 \
    	mru 1500 mtu 1500       \
    	-bsdcomp                \
    	defaultroute		\
    	/dev/$DEVICE
    
    
    # note on debugging: use it only when debugging, since it produces
    # loads of data in no-time
    

3.2 /usr/sbin/isdn-ppp-off

This script, isdn-ppp-off, will break down the connection, if there was any. When you run this script, you won't be able to contact the outside wold anymore (meaning, a 'ping' will fail saying that the network is down).
The script goes in /usr/sbin and should also be executable.
    
    
         case $# in
         0 ) REMOTE=amf
             DEVICE=ippp0
             ;;
         1 ) REMOTE=$1
             DEVICE=ippp0
             ;;
         2 ) REMOTE=$1
             DEVICE=$2
             ;;
         * ) echo "usage:  isdn-ppp-on []   (amf is default)"
             exit
         esac
    
         echo $REMOTE
    
    
         set -x
    
         case $REMOTE in
         amf ) REMIP=193.172.250.17      # amersfoort
               REMMSN=0334645333         # DN of-amersfoort
               REMNAME=amf-isdn
               ;;
         * )   echo "usage:  isdn-ppp-on []   (amf is default)"
               exit
         esac
    
    
    
    MYUSER=ppp:jvdploe
    MYIP=0.0.0.0		# dummy IP numbers
    MYMSN=356233608		# our MSN number, dial-out MSN for ppp
    
    
    PATH=$PATH:/sbin
    
    isdnctrl hangup $DEVICE
    sleep 1
    killall -KILL ipppd
    route del default
    route del $REMIP
    ifconfig $DEVICE down
    isdnctrl delif $DEVICE
    
    

3.5 /etc/ppp/chap-secrets

This file 'chap-services' is used by the chap security-check procedure to verify you're really you etc... It needs two entries for each server, one for the each direction. (Your system to Server and Server to You).
In the example below you see I have both the entry for PLANET INTERNET in Amersfoort.
The name of the 'client' must he the same as your hostname (in this case jvdploe) and it will be used as the 'username' to the provider.
Needless to say that "IAMNOTTHATSTUPID" should be replaced by the real password.
One important note: don't use spaces in this file, just 1 (ONE!!!) tab between the fields. Also, put """" around the password to prevent problems in case your really have a fancy password.
    
    # Secrets for authentification using CHAP
    # client          server             secret       IP addresses
    #
    # default
    #
    "*"	jvdploe	""
    jvdploe	"*"	"IAMNOTTHATSTUPID"
    
    
    

3.6 /etc/hosts

The only important thing about this file is that 'jvdploe.planet.nl' should have 10.0.0.0 (dummy)address. The result will be that ipppd will do dynamic IP procedure, which is exactly what we want. The 127.0.0.0 is the default loopback entry. This is all you need. (but do change 'jvdploe' to your own systems name of course).
    
    #
    # hosts		This file describes a number of hostname-to-address
    #		mappings for the TCP/IP subsystem.  It is mostly
    #		used at boot time, when no name servers are running.
    #		On small systems, this file can be used instead of a
    #		"named" name server.  Just add the names, addresses
    #		and any aliases to this file...
    #
    # By the way, Arnt Gulbrandsen  says that 127.0.0.1
    # should NEVER be named with the name of the machine.  It causes problems
    # for some (stupid) programs, irc and reputedly talk. :^)
    #
    
    # For loopbacking.
    127.0.0.1	localhost
    # For Planet Internet, World Access
    10.0.0.0	 	jvdploe.planet.nl jvdploe
    
    # Dial-in servers
    193.172.250.17	amf-planet
    145.220.128.1	ams-isdn
    145.220.129.1	utr-isdn
    
    # the rest is for Lucent only
    #
    # Lucent
    135.85.68.46	hvss152.nl.lucent.com	hvsse01
    135.85.68.3	hvsse01.nl.lucent.com	hvsse01
    135.85.50.2	hvlts2.nl.lucent.com	hvlts2
    
    # Lucent proxy
    192.11.224.97	nl.proxy.lucent.com	proxy
    # Lucent www servers
    135.1.27.64	www-gpn.ih.lucent.com	ihgpwww
    135.85.70.245	www-gpn-hv.nl.lucent.com	hvssa03
    # End of hosts.
    
    

3.7 /etc/resolv.conf

This file contains the IP addresses of the World-Access PLANET nameservers. The domain name should be planet.nl, and your full hostname (hostname -f) is jvdploe.planet.nl.
    
    search planet.nl
    nameserver 195.121.1.34
    nameserver 195.121.1.66
    
    # the rest is for lucent only
    
    # nl.lucent.com nameservers
    nameserver 135.85.68.2     ; Try hvssa01
    nameserver 135.85.64.2     ; Next Try hvscg01
    nameserver 135.85.64.148   ; Last try hvsag01
    
    # ih.lucent.com nameservers
    nameserver 135.1.13.222  ; ihdns.lucent.com
    nameserver 135.1.1.5     ; ihang.lucent.com
    nameserver 135.1.1.150   ; ipcia.lucent.com
    
    

3.8 /etc/HOSTNAME

The contents of /etc/HOSTNAME:
    
    jvdploe.planet.nl
    

3.9 /etc/inittab

I added this line:
    
    i1:45:respawn:/usr/local/sbin/mgetty -n1 -D -m '"" ATZ OK AT&E356233809 OK AT&B512 OK' -s 38400 ttyI1
    
This has nothing to do with the ppp-connection, but with setting up a getty process on one of the MSN numbers (356233809 in this case). It might come in handy to debug your connection, and to dial into your own computer from somewhere else.

3.10 /etc/ppp/ip-up

This ip-up script will be executed once the ppp network is up. On my system I have:
    
    #!/bin/bash
    #echo "`date` ip-up: $*" >> /var/log/ip-logging
    sendmail -q
    pop.all		# this pops all my mailboxes
    

3.11 /etc/ppp/ip-down

This ip-down script will be executed when the ppp network goes doen On my system I have:
    
    #!/bin/bash
    #echo "`date` ip-down: $*" >> /var/log/ip-logging
    /sbin/route add default ippp0
    
Adding a new default route is necessary because ipppd will delete the default on the disconnect.

3.12 sendmail.cf

To make your e-mail working, make sure that sendmail.cf has this line:
    
    DSmail.planet.nl
    
(it's probably empty on your system....)

4. Connect procerdure

Once you have installed all this and built ISDN into your kernel it is time to connect to the the provider.
The procedure is:
First run:
/usr/sbin/isdn-ppp-on &   
++ REMIP=193.172.250.17
++ REMMSN=0334645333
++ REMNAME=amf-isdn
++ MYUSER=ppp:jvdploe
++ MYIP=10.0.0.0
++ MYMSN=356233608
++ PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11/bin:/usr/andrew/bin:/usr/openwin/bin:/usr/games:.:/usr/local/netscape/rvplayer5.0b1:/usr/local/netscape:/usr/X11/bin:/usr/andrew/bin:/usr/openwin/bin:/usr/games:.:/usr/local/netscape/rvplayer5.0b1:/usr/local/netscape:/sbin
++ isdnlog -w10 -m5623 -l1527 /dev/isdnctrl0
++ isdnctrl verbose 0
Verbose-level set to 0.
++ isdnctrl addif ippp0
ippp0 added
++ isdnctrl eaz ippp0 356233608
EAZ/MSN for ippp0 is 356233608
++ isdnctrl addphone ippp0 out 0334645333
++ isdnctrl huptimeout ippp0 180
Hangup-Timeout for ippp0 is 180 sec.
++ isdnctrl callback ippp0 off
Callback for ippp0 is off
++ isdnctrl l2_prot ippp0 hdlc
Layer-2-Protocol for ippp0 is hdlc
++ isdnctrl l3_prot ippp0 trans
Layer-3-Protocol for ippp0 is trans
++ isdnctrl encap ippp0 syncppp
Encapsulation for ippp0 is syncppp
++ ifconfig ippp0 10.0.0.0 pointopoint 193.172.250.17
++ route add 193.172.250.17 ippp0
++ route add default gw 193.172.250.17 metric 1
++ ifconfig ippp0 -arp -broadcast
++ ipppd user ppp:jvdploe 10.0.0.0:193.172.250.17 remotename amf-isdn noipdefault ipcp-accept-local ipcp-accept-remote -vj -vjccomp -ac -pc -detach mru 1500 mtu 1500 -bsdcomp defaultroute /dev/ippp0


This will set ipppd ready to run, but no call is being made yet!
Now do 'something' to access the network. This will trigger the system to actually make a call.
Example:
jvdploe:/usr/sbin# ping www.planet.nl
PING www.planet.nl (145.220.3.44): 56 data bytes
64 bytes from 145.220.3.44: icmp_seq=0 ttl=251 time=99.2 ms
64 bytes from 145.220.3.44: icmp_seq=1 ttl=251 time=97.5 ms
64 bytes from 145.220.3.44: icmp_seq=3 ttl=251 time=102.7 ms

--- www.planet.nl ping statistics ---
4 packets transmitted, 3 packets received, 25% packet loss
round-trip min/avg/max = 97.5/99.8/102.7 ms

5. Monitoring what's going on

When you do the 'isdn-ppp-on' command the following will happen in your '/var/log/messages' file:
Nov 19 23:07:12 jvdploe kernel: isdn: Verbose-Level is 0
Nov 19 23:07:12 jvdploe syslog: info: auth check for hostname=jvdploe 
Nov 19 23:07:12 jvdploe syslog: info: auth check for user=ppp:jvdploe 
Nov 19 23:07:12 jvdploe syslog: info: auth check for our_name=jvdploe 
Nov 19 23:07:12 jvdploe syslog: info: no PAP secret entry for this user! 
Nov 19 23:07:12 jvdploe ipppd[422]: Found 1 devices: /dev/ippp0, 
Nov 19 23:07:12 jvdploe isdnlog: Another isdnlog is running with pid 88! 
Nov 19 23:07:12 jvdploe isdnlog: exit now 37 
Nov 19 23:07:12 jvdploe ipppd[422]: ipppd i2.2.9 (isdn4linux version of pppd by MH) started
Nov 19 23:07:12 jvdploe ipppd[422]: init_unit: 0 
Nov 19 23:07:12 jvdploe ipppd[422]: Connect[0]: /dev/ippp0, fd: 6


Once you try to access your network (the 'ping') and the system starts calling out, the following will be added to the file:
Nov 19 23:07:52 jvdploe kernel: ippp0: dialing 0 0334645333...
Nov 19 23:07:53 jvdploe kernel: isdn_net: ippp0 connected
Nov 19 23:07:53 jvdploe ipppd[422]: PHASE_WAIT -> PHASE_ESTABLISHED, ifunit: 0, linkunit: 0, fd: 6
Nov 19 23:07:57 jvdploe ipppd[422]: Remote message: 
Nov 19 23:07:57 jvdploe ipppd[422]: bundle, he: 0 we: 0
Nov 19 23:07:57 jvdploe ipppd[422]: local  IP address 195.121.17.16
Nov 19 23:07:57 jvdploe ipppd[422]: remote IP address 193.172.250.17


You can also check the ifconfig:
jvdploe:~# ifconfig
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0
          TX packets:12 errors:0 dropped:0 overruns:0

ippp0     Link encap:Point-Point Protocol  
          inet addr:195.121.17.16  P-t-P:193.172.250.17  Mask:255.0.0.0
          UP POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:140 errors:0 dropped:0 overruns:0
          TX packets:130 errors:0 dropped:0 overruns:0



And you can check the route -n:
jvdploe:~# route -n
Kernel routing table
Destination     Gateway         Genmask         Flags MSS    Window Use Iface
193.172.250.17  *               255.255.255.255 UH    1500   0        0 ippp0
127.0.0.0       *               255.0.0.0       U     3584   0        1 lo
default         193.172.250.17  *               UG    1500   0       10 ippp0


6. Disconnect procedure

To go onhook (disconnect) issue the command:
jvdploe:/usr/sbin# isdn-ppp-off
utr
++ REMIP=193.172.250.17
++ REMMSN=0334645333
++ REMNAME=amf-isdn
++ MYUSER=ppp:jvdploe
++ MYIP=10.0.0.0
++ MYMSN=356233608
++ PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11/bin:/usr/andrew/bin:/usr/openwin/bin:/usr/games:.:/usr/local/netscape/rvplayer5.0b1:/usr/local/netscape:/usr/X11/bin:/usr/andrew/bin:/usr/openwin/bin:/usr/games:.:/usr/local/netscape/rvplayer5.0b1:/usr/local/netscape:/sbin
++ isdnctrl hangup ippp0
ippp0 hung up
++ sleep 1
++ killall -KILL ipppd
++ route del default
++ route del 145.220.129.1
SIOCDELRT: No such process
++ ifconfig ippp0 down
++ isdnctrl delif ippp0
ippp0 deleted
[1]+  Exit 137                isdn-ppp-on



In the '/var/log/messages' file you'll see:
Nov 19 23:11:09 jvdploe kernel: isdn_net: local hangup ippp0
Nov 19 23:11:09 jvdploe kernel: ippp0: Chargesum is 0
Nov 19 23:11:09 jvdploe ipppd[422]: Modem hangup
Nov 19 23:11:09 jvdploe ipppd[422]: Connection terminated.
Nov 19 23:11:09 jvdploe ipppd[422]: taking down PHASE_DEAD link 0, linkunit: 0
Nov 19 23:11:09 jvdploe ipppd[422]: link 0 closed , linkunit: 0
Nov 19 23:11:09 jvdploe ipppd[422]: reinit_unit: 0 
Nov 19 23:11:09 jvdploe ipppd[422]: Connect[0]: /dev/ippp0, fd: 6
Nov 19 23:11:09 jvdploe kernel: isdn: ^A,ch0 cause: E0010


SLIRP users only....

If you don't know what this is, don't worry....

The contents of /usr/local/bin/slirp.on is:

#!/bin/bash
echo "Starting SLIRP on hvss152 - will take 60 seconds....please wait"
echo "rlogin hvss152 -l jvdploe" > /dev/modem
case $# in
1 ) echo "no sleep" ;;
* ) sleep 60
esac
echo "Starting remote slirp process now"
echo "slirp" > /dev/modem
sleep 2
echo "Starting local pppd process now"


echo "route add -net 135.0.0.0 netmask 255.0.0.0 ppp0"
echo "route add -net 10.0.0.0 netmask 255.0.0.0 ppp0"
echo "pppd  -detach  mru 552 10.0.67.0: /dev/modem"

pppd  -detach  mru 552 10.0.67.0: /dev/modem  &
sleep 3
route add 192.11.224.97 ppp0
route add -net 135.0.0.0 netmask 255.0.0.0 ppp0
route add -net 10.0.0.0 netmask 255.0.0.0 ppp0

echo
echo
echo "Press  ENTER  to terminate connection"
read dummy

ppp-off

echo "Terminating slirp"
sleep 2
echo "000000" > /dev/modem
echo > /dev/modem
echo "000000" > /dev/modem
echo "Slirp connection terminated - seyon terminal is available again"