Remove lfs-uefi.txt symlink
[linux_from_scratch_hints.git] / PREVIOUS_FORMAT / isdn-setup.txt
blobca900353b17c9090873c234df1d30a1136205130
1 TITLE:          ISDN Setup
2 LFS VERSION:    3.3 and higher
3 AUTHOR:         Eric Dillenseger <eric@naxalite.homelinux.org>
5 SYNOPSIS:
6         Setting up ISDN on LFS and using ISDN4Linux.
8 HINT:
9 version 0.1.0
10 Nov. 03 2002
12 CONTENT:
13 --------
14         1° What do I need?
15         2° Setting up ISDN support in the linux kernel.
16         3° Installing ISDN4Linux
17         4° Configuring ISDN interfaces
18         5° The end
20 1° What do I need?
21 ------------------
23 For this hint I used a 2.4.18 kernel and isdn4k-utils.v3.1pre1
24         
25 -Linux kernel sources at http://kernel.org
26 -ISDN4Linux at http://www.isdn4linux.de
27         (requires sgml2html for FAQ installation and gdbm for isdnlog)
28 -Know how to compile a kernel
29 -Some time ;)
31 2° Setting up ISDN support in the linux kernel.
32 -----------------------------------------------
34 I suppose you have the source for your kernel in /usr/src/linux
35 We start from a clean source by runing:
37 #: make mrproper
39 Now you can choose your own way to configure it (config/menuconfig/xconfig).
40 I use menuconfig.
42 #: make menuconfig
44 There you set up your configuration the way you want it.
45 For ISDN support, you need to go in 'ISDN subsytem' then select 
46         -'ISDN support' as a module <M>
47                 (Activates ISDN subsystem)
48         -'Support synchronous PPP' <Y>
49                 (To use synchronous transmit on ISDN line)
50         -'Use VJ-compression with synchronous PPP' <Y>
51                 (Van Jacobson compression)
52         -'Support generic MP (RFC 1717)' <Y>
53                 (To be able to connect at 128k)
54         -'Support BSD compression' as a module <M>
55                 (BSD compression)
57 Depending on your card, choose the appropriate driver from
58         -Passive ISDN cards
59         -Active ISDN cards
60 It depends of your card' chipset.
62 I have an Olitec card with ISDN 128 Gazel chipset so:
63         -Passive ISDN cards
64         +->HiSax SiemensChipset driver support <M>
65         |+->HiSax support for EURO/DSS1 <Y>
66         +->Gazel cards <Y>
68 Once again, this is my configuration, adapt to yours.
70 *Note*
71         If you have an Olitec 128 RNIS PCI card (like me), there's a little trick
72         to make it work before compiling the new kernel.
73         Here it is for 2.2.17 kernel:
75         #: cat /proc/pci
76         
77         there should be an entry like 
79         Network controler : PLX Unknown device?
80         Vendor id=10b5. Device id=1187
82         Write down this device id and go to /usr/src/linux/drivers/isdn/hisax
83         edit gazel.c and replace
84                 #DEFINE GAZEL_R753 0x1152
85         by
86                 #DEFINE GAZEL_R753 0x1187
87         and save it.
88         For 2.4.18 kernel:
89         go to /usr/src/linux/include/linux
90         edit pci_ids.h and replace line 766
91                 #define PCI_DEVICE_ID_PLX_R753          0x1152
92         by
93                 #define PCI_DEVICE_ID_PLX_R753          0x1187
94         and save it.
95         Don't ask me where to find it for other kernel, i don't know.
96         But it seems that they're keeping the 2.4.18 way.
97         Let's see how it'll be in 2.6.x next year (or maybe 2004 ;)
99 Ok, now we can compile the kernel as usual:
101 #: make dep && make bzImage && make modules && make modules_install
103 copy the kernel to /boot
105 #: cp arch/i386/boot/bzImage /boot/lfskernel-isdn
106 #: cp System.map /boot/System.map-isdn
107 #: rm /boot/System.map
108 #: ln -s /boot/System.map-isdn /boot/System.map
110 Edit /etc/lilo.conf to reflect the new configuration
112 # Begin /etc/lilo.conf
114 lba32
115 boot=/dev/hda
116 root=/dev/hda1
117 install=/boot/boot-menu.b
118 prompt
119 timeout=50
120 default=lfsisdn
121 image=/boot/lfskernel-isdn
122        label=lfs-isdn
123        read-write
124 image=/boot/lfskernel
125         label=lfs
126         read-write
128 # End /etc/lilo.conf
130 Then run lilo to update the mbr
132 #: /sbin/lilo
133 Added lfs-isdn *
134 Added lfs
136 And now, the moment of truth, reboot your system.
137 Log in as root, and type:
139 #: modprobe hisax type=xx protocol=x
141 Replace by the values corresponding to your card, in doubt, read
142 /usr/src/linux/Documentation/isdn/README.hisax
143 It should load without problem.
145 3° Installing ISDN4Linux
146 ------------------------
148 Unpack the source in a directory:
150 #: tar xzf isdn4k-utils.v3.1pre1.tar.gz
152 go to the new directory and run:
154 #: make config
156 This brings you to a screen looking like menuconfig for the kernel.
157 There you can choose what you want to enable/disable and set the path where
158 the stuff will be installed.
159 Use help anytime if you don't know the meaning of an item.
160 Once you're done, you may save your config to a file for further use or
161 simply exit. The program will configure everything.
163 #: make && make install
165 At the end of make install, devices are automatically created.
167 #: ls /dev/ippp* && ls /dev/isdn*
169 Should show them, and you should have isdnctrl, hisaxctrl and ipppd in /sbin
171 4° Configuring ISDN interfaces
172 ------------------------------
174 First, we're going to write the config file for isdnctrl that will set ippp0
175 interface for single channel connection.
176 Feel free to modify it to suit your needs.
178 /etc/isdn/isdn1B.conf
179 [ISDNCTRL]
180         INTERFACES = {
181                 INTERFACE]
182                 NAME = ippp0
183                 EAZ = <EAZ>             #this is your line number w/o <>
184                 PHONE_OUT = <ISP>       #this is the phone number of your ISP
185                 SECURE = on
186                 DIALMODE = auto
187                 DIALMAX = 1
188                 HUPTIMEOUT= 180
189                 IHUP = on
190                 CHARGEHUP = off
191                 L2_PROT = hdlc
192                 L3_PROT = trans
193                 ENCAP = syncppp
194                 SDELAY = 10
195                 PPPBIND = 0
196         }
198 for dual channel connection:
200 /etc/isdn/isdn2B.conf
201 [ISDNCTRL]
202         INTERFACES = {
203                 [INTERFACE]
204                 NAME = ippp0
205                 EAZ = <EAZ>
206                 PHONE_OUT = <ISP>
207                 SECURE = on
208                 DIALMODE = auto
209                 DIALMAX = 1
210                 HUPTIMEOUT= 170
211                 IHUP = on
212                 CHARGEHUP = off
213                 L2_PROT = hdlc
214                 L3_PROT = trans
215                 ENCAP = syncppp
216                 ADDSLAVE = ippp1
217                 SDELAY = 30
218                 PPPBIND = 0
219                 [SLAVE]
220                 NAME = ippp1
221                 EAZ = <EAZ>
222                 PHONE_OUT = <ISP>
223                 SECURE = on
224                 DIALMODE = auto
225                 DIALMAX = 3
226                 HUPTIMEOUT= 170
227                 IHUP = on
228                 CHARGEHUP = off
229                 L2_PROT = hdlc
230                 L3_PROT = trans
231                 ENCAP = syncppp
232                 PPPBIND = 1
233         }
235 Now we can test our configuration by passing the file to isdnctrl with:
237 #: cd /etc/isdn
238 #: ln -s isdn1B.conf device.conf
239 #: isdnctrl readconf /etc/isdn/device.con
241 You should see something like:
242 [root@lfs] /etc/isdn
243 #:> isdnctrl readconf device.conf
244 ippp0 added
245 EAZ/MSN for ippp0 is <EAZ>
246 Security for ippp0 is on
247 Dialmax for ippp0 is 1 times.
248 Hangup-Timeout for ippp0 is 180 sec.
249 Incoming-Hangup for ippp0 is on
250 Charge-Hangup for ippp0 is off
251 Layer-2-Protocol for ippp0 is hdlc
252 Layer-3-Protocol for ippp0 is trans
253 Encapsulation for ippp0 is syncppp
254 Slave-activation delay for ippp0 is 10 sec.
255 ippp0 bound to 0
256 ISDN Configuration read from device.conf.
258 Now you should be able to connect to internet. You have no gateway
259 or nameserver set so you may not browse the net.
260 Simply type:
262 #: isdnctrl dial ippp0
264 To erase this configuration, type
266 #: isdnctrl delif ippp0
268 Now we're going to set some startup script to automate the configuration
269 of ipppd daemon. ipppd expect to find a file called ioptions in /etc/ppp
270 even if it's empty so create it to avoid some errors:
272 #: touch /etc/ppp/ioptions
274 For one channel (64kb):
276 /etc/isdn/ioptions1B
278 # Begin /etc/isdn/ioptions1B
280 /dev/ippp0
281 defaultroute
282 debug
283 +pwlog
284 name !!login-name!! # replace with your ISP login name
286 # End /etc/isdn/ioptions1B
288 For two channels (128kb):
290 /etc/isdn/ioptions2B
292 # Begin /etc/isdn/ioptions2B
294 /dev/ippp0
295 /dev/ippp1
297 defaultroute
298 debug
299 +pwlog
300 name !!login-name!! # replace with your ISP login name
302 # End /etc/isdn/ioptions2B
304 Now we need to create a chap-secrets or pap-secrets file.
306 #: mkdir /etc/ppp
307 #: echo "\"login-name\"    *    \"password\"" > /etc/ppp/chap-secrets
308 #: chmod 600 /etc/ppp/chap-secrets
310 As this file contains our login/password for our ISP, we don't want everybody
311 to be able to read them.
312 At this point, don't forget to add users who will be able to connect to
313 internet to the dialout group:
315 #: usermod -G dialout user
317 Check the rights on /dev/isdninfo and /dev/isdnctrl*
318 All should belong to user root and group dialout and be crw-rw----
319 except /dev/isdnctrl wich is a symlink to /dev/isdnctrl0
321 #: ls /dev/isdninfo
322 crw-rw----    1 root     dialout   45, 255 nov  3 20:14 /dev/isdninfo
323 #: ls /dev/isdnctrl
324 lrwxrwxrwx    1 root     dialout         9 nov  3 20:14 /dev/isdnctrl -> isdnctrl0
325 #: ls /dev/isdnctrl0
326 crw-rw----    1 root     dialout   45,  64 nov  3 20:14 /dev/isdnctrl0
328 Correct if needed:
329 #: chown root:dialout /dev/isdninfo
330 #: chmod 660 /dev/isdninfo
331 #: chown root:dialout /dev/isdnctrl
333 Now we can start ipppd to see if everything works fine:
335 #: ipppd file /etc/isdn.ioptions1B
336 #: ps aux | grep ipppd
337 root      4705  0.0  0.2  2088 1068 ?        S    21:10   0:00 ipppd file /etc/i
339 This means that everything is ok, you can check your logs to be sure, I'm using
340 metalog so I give you the files from sysklogd from my old debian:
341 in /var/log/kern.log:
342 Nov  3 15:56:38 naxalite kernel: ippp, open, slot: 0, minor: 0, state: 0000
343 Nov  3 15:56:38 naxalite kernel: ippp_ccp: allocated reset data structure c4f29
344 Nov  3 15:56:38 naxalite kernel: ippp_ccp: freeing reset data structure c384080
345 Nov  3 15:56:38 naxalite kernel: ippp0: dialing 1 0860095557...
346 Nov  3 15:56:40 naxalite kernel: isdn_net: ippp0 connected
348 This shows a succesfull connection.
349 in /var/log/messages:
350 Nov  3 15:56:38 naxalite ipppd[231]: reinit_unit: 0
351 Nov  3 15:56:38 naxalite ipppd[231]: Connect[0]: /dev/ippp0, fd: 8
352 Nov  3 15:56:38 naxalite kernel: ippp0: dialing 1 ...
353 Nov  3 15:56:40 naxalite ipppd[231]: Local number: , Remote number: , Type: out
354 Nov  3 15:56:40 naxalite kernel: isdn_net: ippp0 connected
355 Nov  3 15:56:40 naxalite ipppd[231]: ChapReceiveChallenge: Rcvd id 27.
356 Nov  3 15:56:40 naxalite ipppd[231]: ChapReceiveChallenge: received name field:
357 Nov  3 15:56:41 naxalite ipppd[231]: ChapReceiveSuccess: Rcvd id 27.
358 Nov  3 15:56:41 naxalite ipppd[231]: MPPP negotiation, He: Yes We: Yes
359 Nov  3 15:56:41 naxalite ipppd[231]: CCP enabled! Trying CCP.
360 Nov  3 15:56:41 naxalite ipppd[231]: ccp_resetci!
361 Nov  3 15:56:41 naxalite ipppd[231]: Compressor BSD Compress loaded!
362 Nov  3 15:56:41 naxalite ipppd[231]: ccp_resetci!
363 Nov  3 15:56:41 naxalite ipppd[231]: Compressor BSD Compress loaded!
364 Nov  3 15:56:41 naxalite ipppd[231]: local  IP address 212.83.145.79
365 Nov  3 15:56:41 naxalite ipppd[231]: remote IP address 212.47.226.2
367 This shows ipppd connection.
369 Now we almost have a working internet connection via ISDN, we just need to
370 setup some system boot scripts to load ipppd and set the default gateway on
371 dial.
373 #: touch /etc/rc.d/init.d/hisax
375 Edit /etc/rc.d/init.d/hisax
377 #!/bin/sh
378 # Begin of /etc/rc.d/init.d/hisax
379 case "$1" in
380         start)
381                 /sbin/modprobe hisax type=34 protocol=2
382                 /sbin/isdnctrl readconf /etc/isdn/device.conf
383                 /sbin/ipppd file /etc/isdn/ioptions1B
384         ;;
385         stop)
386                 /sbin/ifconfig ippp0 down
387                 /sbin/isdnctrl delif ippp0
388         ;;
389         restart)
390                 $0 stop
391                 wait 3
392                 $0 start
393         ;;
394         *)
395                 echo "Usage: $0 {start|stop|restart}"
396                 exit 1
397         ;;
398 esac
400 exit 0
401 # End /etc/rc.d/init.d/hisax
403 Make it executable:
405 #: chmod +x /etc/rc.d/init.d/hisax
407 Link it to the differents runlevels, replace XX by the levels tou want:
409 #: ln -sf /etc/rc.d/init.d/hisax /etc/rc.d/rc0.d/KXXhisax
410 #: ln -sf /etc/rc.d/init.d/hisax /etc/rc.d/rc1.d/KXXhisax
411 #: ln -sf /etc/rc.d/init.d/hisax /etc/rc.d/rc2.d/KXXhisax
412 #: ln -sf /etc/rc.d/init.d/hisax /etc/rc.d/rc3.d/SXXhisax
413 #: ln -sf /etc/rc.d/init.d/hisax /etc/rc.d/rc4.d/SXXhisax
414 #: ln -sf /etc/rc.d/init.d/hisax /etc/rc.d/rc5.d/SXXhisax
415 #: ln -sf /etc/rc.d/init.d/hisax /etc/rc.d/rc6.d/KXXhisax
417 We need to define a gateway:
419 /etc/ppp/ip-down.local
421 #!/bin/sh
422 # Begin of /etc/ppp/ip-down.local
423 route add default dev ippp0
424 # End of /etc/ppp/ip-down.local
426 Now we can create a small script to dial/hangup or check the status of
427 our connection:
429 #!/bin/sh
430 # Begin /bin/isdn
431 case "$1" in
432         on)
433                 /sbin/isdnctrl dial ippp0
434         ;;
435         off)
436                 /sbin/isdnctrl hangup ippp0
437         ;;
438         info)
439                 /sbin/isdnctrl list ippp0 | egrep "Dial mode|Hangup-Timeout" \
440                         && /sbin/isdnctrl status ippp0
441         ;;
442         *)
443                 echo "Usage: $0 {on|off|info}"
444                 exit 1
445         ;;
446 esac
448 exit 0
449 # End /bin/isdn
451 #: chmod +x /bin/isdn
453 Don't forget to set tour nameservers in /etc/resolv.conf and check
454 /etc/sysconfig/network-devices/ifconfig.ethX for GATEWAY=xxx.xxx.xxx.xxx
455 value.
456 I wrotte this hint while installing isdn4linux on my box without problem.
457 I repeat it again, the main problem comes from your chipset and how you load
458 the hisax module. Check your reseller or the card box to figure out wich
459 chipset your card use.
460 Another hint:
461 If you have an ISA/PnP card, dont forget to add io= and irq= to modprobe
462 (cat /proc/isapnp is your friend)
464 You may create /etc/isapnp.conf with pnpdump:
466 #: pnpdump > /etc/isapnp.conf
468 For more information, check the kernel documentation, isdn4linux website,
469 newsgroups, IRC, google, etc.
471 5° The end:
472 -----------
474 Well, we're done, we have a working ISDN connection.
475 This document is a very beta version, it may contain some erros, feel free to
476 mail me any correction or addition I should/may add.
477 If you have question, I may try to help you in the scope of my little knowledge
478 but don't expect too much ;)
480 Some script from this document are from a french document written by 
481 Philippe Latu, and the adaptation to LFS and is from me ;p
483 I hope this document helped you.