Configuring ISDN (dialin, dialout) from command line

From lxadm | Linux administration tips, tutorials, HOWTOs and articles
Jump to: navigation, search

I needed to configure ISDN on a small, Linux-based router, powered with a tiny 200 MHz mipsel CPU.

As the router was to be sent to a remote location with no IT staff, ISDN line was the only way to talk to the device if everything else fails.


Of course, there were no handy tools tools to configure ISDN on such a small device.

The below script will configure two ISDN channels - dialin (the one which you can use to reach the router - ippp0), and dialout (the one which you can use to dial your ISP - ippp1). It assumes you have all the tools installed (mknod, isdnctrl, ipppd), and systems can see your ISDN device.

USER1=dialin    # dial-in user
USER2=dialout   # dial-out user
PHONE_OUT=123   # phone number to the ISP / other server with ISDN device
MSN=456         # MSN number (needed for dialin)
 
# If these devices are missing, uncomment the lines below
# mknod /dev/isdnctrl c 45 64
# mknod /dev/isdninfo c 45 255
# mknod /dev/ippp0 c 45 128 
# mknod /dev/ippp1 c 45 129

# ippp0
isdnctrl addif ippp0
isdnctrl eaz ippp0 $MSN
isdnctrl addphone ippp0 in 0
isdnctrl l2_prot ippp0 hdlc
isdnctrl l3_prot ippp0 trans
isdnctrl encap ippp0 syncppp
isdnctrl dialmode ippp0 auto
isdnctrl secure ippp0 off
isdnctrl huptimeout ippp0 0
isdnctrl ihup ippp0 off
isdnctrl callback ippp0 off
isdnctrl pppbind ippp0
ifconfig ippp0 10.10.10.11 pointopoint 10.10.10.12 up
ipppd 10.10.10.11:10.10.10.12 user $USER1 ipparam ippp0 -vj -vjccomp -ac -pc -bsdcomp -chap lcp-restart 1 /dev/ippp0

# ippp1
isdnctrl addif ippp1
isdnctrl eaz ippp1 $MSN
isdnctrl addphone ippp1 out $PHONE_OUT
isdnctrl l2_prot ippp1 hdlc
isdnctrl l3_prot ippp1 trans
isdnctrl encap ippp1 syncppp
isdnctrl dialmode ippp1 manual
isdnctrl secure ippp1 off
isdnctrl huptimeout ippp1 300
isdnctrl ihup ippp1 off
isdnctrl callback ippp1 off
isdnctrl pppbind ippp1
ifconfig ippp1 0.0.0.0 up
ipppd user $USER2 ipparam ippp1 noipdefault ipcp-accept-local ipcp-accept-remote -vj -vjccomp -ac -pc -bsdcomp  -chap ms-get-dns lcp-restart 1 /dev/ippp1

Next, you need to create pap-secrets and chap-secrets files in /etc/ppp directory, with this content:

#USERNAME  PROVIDER  PASSWORD  IPADDRESS
"user1"       *       "password"   *
"user2"       *       "password"   * 


Also, you will need options and ioptions files in /etc/ppp directory, with this content:

auth
debug


With this knowledge, you can configure ISDN dialin and dialout on every Linux system, even if it doesn't have a fancy ISDN configurator (you will need to change users/passwords, and your MSN/EAZ number (normally, it's a part of your ISDN number, and perhaps some options, if needed, too).



Keywords: ISDN, dialin, dialout, dial-in, dial-out