Tuesday, April 9, 2013

ISDN adventures

I have an ISDN internet connection. It is slow, but happens to be provided for free. Getting ISDN set up under Linux has usually been a challenge for me, so when I got a fresh install working today with very little effort, I wanted to document the steps. Once it starts working, it usually works fine. (Special greetings to everyone in the University guest house in Marburg. Ask for a DrayTek modem and not the Fritz modem, which is a real pain when running Linux. Say you have ein Apple Computer).

The modem is a DrayTek miniVigor 128 (USB ID 0675:1688), a small box which connects to a USB port on the computer and to a phone for the phone line. The computer runs Ubuntu 11.10 (but I have used the setup on other versions, up to 12.04 without problems).

There are two ISDN systems in use for Linux. I have used the older one, in particular the HiSax driver supports my ISDN modem. The newer system is called mISDN. The two systems cause a conflict when both try to control the same device. I solved this by blacklisting the mISDN module, to prevent it from being loaded.

Add a file to /etc/modprobe.d/, for example /etc/modprobe.d/blacklist-misdn.conf, with the following lines:
blacklist mISDN_core
blacklist hfcsusb

Install some packages. This is easy if there already is an internet connection...
sudo apt-get install isdnutils-base ipppd

while installing, the installation script for ipppd asks for some information:

  • phone number to dial
  • user name (at your network provider)
  • password
The installer script then sets up the following files:
/etc/ppp/pap-secrets   #user name, password
/etc/ppp/chap-secrets  #user name, password

/etc/isdn/device.ippp0 #phone number, etc
/etc/isdn/ipppd.ippp0  #user name, channel bundling, etc

At this point I rebooted, after that I could dial with
isdnctrl dial ippp0
and had internet access. Not bad. But at this point, the connection uses only one of the two ISDN channels. To double the connection speed to amazing 128 kBit/s, one must set up channel bundling.

Edit /etc/isdn/ipppd.ippp0. Uncomment the line #+mp, and add /dev/ippp1 above it. So:

Create a new device file for the two bundled devices
sudo cp /etc/isdn/device.ippp0 /etc/isdn/device.ippp0+1

Restart the isdn service after changing the configuration files, to make the new settings active.
sudo /etc/init.d/isdnutils restart

Now, it should be possible to dial first ippp0, then ippp1 and use both channels for fast surfing.
isdnctrl dial ippp0
isdnctrl dial ippp1

Note: if you receive the message
ippp0: Device or resource busy
it might be because the line is already connected, possibly since the default setting is to automatically dial when there is network traffic.

If the connection works so far, some adjustments can be done in the configuration files.

Turn on compression negotiation - perhaps it increases the bandwidth a little.
Comment out the command noccp in /etc/isdn/device.ippp0, remember to copy to the other name as well:
sudo cp /etc/isdn/device.ippp0 /etc/isdn/device.ippp0+1

In /etc/isdn/device.ippp0, adjust timeout for terminating an idle connection. It's only 60 seconds as default. If you are lucky and don't pay per minute, set it to something higher, for example 1800. Change this line:
isdnctrl huptimeout ${device} 60

DIALMODE=manual (instead of auto) disables automatic dialing, and gives you control of when to dial.

For convenience, one can make two shell scripts for dialing and hanging up:
isdnctrl dial ippp0
isdnctrl dial ippp1

isdnctrl hangup ippp1
isdnctrl hangup ippp0

The configuration file architecture is probably specific to Debian-based distributions, but the step of blacklisting mISDN should help on any Linux with both ISDN systems. I tried to get the ISDN modem working with my Raspberry Pi router as well, but I never got that to work.
Newer Older Home
Related Posts Plugin for WordPress, Blogger...