Friedrich-Alexander-Universität UnivisSuche FAU-Logo
Techn. Fakultät Willkommen am Department Informatik FAU-Logo
Logo I4
Lehrstuhl für Informatik 4
[an error occurred while processing this directive]
Please note: the information shown on these pages may be obsolete!

Dienste
  NTP
  Computer
  Printer
  FAX
  ISDN
  Security
  SSH Applet
  Online Doc
Department Informatik  >  Informatik 4  >  Dienste  >  ISDN  >  Linux-Einwahl

ISDN Einwahl von Linux

Piece of cake

Zunächst muß man natürlich den isdn Treiber in den Kern binden, die isdn4k Utilities übersetzen und installieren. Dann gehts mit dem Konfigurieren los.

Zum Debuggen empfehlen sich folgende Skripten:

  • Das dialin.stop: es hält sofort alles an. (Das ist besonders nützlich, wenn das ISDN mit einer Rate von mehreren Versuchen pro Sekunde anruft und man gern seine Telefonrechnung in Grenzen halten möchte)
    • /usr/local/bin/dialin.stop
    • #!/bin/sh
      /sbin/isdnctrl hangup ippp0 
      sleep 1
      killall -9 ipppd
  • Das showisdnlog. Damit sieht man, was das ISDN tut.
    • /usr/local/bin/showisdnlog
    • tail -f /var/log/debug &
      tail -f /var/log/syslog &
      tail -f /var/log/messages &
          

Für die ISDN Einwahl von Linux gibt es 2 Möglichkeiten: mit Callback und ohne Callback.

Einwahl ohne Callback

Let's rock

  • Die Einwahl erfolgt mit CHAP-Authentifizierung. Dazu ist ein File /etc/ppp/chap-secrets nötig, in dem das Passwort steht.
    Beispiel (marvin ist der eigene Rechnername):
    • /etc/ppp/chap-secrets
    • marvin stargate myPassword

  • Ich möchte selbst bestimmen können, wann mein Rechner anruft. D.h. geroutet wird nur über isdn, wenn ich explizit gewählt habe. Dazu sind weitere, ausführbare (Mode 755) Files in /etc/ppp nötig.
    • /etc/ppp/ip-down
    • #!/bin/sh

      # die Route muss wech:

      /sbin/ifconfig ippp0 down

    • /etc/ppp/ip-up
    • #!/bin/sh
      # Wichtig: die Route erst jetzt setzen. Sonst 
      # waehlt das ISDN um die Wette (bei callback) 
      /sbin/route add default ippp0
  • Jetzt brauchen wir nur noch das Einwahlskript:
    • Bitte das Einwahlskript auf jeden Fall editieren! Die Telefonnummer, der Rechnername (marvin in diesem Beispiel) und die IP Adresse muß stimmen!

    • /usr/local/bin/dialin
    • #!/bin/sh
      #
      # BE SURE TO EDIT THIS FILE BEFORE USING IT !!!!!
      #
      # don't forget to edit the files
      #     /etc/ppp/pap-secrets or 
      #     /etc/ppp/chap-secrets 
      #
      killall -9 ipppd
      sleep 1
      
      LOCAL_NUMBER="483131" # meine Tel. Nummer
      REMOTE_NUMBER="160097"          
      LOCAL_IP="131.188.19.18" 
      REMOTE_IP="131.188.34.123"
      DEVICE="ippp0"
      
      VERSION=`cat /proc/version | awk '{ print $3 }' `
      
      SYSPATH="/sbin/"
      
      telesctrl MyTeles 1 4      # enable verbose '4' mode
      
      isdnctrl addif  $DEVICE            # Create new interface 'DEVICE'
      isdnctrl addphone $DEVICE out $REMOTE_NUMBER   # Set outgoung phone-number
      isdnctrl eaz $DEVICE $LOCAL_NUMBER             # Set local EAZ .. 
      isdnctrl l2_prot $DEVICE hdlc      # for sync PPP: set Level 2 to HDLC
      isdnctrl l3_prot $DEVICE trans     # trans.
      isdnctrl encap $DEVICE syncppp     # encap the IP Pakets in PPP frames
      isdnctrl huptimeout $DEVICE 600    # Hangup-Timeout is 600 sec.
      isdnctrl chargehup $DEVICE off     # Hangup before next Charge-Info
      isdnctrl secure $DEVICE on         # Accept only configured phone-number
      /sbin/ifconfig $DEVICE $LOCAL_IP pointopoint $REMOTE_IP metric 1 
      
      (sleep 2; isdnctrl dial $DEVICE)&
      
      ipppd -bsdcomp name marvin ipcp-accept-local ipcp-accept-remote mru 1524 debug useifip /dev/ippp0 



Einwahl mit Callback

Payback time

Man benötigt dazu selbiges wie oben. Insbesondere die ausführbaren Skripten ip-down / ip-up sind essentiell (außer für Leute mit zu niedriger Telefonrechnung).

Die ISDN-Einwahl erfolgt mit Caller ID. Am besten nimmt man dazu die sekundäre eigene Nummer. Das hat den Vorteil, daß man über die erste Nummer ohne Callback, über die 2. Nummer mit Callback anrufen kann (muss natürlich auf dem Router so konfiguriert sein). Bitte ebenfalls das folgende dialin script modifizieren (Rechnername, Tel-Nummer, IP-Adresse).

    • /usr/local/bin/dialin.callback
    • #!/bin/sh
      #
      # BE SURE TO EDIT THIS FILE BEFORE USING IT !!!!!
      #
      # don't forget to edit the files
      #     /etc/ppp/pap-secrets or 
      #     /etc/ppp/chap-secrets 
      #
      
      killall -9 ipppd
      sleep 1
      
      LOCAL_NUMBER="483132" # Sekundaere ISDN Nummer
      REMOTE_NUMBER="160063"          
      LOCAL_IP="131.188.19.18" 
      REMOTE_IP="131.188.34.123"
      DEVICE="ippp0"
      
      VERSION=`cat /proc/version | awk '{ print $3 }' `
      
      # when setting the environment variable MODPATH you
      # can omit the full path.
      ##insmod /lib/modules/$VERSION\/net/slhc.o
      SYSPATH="/sbin/"
      
      telesctrl MyTeles 1 4      # enable verbose '4' mode
      
      isdnctrl addif  $DEVICE            # Create new interface 'DEVICE'
      isdnctrl addphone $DEVICE out $REMOTE_NUMBER   # Set outgoung phone-number
      isdnctrl eaz $DEVICE $LOCAL_NUMBER             # Set local EAZ .. 
      isdnctrl l2_prot $DEVICE hdlc      # for sync PPP: set Level 2 to HDLC
      isdnctrl l3_prot $DEVICE trans     # Level 3 ist transparent
      isdnctrl encap $DEVICE syncppp     # encap the IP Pakets in PPP frames
      isdnctrl huptimeout $DEVICE 600    # Hangup-Timeout is 600 sec.
      isdnctrl chargehup $DEVICE off     # Hangup before next Charge-Info
      isdnctrl secure $DEVICE on         # Accept only configured phone-number
      isdnctrl addphone $DEVICE in 9131160063
      isdnctrl addphone $DEVICE in 9131160086
      isdnctrl addphone $DEVICE in 9131160097
      
      isdnctrl dialmax $DEVICE 1
      isdnctrl cbdelay $DEVICE 300
      
      /sbin/ifconfig $DEVICE $LOCAL_IP pointopoint $REMOTE_IP metric 1 
      (sleep 2; isdnctrl dial $DEVICE; sleep 1; ifconfig ippp0 down; ifconfig ippp0 up)&
      
      exec ipppd -bsdcomp name marvin-c ipcp-accept-local ipcp-accept-remote mru 1524 debug useifip /dev/ippp0

Allgemeines

Einwahl geht durch das entsprechende Dialin Script, auflegen mit dem dialin.stop. Nach einer gewissen Idle-Zeit legt der Ascend router automatisch auf, dann muß man das entsprechende dialin-Script einfach nochmal neu starten. KEINESFALLS die route stehen lassen. Wenn das ip-down die route nicht weg löscht, erfolgt danach Anruf-polling mit mehreren Versuchen pro Sekunde!
(Wie siehts aus mit dem Spielchen: Wer-schafft-am-meisten-Einheiten-pro-Sekunde?)

Ich weiß, daß die Lösung für Callback ein Hack ist. Der Linux PPP Daemon kann kein richtiges Callback ("Nanu, warum ruft mich denn jemand an? Wenn hier jemand anruft, bin ICH das"). Daher der Hack mit dem sleep 1. Nuja, es funktioniert wenigstens...

Much Fun

    Thomas Riechmann

  Impressum   Datenschutz Stand: 2003-09-11 18:08