17. OCT 1996 From: Emil Stephan Subject: Konfiguration f"ur Eunet-Zugang Hallo, ich habe einen Zugang zu Eunet mit dynamischer Addresszuweisung hier. Die Protokolle sind hdlc trans ppp. Die Konfiguration lehnt sich noch an die an, die ich f"ur den Zugang via Modem hatte. Ein Skript namens isdnjob startet zum Aufbau der ISDN-Verbindung ein Skript namens popEUi, das nach dem Aufruf von "isdnctrl dial ippp0" wartet, bis eine Datei namens /tmp/$interface.ok erscheint (wird von /etc/ppp/ip-up erstellt, /etc/ppp/ip-down löscht die Datei wieder), und startet dann Programme wie runq (senden gequeuter mail), pop3 (holen mail), nntpxfer (holen news) und nntpsend (posten von eigenen news-Artikeln). Das Skript popEUi sieht folgenderma\3en aus: ---------------------------------------------------------- #!/bin/sh # script to build PPP connection to $0 # host=`basename $0` hangup=n while test $# -gt 0 do case "$1" in "-h" ) hangup=y shift ;; * ) echo "usage: $0 [-h]" exit 1 ;; esac done exec > /tmp/$host.log 2>&1 set '' `grep ^$host /etc/slipoutmap` shift portnr=$2 inter=`basename $portnr` if test "$hangup" = "y" then isdnctrl hangup $inter ret=$? else isdnctrl dial $inter ret=$? if test $ret -eq 0 then while test ! -f /tmp/$inter.ok do sleep 1 done fi fi exit $ret ----------------------------------------------------------------- Ein Eintrag in der Datei /etc/slipoutmap sieht so aus: # format: remhostname device locname mtu defrout login sliperkennung passwd popEUi /dev/ippp0 ? 1524 y IS10877 MTU ????? Das Passwort und die Sliperkennung darin werden mit ISDN nicht mehr gebraucht, wurde bei slip "uber Modem gebraucht, das Passwort steht jetzt in /etc/ppp/pap-secrets: IS10877 popEUi Das Skript /sbin/init.d/i4l (von mir erweitert um die Aufrufe f"ur die pnp-Konfiguration von Karsten Keil und die while-loops "uber I4L_REMOTE_OUT_LIST und I4L_REMOTE_IN_LIST, sowie die Parameter f"ur isdnlog und den Aufruf des ipppd) sieht folgenderma\3en aus: ----------------------------------------------------- #!/bin/sh # Copyright (c) 1996 S.u.S.E. Gmbh Fuerth, Germany. All rights reserved. # # Authors (in alphabetic order ;-) : # Thomas Fehr # Klaus Franken # Hubert Mantel # Burchard Steinbild # # Version: 19.05.96 (kfr) # # /sbin/init.d/i4l # # Last modified by Emil Stephan: 14.10.96 . /etc/rc.config test "$I4L_START" = yes || exit 0 case "$1" in start) # turn on isdn echo "Starting isdn4linux" # load modules /sbin/modprobe isdn.o # # isapnp-tools von Karsten Keil # /sbin/isapnp /etc/isapnp.conf /sbin/modprobe hisax.o \ io=${I4L_HISAX_TYPE},${I4L_PROTOCOL},${I4L_HISAX_PA},${I4L_HISAX_PB},${I4L_HISAX_PC} \ HiSax_id=${I4L_HISAX_ID} /sbin/lsmod | grep hisax > /dev/null if test $? -eq 1; then echo "" echo "Initialization of HiSax Driver failed!" echo "Check that the values in '/etc/rc.config' are correct:" echo "I4L_HISAX_PA: ${I4L_HISAX_PA}" echo "I4L_HISAX_PB: ${I4L_HISAX_PB}" echo "I4L_HISAX_PC: ${I4L_HISAX_PC}" echo "I4L_PROTOCOL: ${I4L_PROTOCOL}" echo "" exit 1 echo "never here" fi # /sbin/modprobe teles.o teles_id=${I4L_TELES_ID} \ # io=${I4L_TELES_MEMBASE},${I4L_TELES_IRQ},${I4L_TELES_PORT},${I4L_PROTOCOL} # /sbin/lsmod | grep teles > /dev/null # if test $? -eq 1; then # echo "" # echo "Initialization of Teles S0/16.x failed!" # echo "Check that the values in '/etc/rc.config' are correct:" # echo "I4L_TELES_MEMBASE: ${I4L_TELES_MEMBASE}" # echo "I4L_TELES_IRQ: ${I4L_TELES_IRQ}" # echo "I4L_TELES_PORT: ${I4L_TELES_PORT}" # echo "I4L_PROTOCOL: ${I4L_PROTOCOL}" # echo "" # exit 1 # echo "never here" # fi # configure interface /sbin/isdnctrl addif ${I4L_DEV} /sbin/isdnctrl eaz ${I4L_DEV} ${I4L_LOCALMSN} for i in ${I4L_REMOTE_OUT_LIST} do /sbin/isdnctrl addphone ${I4L_DEV} out ${i} done if [ ! -z "${I4L_REMOTE_OUT1}" ]; then /sbin/isdnctrl addphone ${I4L_DEV} out ${I4L_REMOTE_OUT1} fi if [ ! -z "${I4L_REMOTE_OUT2}" ]; then /sbin/isdnctrl addphone ${I4L_DEV} out ${I4L_REMOTE_OUT2} fi for i in ${I4L_REMOTE_IN_LIST} do /sbin/isdnctrl addphone ${I4L_DEV} in ${i} done if [ ! -z "${I4L_REMOTE_IN1}" ]; then /sbin/isdnctrl addphone ${I4L_DEV} in ${I4L_REMOTE_IN1} fi if [ ! -z "${I4L_REMOTE_IN2}" ]; then /sbin/isdnctrl addphone ${I4L_DEV} in ${I4L_REMOTE_IN2} fi /sbin/isdnctrl l2_prot ${I4L_DEV} hdlc /sbin/isdnctrl secure ${I4L_DEV} on /sbin/isdnctrl encap ${I4L_DEV} syncppp /sbin/isdnctrl huptimeout ${I4L_DEV} ${I4L_IDLETIME} # enable debugging /sbin/isdnctrl verbose ${I4L_VERBOSITY} /sbin/telesctrl ${I4L_HISAX_ID} 1 ${I4L_DEBUG} # /sbin/telesctrl ${I4L_TELES_ID} 1 ${I4L_DEBUG} /sbin/isdnlog -v -t2 -m2039 -x2039 /dev/isdnctrl0 >> /var/log/isdncalls 2>&1 & host=popEUi set '' `grep $host /etc/slipoutmap` shift portnr=$2 IPNAME=$3 MTU=$4 DEFROUT=$5 LOGIN=$6 if test "$DEFROUT" = "y" then defroute=defaultroute else defroute="" fi if test "$IPNAME" = "\?" then ipdef=noipdefault else ipdef="" fi compfl="-ac -pc -bsdcomp -vj -vjccomp " acceptfl="ipcp-accept-local ipcp-accept-remote" ipppd user $LOGIN :$host $compfl $acceptfl $defroute mtu $MTU mru $MTU $ipdef $portnr ;; stop) ## turn off isdn echo "Shutting down isdn4linux..." if test -e /var/run/isdnlog.pid ; then /bin/kill `/bin/cat /var/run/isdnlog.pid` fi kill `cat /var/run/ipppd.pid` sleep 2 ps -ax | fgrep ppp kill -9 `cat /var/run/ipppd.pid` /sbin/ifconfig ippp0 down /sbin/isdnctrl delif ${I4L_DEV} for i in /var/run/mg-pid.ttyI* do kill `cat $i` done /sbin/rmmod hisax.o # /sbin/rmmod teles.o /sbin/rmmod isdn.o ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac ---------------------------------------------------------- Mit dem pid-file vom ipppd gab es ein Problem. Das pidfile wurde erzeugt, bevor sich der ipppd zum Daemon macht. Da aber verbunden damit ein fork() gemacht wird und ein neuer Prozess entsteht, "andert sich die pid und der Eintrag im pid-file stimmt nicht. Dazu folgenden patch. ---------------------------------------------------------- *** isdn4k-utils-2.0/ppp4i4k/ipppd.2.2.0f/main.c Mon Jun 3 11:23:58 1996 --- isdn4k-utils-2.0.new/ppp4i4k/ipppd.2.2.0f/main.c Wed Sep 18 21:03:54 1996 *************** *** 188,203 **** lns[i].chap_unit = lns[i].upap_unit = -1; } - /* write pid to file */ - (void) sprintf(pidfilename, "%s%s.pid", _PATH_VARRUN, "ppp??" ); - if ((pidfile = fopen(pidfilename, "w")) != NULL) { - fprintf(pidfile, "%d\n", pid); - (void) fclose(pidfile); - } else { - syslog(LOG_ERR, "Failed to create pid file %s: %m", pidfilename); - pidfilename[0] = 0; - } - #if 0 p = ttyname(0); if (p) --- 188,193 ---- *************** *** 281,287 **** perror("Couldn't detach from controlling terminal"); exit(1); } ! pid = getpid(); p = getlogin(); if (p == NULL) { pw = getpwuid(uid); --- 271,287 ---- perror("Couldn't detach from controlling terminal"); exit(1); } ! /* write pid to file */ ! pid = getpid(); ! (void) sprintf(pidfilename, "%s%s.pid", _PATH_VARRUN, "ipppd" ); ! if ((pidfile = fopen(pidfilename, "w")) != NULL) { ! fprintf(pidfile, "%d\n", pid); ! (void) fclose(pidfile); ! } else { ! syslog(LOG_ERR, "Failed to create pid file %s: %m", pidfilename); ! pidfilename[0] = 0; ! } ! p = getlogin(); if (p == NULL) { pw = getpwuid(uid); ---------------------------------------------------------- Der ISDN-Teil in /etc/rc.config (angepasst an den HiSax-Treiber) hat folgenden Inhalt: --------------------------------------------------------- # # /etc/rc.config # # Copyright (c) 1996 S.u.S.E. GmbH Fuerth, Germany. All rights reserved. # # Author: Florian La Roche , 1996 # Werner Fink , 1996 # Burchard Steinbild , 1996 # # Configuration database for shell scripts in /sbin/init.d, /sbin/SuSEconfig # and /root/bin/cron.daily # # Please edit this file and execute /sbin/SuSEconfig to configure everything. # Also don't forget to edit the following files: # - /etc/lilo.conf # - /etc/fstab # - /etc/profile # - /etc/hosts # # Last modified by Emil Stephan: 14.10.96 ... geloescht # # i4l (Teles) Configuration - 17.05.96 # Author: Klaus Franken # # # start i4l? ("yes" or "no") # I4L_START=yes # # which device to use (it is save to leave it untouched) # I4L_DEV=ippp0 # # driver-id for device (it is save to leave it untouched) # I4L_TELES_ID=Tel0 # # idletime before hangup (in seconds) # I4L_IDLETIME=0 # # remote station phone number list for dialout # I4L_REMOTE_OUT_LIST= # # remote station phone number 1 dialout # I4L_REMOTE_OUT1=0228983822 # # remote station phone number 2 dialout # I4L_REMOTE_OUT2= # # remote station phone number list for dialin # I4L_REMOTE_IN_LIST= # # remote station phone number 1 dialin # I4L_REMOTE_IN1=228983822 # # remote station phone number 2 dialin # I4L_REMOTE_IN2= # # my phone number # I4L_LOCALMSN=868269 # # Verbosity of the isdn Module # I4L_VERBOSITY=3 # # Debug Level, 4 (some..) to 31 (all messages) # I4L_DEBUG=63 # # Membase of Teles card ('0xd2000' for Teles S0/16, '0' for Teles S0/16.3) # I4L_TELES_MEMBASE=0 # # IRQ of Teles Card (12 or 15) # I4L_TELES_IRQ=10 # # Portaddress of Teles card (0xd80) # I4L_TELES_PORT=0x100 # # D-channel protocol 1=1TR6, 2=EDSS1(Euro-ISDN) # # I4L_PROTOCOL=2 # # Id of Card for HiSax Driver I4L_HISAX_ID=HiSax_0 # # Type of card for the HiSax Driver # # 1 Teles 16.0 pa=irq pb=membase pc=iobase # 2 Teles 8.0 pa=irq pb=membase # 3 Teles 16.3 pa=irq pb=iobase # 4 Creatix PNP pa=irq pb=IO0 (ISAC) pc=IO1 (HSCX) # 5 AVM A1 (Fritz) pa=irq pb=iobase # 6 ELSA PCC16 pa=iobase or nothing for autodetect I4L_HISAX_TYPE=4 # # Parameter A for the HiSax Driver (see type description) # I4L_HISAX_PA=10 # # Parameter B for the HiSax Driver (see type description) # I4L_HISAX_PB=0x0100 # # Parameter C for the HiSax Driver (see type description) # I4L_HISAX_PC=0x0140 LANGUAGE=german ----------------------------------------------------- Anmerkungen: Bei Zugang zu eunet via PersonalEunet gehen alle Aktivit"aten vom Benutzer aus, nie von Eunet. Dadurch erspart sich eunet die Abrechnung von aufgelaufenen Telekom-Kosten gegen"uber dem Benutzer. Den Timeout habe ich auf 0 Sekunden gesetzt (=ewig), weil manchmal das NEWNEWS-Kommando an den News-Server vom Programm nntpxfer den Timeout getriggert hat. Der News-Server ist nach diesem Kommando damit besch"aftigt, eine Liste von News-Artikeln zu erstellen. Wenn zu der Zeit keine "Ubertragungen von anderen Programmen laufen, schlaegt der Timeout zu. Da beim PersonalEUnet-Dienst nur der Dienst-Nutzer die Verbindung aufbaut (s.o.), kann ein Timeout die Kommunikation in folgender Situation blockieren. Programm sendet ein Paket an einen Server und wartet auf Antwort. Da Verbindung abgebrochen, kommt keine Antwort. Ohne Antwort sendet das Programm kein Paket, also kein Verbindungsaufbau. Da kein Verbindungsaufbau, kommt keine Antwort. usw. usw. Ich mache kein Dial on Demand, sondern immer "uber die Skripten. Bei Dial on Demand darf die Default-Route nicht erst vom ipppd gesetzt werden, wenn eine Verbindung aufgebaut wird, sondern vorher (zum Beispiel von i4l). Da i4l aber bei Abbau der Verbindung die Default-Route l"oscht, muss man sie in /etc/ppp/ip-down wieder neu setzen. Dieses Skript wird vom ipppd bei jedem Verbindungsabbau gestartet. Den ipppd aus der Suse-Distribution mu\3te ich durch die neue Version aus den isdn4k-utils-2.0 ersetzen. Der erste meldete folgendes beim Setzen der Default-Route: pppd[201]: default route ioctl(SIOCADDRT): Network is unreachable Er hatte vers"aumt, vorher die Route zum Gateway zu setzen und den gibt er f"ur die Default-Route als Gateway an. Ich hatte den neuen ipppd allerdings in /usr/sbin installiert und der alte war aber immer noch in /sbin. Das f"uhrte nat"urlich dazu, da\3 ich nicht verstand, warum nach dem Booten sich nichts ge"andert hatte. Nach wie vor gibt es im syslog folgende Meldung: pppd[201]: ioctl(SIOCSIFMTU): Invalid argument Weiss jemand, was hei\3t das? Hoffe, es hilft anderen, Bye Emil.