NetBSD Documentation: Steps to connect via ISDN

Steps to connect via ISDN


Steps to connect via ISDN

Introduction (top)

NetBSD has integrated ISDN support. The ISDN subsystem is based on the ISDN4BSD project, but beware that some names and paths changed if you look at generic ISDN4BSD documentation.

It is easy to connect your NetBSD system to your ISP via ISDN. This document is a short walk-through the necessary steps, assuming:

There are lot of different configurations possible, if you need them, read the man pages and have a look at the ISDN4BSD documentation The Care and Feeding of ISDN4BSD. It describes several setups and explains lots of debugging tricks and has background information.

There also is the ISDN4BSD FAQ.

Adjust your kernel (top)

Before you can use ISDN, you have to add support for it to your kernel config file, create a new kernel and install it.

Have a look at src/sys/arch/i386/conf/GENERIC_ISDN for supported ISDN cards on PCI, ISA, ISAPNP, or PCMCIA busses (even if not running on i386), or at src/sys/arch/amiga/conf/ISDN for supported Amiga Zorro-bus boards. You need to pick the attachment for your isdn card and probably a corresponding option too. Some drivers support a lot of very different cards and compiling support for all this cards into the kernel increases its size. So you can, for those drivers, select which support to compile into it by selecting appropriate options. Additionally you need the global ISDN devices isdn, isdnctl, and ippp. The later needs a count; if this is your only ISDN connection, specifying a 1 will do.

Create and populate /etc/isdn (top)

You need to create the directory /etc/isdn. Look at the example files in /usr/share/examples/isdn and copy the appropriate holidays and isdnd.rates files (with exactly that names, the examples have slightly different names) to /etc/isdn.

If, for example, you happen to live in Germany, Schleswig-Holstein, you copy holidays.D.SH from /usr/share/examples/isdn as holidays to /etc/isdn and isdnd.rates.D to isdnd.rates. If you, or your PTE, does not care about holidays, an empty holidays file will be enough. If you don't use rate base charging calculation, an empty isdnd.rates file will be enough too.

For starters, if you just want to get it going and there are no appropriate files for your ISDN connection, just create empty files.

Create an /etc/isdn/isdnd.rc file (top)

It is assumed you want a single connection to your ISP for now. This will be made using the "ippp0" (ISDN ppp) device. Create an isdnd configuration file /etc/isdn/isdnd.rc with the following contents:

system
ratesfile	= /etc/isdn/isdnd.rates	# name and location of rates file
entry
name			= world  # arbitrary name for this entry
usrdevicename		= ippp
usrdeviceunit		= 0
ppp-auth-paranoid	= no
ppp-send-auth		= pap                   # maybe "chap" instead
ppp-send-name		= "MY-LOGIN-NAME"       # replace by your data
ppp-send-password	= "MY-SECRET-PASSWORD"  # replace by your password
isdncontroller  	= 0
isdnchannel		= -1
direction		= out
local-phone-dialout	= XXXXX    # your own phone number
remote-phone-dialout	= XXXXX    # number of your provider
remdial-handling	= first
dialin-reaction		= reject
dialout-type		= normal
b1protocol		= hdlc
unitlength		= 0
unitlengthsrc           = conf
idletime-outgoing	= 1000
earlyhangup		= 0
dialretries		= 5
dialrandincr		= on
recoverytime		= 2
usedown			= off
downtries		= 2
downtime		= 30

This variant is for a flat rate connection, if this does not apply to you, you definitely will want to review the timing parameters later. But let us get this working first.

The things you have to fill in in the above config file are:

ppp-send-auth
This is either "pap" or "chap". Your provider usually tells you, or you can use trial and error. The ISDN4BSD FAQ shows a method to interpret debug output to find out what your provider expects.
ppp-send-name
The login your provider gave you. This may have special characters in it (like "#"), so better put it into double-quotes.
ppp-send-password
The password your provider gave you. Double quoting is a good idea, see above.
local-phone-dialout
Your own phone number, usually without any prefix. This is what your computer tells the ISDN network where the call is coming from. Probably your provider will not care. The ISDN network will check this number and nuke any false ones (numbers not assigned to your ISDN connection).
remote-phone-dialout
The number you want to call.

Create /etc/ifconfig.ippp0 (top)

The easiest way to configure your local network interface used to connect to the outside world is to create an /etc/ifconfig.ippp0 file with the following content:

inet 0.0.0.0 0.0.0.1 link1 down

This configures the ippp0 interface to the following parameters:

Set up routing (top)

Since we are assuming this is your only (or main) connection to the outside world, we set up a default route via the ISDN connection. If you have used the /etc/ifconfig.ippp0 file verbatim as stated above, you'll just have to enter this to /etc/rc.conf

defaultroute="0.0.0.1 -iface"

If you changed the remote address, you'll have to adjust it here, too.

Enable ISDN at system startup (top)

To have the ISDN management daemon run at system startup you need to add

isdnd=YES

to /etc/rc.conf.

Reboot (top)

We are not Windows, but now you may reboot to check if everything works as you expected.

Non Flatrate Connections (top)

If you configure an ISDN interface in some /etc/ifconfig.* file, but would not like isdnd to mark this interface UP on startup, add

autoupdown=no

to the isdnd.rc config entry. You will need to set the interface up manually later before using it in this case. Note: this is only an option, in most cases using it will not be necessary. If the interface has link1 set (as suggested above) it will only dial on demand, which usually is exactly the behaviour you will need.

To make your connection time out after some idle time, you need to tweak some of the following config file entries (see isdnd.rc(5) for details). Here is an example for a bidirectional connection with asymmetric timeouts:

idletime-incoming       = 120           # incoming call idle timeout (seconds)
idletime-outgoing       = 55            # outgoing call idle timeout (seconds)
earlyhangup		= 5             # disconnect 5 seconds before
                                        # next unit will be charged
ratetype                = 0             # ratesfile entry to use (index)
unitlength              = 90            # unitlength to assume (seconds)
unitlengthsrc           = aocd          # we get charging information, so
                                        # sync with that

(contact us)   Generated from %NetBSD: index.xml,v 1.4 2006/03/07 14:02:31 kano Exp %
Copyright © 1994-2006 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.
NetBSD® is a registered trademark of The NetBSD Foundation, Inc.