|
Home Page Linux Notes Samba ISDN Firewall |
Setting up an ISDN linkNOTE: As we now have ADSL - using the Pulsar PCI card in a Linux box, these details are unlikely to be updated.This page describes setting up the BT Speedway (AVM Fritz PCI) card or Eicon Diva 2.01 internal PCI card with Definite Linux 7.0 or RedHat 6.0 or later. (Not the 'Eicon... Pro' card - see below). 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 I think the scripts below should be useful for any card. NOTE: More recent version of 'isdn4k-utils' now provide some extra features for the 'active' Eicon cards, but do read the 'isdn4k-utils' details before you buy one. If you have an external ISDN TA then you need to check what type of beast it is. One sort you treat just like a serial modem, and they work OK with Linux - if you have a fast serial port (atleast 230,400bps if you wish to do MPPP). The other type needs a CAPI driver, so check there is a driver for Linux before you buy one.
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. Definite Linux 7.0 comes with kernel
2.2.12, so no problems in that area. 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 your ISP for any system on the network. This also needs IP Masquerading. I have included that as part of the Firewall script. I 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. Definite Linux provide a set of scripts called 'rh-isdn'. They don't seem to set up the routes correctly for my purposes. I have more experience with 'isdn4net', but they only assist with the set up of one interface, and we need at least two, one for dial-out to an ISP, and the other for incoming connections. Therefore I am using my own simple scripts based on the 'isdnctrl' facility provided by the isdn4k-utils package. I am assuming that you have installed the card, and have Definite Linux 7.0 or later installed. (RedHat 6.0 or later with kernel 2.2.12 should do as well) Make sure you have installed isdn4k-utils. To check do 'rpm -q isdn4k-utils'. It is provided on the Definite Linux or RedHat CDROM. It is usually necessary to be logged in as root to install an rpm package. The other assumptions are that the Linux box is set to forward IP packets. Check that /etc/sysconfig/network has the line FORWARD_IPV4=true. You can set this by editing this file directly, or using a GUI method. 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 I use the following script.
Run this script to load the hisax driver - 'loadhisax'. Look in the syslog to see if it has loaded correctly - 'tail -30 /var/log/messages'
...... Dec 19 14:47:43 weber kernel: HiSax: 2 channels added Dec 19 14:47:43 weber kernel: HiSax: MAX_WAITING_CALLS added Dec 19 14:47:43 weber kernel: isdn: Verbose-Level is 2 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. The other Hisax card 'types' are as below
1 Teles 16.0 Edit /etc/isdn/isdn.conf. This file comes as part of isdn4k-utils. Enter the country code - UK is 44; the area prefix should be 0, and enter your own area code without the leading 0.
Now set-up the pap-secrets file. Edit /etc/ppp/pap-secrets. 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 Demon Internet. They use 'static IP numbers' and you have to define the IP numbers to be used in your scripts.
Make this script executable - 'chmod 700 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 -
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.
Make this executable.
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. My 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. They must be executable, and have #!/bin/bash as the first line. (Yes, you must include the #) Edit /etc/ppp/ip-up.local to include -
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 -
To initiate the linkTo start the link - load the driver with `loadhisax'. Once this is loaded it is not usually necessary to unload it.Set-up the ippp0 interface by running `isdnup'. The ippp0 interface will be added, and if you have 'isdnctrl dialmode ippp0' set to auto, then opening a browser and selecting a webpage should cause the link to be created.
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 IP numbers for your ISP's nameservers in /etc/resolv.conf. Using ISDN and a dynamic IPLoading the hisax driver is exactly the same. The script /root/bin/isdnup changes slightly.
NOTE: If you wish to use a firewall with a dynamic IP, add the firewall rules to the ip-up.local file. See our Firewall page for more details Dial in configurationThe dial in configuration allows for remote users to access a server via ISDN. We 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.The dial-out channel will continue to work. 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 /root/bin/isdndialin.up -
NOTE: MSN is not available with Home Highway. The /etc/ppp/ioptions file containing the common values will be read when ippp0 comes up for dial out to your ISP, and when ippp1 comes up for dial-in, so options specific to ippp1 are put in /etc/ppp/ioptions.ippp1.
Add :
Loading ISDN on boot-upHaving 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.local file and add:
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. I have called the new file 'isdnMPPP.up'. The original 'isdndown' file removes the interface.
It seems possible to add/remove the additional channel in the middle of a transfer, but I have NOT checked the file transferred! The 'auto' bonding option does not work with the version of isdn4k-utils that I am using, which is certainly not the latest version.
PLEASE NOTE. I have not tested the MPPP set up very much, so if you find any improvements please let me know.
|