NetBSD Documentation: Steps to connect via ISDN
- Adjust your kernel
- Create and populate /etc/isdn
- Create an /etc/isdn/isdnd.rc file
- Create /etc/ifconfig.ippp0
- Set up routing
- Enable ISDN at system startup
- Non Flatrate Connections
Steps to connect via ISDN
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:
- Your NetBSD system is completely updated (including
- You want to setup a simple PPP connection from your system to your provider.
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.
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.
You need to create the directory
/etc/isdn. Look at the example files in
/usr/share/examples/isdn and copy the appropriate
isdnd.rates files (with exactly that names, the examples have
slightly different names) to
If, for example, you happen to live in Germany, Schleswig-Holstein, you
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.
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
/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:
- 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.
- The login your provider gave you. This may have special characters in it (like "#"), so better put it into double-quotes.
- The password your provider gave you. Double quoting is a good idea, see above.
- 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).
- The number you want to call.
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
inet 0.0.0.0 0.0.0.1 link1 down
This configures the ippp0 interface to the following parameters:
- The local address is set to 0.0.0.0, which means "accept anything the remote side will negotiate during PPP startup".
- The remote address is set to 0.0.0.1, which means "accept anything the remote side thinks is his (the remote) IP address. If you know the specific address your provider uses, you may substitute that.
- The flag "link1" is set, which means "dial on demand".
- The interface is not marked "UP", as the interface configuration runs early during bootstrap, when the isdn daemon is not yet running. This prevents outgoing calls, so better not trigger them. Since the interface has an IP address configured, isdnd will mark it up (and thereby make it usable) when isdnd starts.
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
If you changed the remote address, you'll have to adjust it here, too.
To have the ISDN management daemon run at system startup you need to add
We are not Windows, but now you may reboot to check if everything works as you expected.
If you configure an ISDN interface in some
/etc/ifconfig.* file, but would
not like isdnd to mark this interface UP on startup, add
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