Linux Users
|
Setting up an ISDN link
This page describes setting up the Eicon Diva 2.01 internal PCI card with RedHat 6.2. These cards use the hisax driver. If you are using a different card, you may need a different driver. Once you have got the driver for your card installed, then the scripts below should be useful for any card. NOTE: More recent version of 'isdn4k-utils' now provide some extra features for the 'active' Diva cards. These Pages are for the 'dumb' Diva card so be aware of what you buy. The Diva-Pro card (semi-Intelligent) is not supported. The Diva-Server (PCI Version) is supported - but works quite differently. The Eicon Diva 2.01 (and other Diva products) can be purchased through Posix Systems. Windows drivers are included with the card - but setting up Linux to use the card is not so easy - hence the reason for this page. We also hope that you will be using Posix as your dialup ISP so all ISP references are to Posix. Included code examples has been specifically designed so that you can cut'n'paste them easily for use in your own system. Kernel versions 2.2.12 and up have ISDN driver support built in. On earlier versions you have to download some mods and patch the kernel - all good fun. These pre-compiled kernels load ISDN as a module. You will also need the isdn4k-utils package. These are available as RPM's. The target is to get a system that will do 'dial on demand' - allow automatic dial out to POSIX or your own ISP for any system on the network. This also needs IP Masquerading. This is included that as part of the Firewall script. We also show how to set-up a dial in link via ISDN. This requires the option files to be set-up in a particular way. The advantage of using `dial-on-demand' is that any user can browse when they wish, without someone having to access the Linux machine to bring up the link. However, if you do not set up your Windows machines or Samba correctly then you may find lots of calls being made when you don't expect it. Mail clients like Outlook and Netscape have settings to check for new mail every so often. If you don't have a local e-mail server, then this will cause the link to come up. Disable this feature or set the time to a very long period. When Netscape is closed this may also cause a dial-out. Using a local cache (Squid) on your server, and pointing Netscape at that for its Internet connection can stop this. We assume that you have installed the card, and have RedHat 6.2 installed. (Posix Systems also can supply the downloaded ISO images of Redhat 6.2 on CD) Make sure you have installed isdn4k-utils. To check do rpm -q isdn4k-utils Expect something like ...isdn4k-utils-3.0-5 cat /etc/sysconfig/network has the line FORWARD_IPV4=true You can set this by editing this file directly, or using the X-Windows tool netcfg. Also any Windows machine must have the Gateway value in Network Neighbourhood - TCP/IP set to the IP address of your Linux machine. NOTE: These two steps are not necessary if you are only connecting a single Linux machine to the Internet. To load the hisax driver module, use the following info and create a script called vi /etc/rc.d/rc.isdn
HiSax types are:-
Make this script executable by - chmod 755 /etc/rc.d/rc.isdn Run this script to load the hisax driver - /etc/rc.d/rc.isdn Look in the syslog to see if it has loaded correctly - tail -30 /var/log/messages You should see in the syslog a number of lines regarding the hisax driver. The last few should look similarish to... The driver has been loaded! If you use 'lsmod' you can see the modules that are loaded. There should be 'hisax', 'isdn' and 'slhc' amongst others. modprobe slhc into the script '/etc/rc.d/rc.isdn'.
vi /etc/isdn/isdn.conf and check your local settings. This file is part of the isdn4k-utils. I live in Pretoria - so have COUNTRYCODE = 27 AREAPREFIX = 0 AREACODE = 12 Now set-up the pap-secrets file. Edit /etc/ppp/pap-secrets. vi /etc/ppp/pap-secrets 'client' 'server' 'secret' where eg mark * VerySecretPassword If you intend to use 'chap' then set up /etc/ppp/chap-secrets in exactly the same way.
IsdnctrlThe general set-up utility provided with isdn4k-utils (or isdn4linux) is `isdnctrl'. This command is used in the following scripts. The first script is used with Posix Systems. Whether you have Static or Dynamic IP's - the IPs are allocated from the Posix side - so act as though all IP's are Dynamic.
vi /usr/local/sbin/isdnup
More details for these commands are available by typing `man isdnctrl'. chmod 755 /usr/local/sbin/isdnup Do not run this script yet as the option files have not been defined. NOTE: You may find ipppd in /sbin or /usr/sbin depending on your version of isdn4linux etc. Use 'whereis ipppd' to find out.
Setting up the `ioptions' filesThe daemon that links to the ISDN card is 'ipppd', and it communicates via interfaces 'ippp0', 'ippp1' etc. just like 'eth0' communicates with the Network adaptor. Several instances of ipppd can be running at the same time. The file /etc/ppp/ioptions is read by ipppd whenever it is loaded. To be able to dialout to an ISP, and allow external access to this host, or even dialout to a different host or ISP, you must run an ipppd for each interface you want active. As ipppd (see 'man ipppd') always reads /etc/ppp/ioptions, then only common values must be present in /etc/ppp/ioption. The values specific to an interface will be stored in /etc/ppp/ioption.ippp0, and /etc/ppp/ioptions.ippp1 etc. The `ippp0' interface is added in the script above. Type `ifconfig' and you should see the interface details. Create `/etc/ppp/ioptions'. It should contain -
vi /etc/ppp/ioptions
Now create the /etc/ppp/ioptions.ippp0 file with details for Posix Systems.
vi /etc/ppp/ioptions.ippp0
More details for these options are available in the ipppd man page (`man ipppd'). NOTE: The lines -vj, -ac -pc, etc disable various compression options. Using no compression has given the most reliable connection with some versions of isdn4k-utils, but it is worth checking with newer versions to see if compression options are now available. Now create a script to remove the ISDN set-up.
vi /usr/local/sbin/isdndown
The last line removes the hisax driver, and is currently commented out. Note that the quote marks around the `cat` command on the kill lines are both open quote marks Make this executable.... chmod 755 /usr/local/sbin/isdndown We have now created -
Fiddly bitsIt seems that some part of the system does not create routes correctly. On a RedHat 5.2 system with a 2.0.36 kernel and ISDN patches applied there are less problems with spurious routes being created than with the 2.2.12 & 2.2.13 kernels and ISDN4linux. The routes direct the IP traffic to the correct place. For `dial-on-demand' you must have the default route set to ippp0 before the link comes up or nothing happens. We have added a default route as the last line of the `isdnup' script. However, once the link is up, this route goes away and other routes are added!!. Make sure you have only one default route. You can see this problem being discussed frequently on the isdn4linux newsgroup `de.alt.comp.isdn4linux', and in the FAQ that comes with isdn4linux. A solution is to use /etc/ppp/ip-up.local, and /etc/ppp/ip-down.local. The ip-up.local script should be called from ip-up after the link to your ISP is brought up, whereas the ip-down.local script is called by ip-down when the link dies. These files don't always exist, so create them. Edit /etc/ppp/ip-up.local to include - vi /etc/ppp/ip-up.local
Make this file executable.... chmod 755 /etc/ppp/ip-up.local Because this script is run whenever the link is brought up using any of the interfaces, it is important to only add the default route for the interface that requires it. The ip-up.local and ip-down.local scripts are passed certain parameters when they are called. The first parameter is the interface. This script tests for ippp0 and only adds a default route if that is true. Make sure there are spaces either side of the square brackets and the = sign. These scripts do not have any knowledge of your path, so include the full path to the command. See `man ipppd' for more details. When the link is disconnected you must remove the routes that were added when the link came up, otherwise the system will not be in the correct state to initiate the link again. Edit /etc/ppp/ip-down.local to include - vi /etc/ppp/ip-down.local
Make this file executable... chmod 755 /etc/ppp/ip-down.local NOTE: Do make sure that when the link comes up you have only one default route.
To initiate the link To start the link - load the driver with `/etc/rc.d/rc.isdn'. Once this is loaded it is not usually necessary to unload it. If `isdnctrl dialmode ippp0' is set to manual, type `isdnctrl dial ippp0', and the system will dial the number defined in the `isdnctrl addphone' statement. Do make sure you have the correct IP numbers in /etc/resolv.conf. For Posix - these are automatically sent to the Linux machine from the router that you dial in from but you can manually set /etc/resolv.conf to...
NOTE: If you wish to use a firewall with a dynamic IP, add the firewall rules to the ip-up.local file. See the Firewall page for more details
Dial in configuration The dial in configuration allows for remote users to access a server via ISDN. One could use this set-up to provide remote support to customers systems. It can be used to provide e-mail and file access for remote users etc. Set up ippp1 on the system that will answer the dial-in request. In this set-up the server allocates the IP number to be used by the remote user, so use a 'dynamic-IP' configuration on the remote system. Create a file /usr/local/sbin/isdndialin.up -
Make this script executable The isdnctrl eaz option is interesting. For EAZ read MSN (Multi Subscriber Numbering). This is your local digital number. Its usually the last four digits of your number. It is due to the checks carried out by isdn4linux. If you have problems try other options, unless you know the real MSN when use that. If you haven't set-up /etc/isdn/isdn.conf correctly then this will not work
Now to remove the set-up to allow restart etc.
Make this script executable. Type 'isdndialin.up' start, and 'isdndialin-down' to disable. NOTE: It is important to add some additional lines to /etc/ppp/ip-down.local to sort out the routes after the script has been run.
Loading ISDN on boot-up Having created the scripts above, it is now a simple matter to automate the loading of your ISDN configuration on booting. For a RedHat system edit the /etc/rc.d/rc.isdn file and add the last two lines:
to the end of the file. For other Linux distributions, add the same lines to the relevant start-up file.
MPPP - Multi PPP or Channel Bundling.This allows you to achieve 128 kbps with the two channels of an ISDN card, or greater with more cards in the same PC!. Both the options file and the script containing all the isdnctrl commands need changing. Changes are shown in BLUE The original 'isdndown' file removes the interface.
The options file '/etc/ppp/ioptions.ipppM' is as follows:
Start the first channel with isdnctrl dial ippp0, then add the second channel with isdnctrl dial ippp1 PLEASE NOTE. MPPP works with Posix - as long as you asked for this service. If you have problems, it may not have been enabled for your account. Happy browsing! |
||||||||||||||||

