|
|
|
|
| Inhalt dieses Dokuments |
|---|
|
1) Worum es gehen soll... 2) Was man benötigt 3) Eine simple ISDN-Konfiguration 4) Multiline PPP (manuell) 5) Die Automatisierung A) Die uneditieren Konfigurationsdateien B) Mein Initskript für ibod |
|
|
|
Dieses Dokument soll sich mit ISDN-Kanalbündelung unter Linux beschäftigen (speziell unter Debian potato, aber ich bemühe mich es so allgemein, wie nur möglich zu halten), wie man es einrichtet, nutzt und nicht zuletzt automatisiert. Warum, in einer Zeit, in der DSL und andere Breitbandanbindungen zu haben sind? Ganz einfach, auch wenn in der Werbung suggeriert wird, das DSL jederzeit und sofort zu haben ist, oft ist dem nicht so und noch öfter stellt sich die Frage nach dem nutzen von DSL, wenn gelegentliche Kanalbündelung ohne Mehrkosten ausreicht oder vielleicht auch nur, um zu wissen, wie es geht. <g> In eigener Sache: Ich bemühe mich alles so wasserdicht wie möglich zu machen, aber es können sich natürlich Fehler einschleichen, ich hafte also in keiner Weise für Schäden an Hardware, Leib und Leben (wer also diesen Text liest, während er Auto fährt tut das auf eigenes Risiko) oder durch den zweiten Kanal zusätzlich verursachte Kosten. Entdeckst Du Fehler, kommen zusätzliche Fragen auf oder hast Du Anregungen und Ergänungen so schicke mir bitte eine eMail. Was xibod angeht: Die Erweiterung ist in Arbeit. |
|
|
Man unbedingt benötigt:
|
|
|
|---|
|
Am Anfang steht die Konfiguration der ISDN-Hardware, wer das schon erledigt hat darf getrost diesen Abschnitt überspringen und im nächsten Abschnitt weitermachen. Unter Debian macht man das am geschicktesten, indem man als Superuser root das Kommando isdnconfig startet. Dann wird man mit folgendem Menü begrüßt: Isdnutils configuration ======================= 1 network devices 2 synchronous ppp daemon 3 modem emulation 4 isdnlog configuration 5 voice box configuration Q Quit Your choice : Wichtig für Kanalündelung sind die ersten beiden Punkte (den dritten nehmen wir auch dazu, der Vollständigkeit halber) also wählt man zunächst die 1 und gelangt in das nächste Menü: Isdnutils configuration network interfaces ======================= ------------------ Searching for existing configuration files... Found : NONE Devices should be named : - rawip interface isdn0 isdn1 ... - synchronous ppp interface ippp0 ippp1 ... Name for new interface : Taucht hier "Found : ippp0" statt "Found : NONE" auf, dann besitzt man schon eine (wenn auch vielleicht unvollständige) ISDN-Konfiguration, was das Netzdevice angeht. Ist das nicht der Fall gibt man einfach ippp0 ein, die Konfigurationsdatei wird dann automatisch in einer Basisversion im Verzeichnis /etc/isdn/ erstellt. Nun kommt man wieder in das Anfangsmenü und wählt die 2, es erscheint folgendes Menü: Isdnutils configuration synchronous ppp daemon ======================= ---------------------- Searching for existing configuration files... Found : NONE Normal setup : one ipppd for all devices: /dev/ippp0 /dev/ippp1 ... All ippp* network interfaces are handled by a single ipppd process using a single config file. Special setup : one ipppd for each device: /dev/ippp0 /dev/ippp1 ... Each ippp* network interface is handled by its own ipppd process, using a specific config file for each. You need to use pppbind on each network interface to select which /dev/ippp* device will be used. Usually only a single ippp interface is used (for connecting to an ISP), so the above isn't really relevant to most users. Name for new configuration (ippp0 ippp1 ...) : Hier verfährt man wie schon im ersten Menü, falls noch nicht vorhanden ippp0 angeben und fertig. Nun noch schnell im Anfangsmenü mit 4 isdnlog konfigurieren, dann ist man schon fast fertig. Isdnutils configuration isdnlog ======================= ------- Installing example configuration files ... Searching for existing configuration files... Found : NONE You need one options file per isdn card. This file is named like the device it uses to get the data. isdnctrl0 isdnctrl2 ... An exception is if you want to run isdnlog in "dual mode"; this means the second isdn card is connected "in reverse" so that it can monitor _outgoing_ traffic. In that case, only specify one options file. Name of the device : Auch hier wird, wenn noch nicht vorhanden wieder ippp0 angegeben und fertig ist man mit den erstellen der Konfigurationsdateien. Vorsicht, diese Konfigurationsdateien müssen vor Benutzung noch an die jeweiligen Bedürfnisse angepasst werden, noch funktioniert es nicht! Nun sollte es folgende Konfigurationsskripte in /etc/isdn/ geben: -rw-r--r-- 1 root root 1091 Sep 26 14:05 callerid.conf -rw-r--r-- 1 root root 12272 Sep 26 14:05 device.ippp0 -rw-r--r-- 1 root root 4444 Sep 26 14:05 ipppd.ippp0 -rw-r--r-- 1 root root 857 Sep 26 14:05 isdn.conf -rw-r--r-- 1 root root 1168 Sep 26 14:05 isdnlog.ippp0 Von der Masse sollte man sich nicht erschrecken lassen, primär interessieren davon erst einmal device.ippp0 und ipppd.ippp0, die anderen sind für den reinen Betrieb nicht allzu wichtig. Das Editieren der Konfigurationsdateien ist nicht weiter schwer, da sie gut kommentiert sind, folgendes sollte man, um es parat zu haben, aber trotzdem vorher einmal zusammentragen (ein paar Punkte sind wohl selbstverständlich):
Beginnen wir hier mit ipppd.ippp0 (im folgenden greife ich nur die essentiellen Zeilen aus den komplett unten angegebenen Dateien heraus, alles was mit einer Raute (#) beginnt ist ein Kommentar und wird ignoriert (alles was ich nicht explizit anspreche kann eigentlich so bleiben): # ipppd will not read /etc/ppp/options or /etc/ppp/ioptions or any other # config file. Everything has to be in here. Das ist recht wichtig, wenn man an seiner Konfiguration weiterbasteln will, also im Hinterkopf behalten. # REMOVE the next line once configuration is complete ######################### # Warning! not configured yet! # REMOVE the above line once configuration is complete ######################## Diese drei Zeilen müssen entfernt werden, ansonsten funktioniert es nicht (am besten macht man das am Schluß, da es am Anfang steht kommt hier die Erläuterung). #debug # enable debugging Lassen wir, weil wir optimistisch sind erst einmal, wie gehabt auskommentiert, sollte etwas nicht funktionieren, einfach die Raute entfernen und aus der Fülle an Informationen auf den Fehler schliessen. lock # create a lock file for device Schadet nicht. pidfile /var/run/ipppd.ippp0.pid # save pid in file X Dito. idle 90 # idle time limit (seconds) Die Zeit, die vergehen muß, bevor die Verbindung getrennt wird, 90 ist imho ein ganz brauchbarer Wert, das muß man im Zweifelsfall einfach austesten. #+mp # enable multi line ppp Dazu kommen wir im nächsten Abschnitt, noch kann es auskommentiert bleiben. name meinusername # set local name for auth XXX_ Hier wird der Username angegeben, der vom Provider vergeben ist. netmask 255.255.255.255 # set netmask, 255.255.255.255 is for pointopoint Wir wollen PPP, also gehört hier die Netmask 255.255.255.255 hin. #ms-get-dns # accept peers suggestion of dns address (dialout) Kann mann machen, muß man aber nicht, wenn die IPs der Nameserver des Providers bekannt sind. Ich habe es der Einfachheit fest und nutze dies hier nicht. ipcp-accept-local # Accept peer's address for us ipcp-accept-remote # Accept peer's address for it Wir bekommen dynamisch eine IP, also muß dies hier stehen. Damit wäre /etc/isdn/ipppd.ippp0 abgehagt, wenn es um Kanalbündelung geht kommen wir noch einmal zu dieser Konfigurationsdatei zurück. Als nächstes steht device.ippp0 auf dem Programm, hier muß ein bißchen mehr geändert werden, die Stellen sind aber in der Regel mit XXX_ markiert (ich beschränke mich wieder auf die Änderungen zur Rohkonfiguration, die isdnconfig schon geliefert hat): # REMOVE the next line once configuration is complete ######################### echo "Warning! $0 not configured yet! Aborting..."; exit 1 # REMOVE the above line once configuration is complete ######################## Das wird wieder entfernt, sonst will es nicht. # Instructions: read the comments for each command, and if necessary, edit # the command (e.g. replace EAZ with your real EAZ or MSN). Look for lines # marked with XXX_, which is probably all you need to change. Mehr habe ich eben ja auch nicht gesagt. LOCALIP=10.0.0.1 # XXX_ REMOTEIP=10.0.0.2 # XXX_ Wir haben dynamische Adressen, also kommen hier (wie im darüberstehenden Kommentar erläutert) die Dummy-IP-Adressen zum tragen. LOCALMSN=41 # XXX_ Hier wird die lokale MSN eingetragen, da ich eine Telefonanlage nutze gebe ich hier meine interne MSN an, hängt die ISDN-Karte am externen S0-Bus (also direkt am NTBA) trägt man hier die Telefonnummer (ohne Vorwahl) ein, die als MSN übermittelt werden soll. REMOTEMSN=0191011 # XXX_ Hier trägt man die Telefonnnummer des Providers ein (auch wenn ich nicht T-Online nehme hier ist es die T-Online-Einwahlnummer). LEADINGZERO=0 # XXX_ use LEADINGZERO='' if you have no areacodes. Ich habe zwar keine Areacodes in Benutzung, aber da man eine Null für ein Amt benötig lasse ich sie hier stehen. Alternativ könnte ich sie vor die Einwahlnummer setzen. DIALMODE=auto # XXX_ other values can be 'on' and 'off' Das bedeutet so viel wie "DialOnDemand". [ -f /proc/sys/net/ipv4/ip_dynaddr ] && echo 5 > /proc/sys/net/ipv4/ip_dynaddr Da wir eine dynamische IP-Adresse bekommen, darf diese Zeile nicht auskommentiert werden. isdnctrl huptimeout ${device} 90 # XXX_ Wie schon in der letzten Konfigurationsdatei wird hier wieder die gewünschte Leerlaufzeit eingetragen, bevor die Leitung gekappt wird. isdnctrl dialmax ${device} 50 Wenn es 50 Mal nicht funktioniert hat geben wir auf den Provider anzuwählen. isdnctrl verbose 2 Wir wollen nicht allzu viele Statusmeldungen in den Logdateien, also setzen wir hier auf zwei, im Zweifelsfall oder bei Problemen hilft ein erhöhen auf drei, um eventuelle Fehler aufzudecken. Das war es fürs erste, auch /etc/isdn/device.ippp0 ist vorerst fertig, um einen simplen Betrieb mit einem B-Kanal zu bewerkstelligen. Zu guter letzt widmen wir uns isdnlog.ippp0, auch hier gibt es nicht viel zu ändern, die Einstellungen sind in der Regel sinnvoll und ausreichend. # REMOVE the next line once configuration is complete ######################### # Warning! not configured yet! # REMOVE the above line once configuration is complete ######################## Also weg damit. log=5 # log d-channel messages. value may be 0-15 (bit coded flags) Der Wert ist brauchbar. Mehr muß nicht geändert werden, man mag es spartanisch nennen, aber es funktioniert. Fast als letztes muss noch das Passwort für den Internetzugang in /etc/ppp/papsecrets und /etc/ppp/chapsecrets eingetragen werden. Nun muss noch die geänderte Konfiguration geladen werden, das geht zum einen über den Umweg Reboot oder viel eleganter, indem man die ISDN-Utils mit /etc/init.d/isdnutils restart neu startet. Nun kann man den ersten Verbindungsaufbau wagen und gibt als Superuser root isdnctrl dial ippp0 ein, dann sollte in /var/log/messages folgendes auftauchen: Sep 27 20:47:30 cerberus kernel: ippp0: dialing 1 00192145... Sep 27 20:47:31 cerberus kernel: isdn_net: ippp0 connected Sep 27 20:47:31 cerberus ipppd[32691]: Local number: 41, Remote number: 00191011, Type: outgoing Sep 27 20:47:31 cerberus ipppd[32691]: PHASE_WAIT -> PHASE_ESTABLISHED, ifunit: 0, linkunit: 1, fd: 9 Sep 27 20:47:32 cerberus ipppd[32691]: MPPP negotiation, He: Yes We: Yes Sep 27 20:47:32 cerberus ipppd[32691]: CCP enabled! Trying CCP. Sep 27 20:47:32 cerberus ipppd[32691]: CCP: got ccp-unit 0 for link 1 (protocol: 0x80fd) Sep 27 20:47:32 cerberus ipppd[32691]: ccp_resetci! Sep 27 20:47:32 cerberus ipppd[32691]: local IP address 212.62.65.187 Sep 27 20:47:32 cerberus ipppd[32691]: remote IP address 212.62.64.10 Mit imon oder imontty läßt sich der Status der beiden B-Kanäle bequem abfragen, man kann dies aber auch mit isdnctrl status ippp0 tun, ist nur mehr zu tippen. Um keine Gebühren zu verschwenden trennen wir die Leitung wieder mit isdnctrl hangup ippp0, dann sollte in messages folgendes auftauchen: Sep 27 20:51:53 cerberus kernel: isdn_net: local hangup ippp0 Sep 27 20:51:53 cerberus kernel: ippp0: Chargesum is 0 Sep 27 20:51:53 cerberus ipppd[32691]: Modem hangup Sep 27 20:51:53 cerberus ipppd[32691]: Connection terminated. Sep 27 20:51:53 cerberus ipppd[32691]: taking down PHASE_DEAD link 1, linkunit: 1 Sep 27 20:51:53 cerberus ipppd[32691]: closing fd 9 from unit 1 Sep 27 20:51:53 cerberus ipppd[32691]: link 1 closed , linkunit: 1 Sep 27 20:51:53 cerberus ipppd[32691]: reinit_unit: 1 Sep 27 20:51:53 cerberus ipppd[32691]: Connect[1]: /dev/ippp0, fd: 9 Sep 27 20:51:54 cerberus kernel: isdn: HiSax,ch0 cause: E0010 Das ist wieder selbsterklären, zu sagen ist vielleicht nur, daß man eine Aufschlüsselung der ISDN cause Meldungen in der Manpage isdn_cause (7) findet. Herzlichen Glückwunsch, Internet mit einer ISDN-Karte funktioniert (wenn auch nur mit einem B-Kanal). Das ist eine solide Arbeitsgrundlage für den nächsten Schritt. |
|
|
|---|
|
Erst einmal sollte man herausfinden, ob der Provider Kanalbündelung erlaubt und, was sicherlich nicht ganz unwichtig ist, ob es extra kostet. Natürlich gibt es mehrere Möglichkeiten das zu tun, man kann in eine informationsbroschüre gucken, die Provider-Hotline bemühen oder sehen, was die Logdateien sagen. Wenn beim Verbindungsaufbau etwas in dieser Richtung in /var/log/messages landet: Sep 27 20:47:32 cerberus ipppd[32691]: MPPP negotiation, He: Yes We: Yes unterstützt der Provider MPPP (es kommt auf das "MPPP negotiation, He: Yes" an). Der nächste Schritt ist nun die Konfigurationsdateien so abzuändern, daß es möglich ist einen zweiten B-Kanal hinzuzuschalten. Das ist nicht weiter schwer. Hierzu nimmt man sich zwei Konfigurationsdateien (ipppd.ippp0 und device.ippp0)noch einmal vor. Die Änderung in ipppd.ippp0 ist denkbar einfach, hier sucht man sich die Zeile: #+mp # enable multi line ppp Setzt davor eine neue Zeile mit folgendem Inhalt: /dev/ippp1 und entfernt die Raute vor +mp (das wars auch schon). In /etc/isdn/device.ippp0 ist ein bißchen mehr hinzuzufügen. Vor # NETWORK SETUP fügt man folgendes ein: # Channel bundling Damit man später auch noch weiß, warum das hier steht. SLAVE=ippp1 Hier wird der Name für das Slavedevice (das Device, das zum ersten Kanal zugeschaltet wird und auch schon in ipppd.ippp0 steht) angegeben. isdnctrl addslave ${device} $SLAVE bindnum=`expr $SLAVE : 'ippp\(.\)'` if [ ! -z "$bindnum" ] then isdnctrl pppbind $SLAVE $bindnum fi Analog zu Bindung des ersten Kanals bindet man hier den zweiten. if [ ! -z "$REMOTEMSN" ] then for MSN in $REMOTEMSN; do isdnctrl addphone $SLAVE out 0$REMOTEMSN done fi isdnctrl eaz $SLAVE 41 Hier wird die MSN zugewiesen. isdnctrl l2_prot $SLAVE hdlc isdnctrl l3_prot $SLAVE trans isdnctrl encap $SLAVE syncppp Protokolle, wie oben. isdnctrl huptimeout $SLAVE 60 Das ist auch bekannt. isdnctrl secure $SLAVE on isdnctrl dialmode $SLAVE $DIALMODE || true Hier wird der Wählmodus zugewiesen, den auch das Masterdevice hat. Nun kann man, nachdem man die isdnutils neu gestartet hat (/etc/init.d/isdnutils restart) wie schon im vorherigen Abschnitt eine Verbindung aufbauen und mit isdnctrl addlink ippp0 den zweiten B-Kanal zuschalten, in den Logfiles taucht dann folgendes auf: Sep 27 22:48:58 cerberus kernel: ippp1: dialing 1 00191011... Sep 27 22:49:00 cerberus ipppd[32691]: Local number: 41, Remote number: 00191011, Type: outgoing Sep 27 22:49:00 cerberus ipppd[32691]: PHASE_WAIT -> PHASE_ESTABLISHED, ifunit: 1, linkunit: 0, fd: 8 Sep 27 22:49:00 cerberus kernel: isdn_net: ippp1 connected Sep 27 22:49:00 cerberus ipppd[32691]: MPPP negotiation, He: Yes We: Yes Sep 27 22:49:00 cerberus ipppd[32691]: ipppd[0]: discr: 2 Sep 27 22:49:00 cerberus ipppd[32691]: ipppd[0]: passed 1 Sep 27 22:49:00 cerberus ipppd[32691]: ipppd[0]: passed 2 Sep 27 22:49:00 cerberus ipppd[32691]: ipppd[0]: pap/chap-check passed Sep 27 22:49:00 cerberus ipppd[32691]: ok, found a valid bundle with linkunit 1 Sep 27 22:49:00 cerberus ipppd[32691]: bundle: 0 Einen Kanal abschalten kann man dann mit isdnctrl removelink ippp0, auch das wird in /var/log/messages dokumentiert: Sep 27 22:54:59 cerberus kernel: isdn_net: local hangup ippp1 Sep 27 22:54:59 cerberus kernel: ippp1: Chargesum is 0 Sep 27 22:54:59 cerberus ipppd[32691]: Modem hangup Sep 27 22:54:59 cerberus ipppd[32691]: Connection terminated. Sep 27 22:54:59 cerberus ipppd[32691]: taking down PHASE_DEAD link 0, linkunit: 0 Sep 27 22:54:59 cerberus ipppd[32691]: closing fd 8 from unit 0 Sep 27 22:54:59 cerberus ipppd[32691]: link 0 closed , linkunit: 0 Sep 27 22:54:59 cerberus ipppd[32691]: reinit_unit: 0 Sep 27 22:54:59 cerberus ipppd[32691]: Connect[0]: /dev/ippp1, fd: 8 Sep 27 22:55:00 cerberus kernel: isdn: HiSax,ch1 cause: E0010 Da es jetzt funktioniert, auf zur Automation. |
|
|
|---|
|
Um das ganze zu automatisieren benötigt man ein zusätzliches Programm ibod (Internet Bandwith on Demand), das die Auslastung des ersten B-Kanals überprüft und ab einer Grenze, die man selber setzen kann, einen zweiten B-Kanal hinzuschaltet, fällt die Übertragunsrate wieder unter das, was auch ein B-Kanal übertragen kann, wird der zweite B-Kanal wieder getrennt. Falls man ibod noch nicht heruntergeladen hat, sowohl die Sourcen als auch eine vorkompilierte Version gibt es hier. Zunächst zur Konfigurationsdatei, sie ist denkbar simpel und liegt in der Standardeinstellung in /etc/ppp/ibod.cf, gefällt das nicht, kann man sie an einem beliebigen anderen Ort erstellen, muß dann aber bevor man ibod startet die Shellvariable IBOD_HOME mit dem entsprechenden Verzeichnis setzten (bei der Bash: export IBOD_HOME=/meinverzeichnis). Im folgenden gehe ich mal davon aus, das die Konfigurationsdatei in /etc/isdn/ liegt. Es gibt recht wenige Einstellungen zu machen, also geht man die Konfigurationsdatei einfach durch (die einleitenden Kommentare habe ich hier mal gekürzt, sie finden sich auch in der Manpage ibod.cf (4)): DEVICE ippp0 Legt fest, welches Device ibod überwachen soll. INTERVAL 500 Hier wird der Messintervall (in Millisekunden) festgelegt. FILTER 15 Hier wird festgelegt, wie oft die Messung über dem Limit liegen muß. Erst, wenn die Übertragunsrate über dieses Messintervall in Millisekunden über dem mit LIMIT angegebenen Wert lag, wird der zweite Kanal hinzugeschaltet oder, wenn die übertragungsrate wieder darunter liegt abgebaut. Wählt man diesen Wert klein (Standardwert ist 5, ich habe 15 gewählt) wird der Kanal schnell auf und wieder abgebaut. LIMIT 7000 Zu guter letzt das Limit, das überschritten bzw. unterschritten werden muß. Um das obige zu testen startet man ibod mit den Kommandos export IBOD_HOME=/etc/isdn (unsere Konfigurationsdatei liegt ja nicht im Standardverzeichnis) und ibod & (das "&" ist unheimlich wichtig, damit unser Daemon auch im Hintergrund läuft). Nun kann man ein bißchen Traffic erzeugen (den aktuellen Kernel herunterladen <g>) und mit imon überprüfen, ob ein zweiter Kanal zugeschaltet wird. Zu guter letzt sollte man dafür sorge tragen, daß ibod auch nach jedem Reboot wieder geladen wird. Hier gibt es natürlich auch eine Menge von Möglichkeiten, ich gehe auf zwei ein. Die erste ist Methode simpel, die zweite dafür wesentlich eleganter. Methode #1: Man trägt die beiden Befehle (wie sie ein Stück weiter oben stehen) in /etc/init.d/bootmisc.sh ein. Methode #2: Man nutzt mein Initskript, das in Anhang B mitgeliefert wird. |
|
|
|---|
|
Wer keine Lust hat isdnconf aufzurufen kann die Dateien auch per Cut&Paste erstellen (das empfehle ich aber nicht, schneller geht es sicherlich auch kaum). Einfach in /etc/isdn/ die Textdateien erstellen und das folgende hineinkopieren... ipppd.ippp0 # Options file for ipppd. # ipppd will not read /etc/ppp/options or /etc/ppp/ioptions or any other # config file. Everything has to be in here. # REMOVE the next line once configuration is complete ######################### # Warning! not configured yet! # REMOVE the above line once configuration is complete ######################## # "peer" is the name for our syncppp partner. # STANDARD OPTIONS #debug # enable debugging #kdebug X # set kernel debugging level to X #nodetach # (no) fork to the background #callback X # ask for callback (parameter X ?) #lock # create a lock file for device #domain X # add domain X to a given hostname #pidfile X # save pid in file X #call X # take options from privileges file (???) #idle X # idle time limit (seconds) #holdoff X # holdoff time limit (seconds) #maxconnect X # set maximum connection time (in seconds ?) #+mp # enable multi line ppp #+pwlog # log password (WARNING: possible security hole) #nomagic # magic number negotiation # ppp handshake : tuning #silent # don't even try to initiate the connection #passive # wait for the peer to initiate the connection #lcp-echo-failure X # consecutive echo failures #lcp-echo-interval X # time for lcp echo events lcp-restart 1 # Set timeout for LCP #lcp-max-terminate X # Set max #xmits for term-reqs #lcp-max-configure X # Set max #xmits for conf-reqs #lcp-max-failure X # Set max #conf-naks for LCP # AUTHENTICATION name X # set local name for auth XXX_ #user X # set name for auth with peer; default is value for name #usehostname # use hostname for auth #remotename X # set remote name for auth #noauth # (dont) require peer (the other) to auth #require-pap # allow only pap authentication (dialin only) #require-chap # allow only chap authentication (dialin only) #login # use system password database for pap #papcrypt # pap passwords are encrypted # AUTHENTICATION TUNING #pap-restart X # Set retransmit timeout for PAP #pap-max-authreq X # Set max #xmits for auth-reqs #pap-timeout X # Set time limit for peer PAP auth. #chap-restart X # Set timeout for CHAP #chap-max-challenge X # Set max #xmits for challenge #chap-interval X # Set interval for rechallenge # COMPRESSION #noaccomp # address compression on/off #nopcomp # protocol field compression on/off #novj # van jacobsen compression on/off #novjccomp # van jacobsen connection-ID compression on/off #vj-max-slots X # tune maximum vj header slots #nobsdcomp # bsd compression on/off #nodeflate # deflate compression on/off #nopredictor1 # predictor1 compression in/off noccp # compression negotation on/off nolzs # LZS compression off (not yet supported fully) # IP NETWORKING #noip # en/disable ip transfer #X:Y # set local ip to X, remote ip to Y noipdefault # don't use name for default ip addr #useifip # use ip addresses form interface #usefirstip # use first ip from auth file for remote netmask 255.255.255.255 # set netmask, 255.255.255.255 is for pointopoint #defaultroute # (dont) set default route nohostroute # dont set host route #noproxyarp # (dont) set an proxy arp entry #mru X # set maximum size of recive units to X #default-mru # disable mru negotation mtu 1500 # set maximum size of transmit units to X (1500 is OK) #useifmtu # use mtu from interface #ipparam X # set ip parameters in script X #ms-dns X # dns address for the peers use (dialin only) #ms-wins X # wins address for the peers use (dialin only) #ms-get-dns # accept peers suggestion of dns address (dialout) #set_userip # define valid ip addresses in /etc/ppp/useriptab #ipcp-restart X # Set timeout for IPCP #ipcp-max-terminate X # Set max #xmits for term-reqs #ipcp-max-configure X # Set max #xmits for conf-reqs #ipcp-max-failure X # Set max #conf-naks for IPCP ipcp-accept-local # Accept peer's address for us ipcp-accept-remote # Accept peer's address for it # IPX NETWORKING #noipx # en/disable ipx #ipx-network X # IPX network number #ipxcp-accept-network # Accept peer netowrk #ipx-node X # IPX node number #ipxcp-accept-local # Accept our address #ipxcp-accept-remote # Accept peer's address #ipx-routing X # IPX routing proto number #ipx-router-name X # IPX router name #ipxcp-restart X # Set timeout for IPXCP #ipxcp-max-terminate X # max #xmits for term-reqs #ipxcp-max-configure X # max #xmits for conf-reqs #ipxcp-max-failure X # max #conf-naks for IPXCP device.ippp0 #!/bin/sh # REMOVE the next line once configuration is complete ######################### echo "Warning! $0 not configured yet! Aborting..."; exit 1 # REMOVE the above line once configuration is complete ######################## # Instructions: read the comments for each command, and if necessary, edit # the command (e.g. replace EAZ with your real EAZ or MSN). Look for lines # marked with XXX_, which is probably all you need to change. # If the command is commented out, remove the leading '#' to enable it if # the command is needed. # # After you have configured this file, remove the "Warning!" line above to # enable this file. # If using dynamic IP addresses: # Check out the /etc/ppp/ip-up.d/isdnutils and /etc/ppp/ip-down.d/isdnutils # scripts, to ensure that any routing is done correctly there (the # ip-up.d/isdnutils script is run after a syncPPP link is established, and the # ip-down.d/isdnutils script is run after the link goes down). # You need to have the ppp package installed for those scripts to work. set -e # exit on _any_ error # Get the device name device=`basename $0`; device=${device#*.} # The (dummy) IP addresses # # Use 10.0.0.1 for LOCALIP and 10.0.0.2 for REMOTEIP if you have # dynamic IP addresses; with static address fill in the real values! LOCALIP=10.0.0.1 # XXX_ REMOTEIP=10.0.0.2 # XXX_ # Phone numbers (without the leading zero) # # REMOTEMSN may be a list of numbers to dial, separated by a space. # If you do that, DO put quotes around the whole value! Like: # REMOTEMSN='221345788 221345789' # # The REMOTEMSN must be the areacode (without the leading zero) + phonenumber! # # Example: areacode: 0221 phonenumber: 345789 # => REMOTEMSN='221345789' # # EXPLANATION: # A zero is added below when it is used as the outgoing number; # when it it used as the incoming number, it must be without a leading zero # (which is why you must leave that leading zero out below). # The local number must also be given without the leading zero! # # EXCEPTION: # In countries where there are NO areacodes, this leading zero must NOT be # added. In that case, change the value of LEADINGZERO below to '' # LEADINGZERO could conceivably need to be something else in certian # situations, so it is configurable. LOCALMSN=203123456 # XXX_ REMOTEMSN=221345789 # XXX_ LEADINGZERO=0 # XXX_ use LEADINGZERO='' if you have no areacodes. # DIALMODE: # New with kernel 2.0.36 is the `dialmode' setting. # dialmode=auto is compatible with the old behaviour (dial-on-demand enabled). # Read the isdnctrl manpage for more info. # Change the value below if you want a different setting when the interface is # started. DIALMODE=auto # XXX_ other values can be 'on' and 'off' # Encapsulation (default is syncppp for ipppX devices, rawip for isdnX devices) # Change the next four lines if you need some other value. if expr ${device} : ippp > /dev/null then ENCAP=syncppp else ENCAP=rawip fi # Configuration (start) case "$1" in start) # XXX_ # If running kernel 2.0.31 or higher, enable the IP dynamic hack # (if needed). See linux/Documentation/networking/ip_dynaddr.txt . # Default is: enabled. If you have static IP numbers, you can remove # the next line. [ -f /proc/sys/net/ipv4/ip_dynaddr ] && echo 5 > /proc/sys/net/ipv4/ip_dynaddr # First you need to create the interface isdnctrl addif ${device} # eaz name num # Set the EAZ (German 1TR6 protocol) or MSN (Euro-ISDN E-DSS1) for # interface "name" to "num". For an EAZ this is only one digit, for a # MSN "num" is the whole MSN. # In the Netherlands this includes the areacode, but not the leading 0. # (other countries?) isdnctrl eaz ${device} $LOCALMSN # addphone name out num # Set the phone number(s) of the remote site for the IP-interface # "name". More than one number can be set by calling isdnctrl addphone # repeatedly. If more than one number is set these will be tried one # after another. When using an german SPV-type connection, with a # ICN-card, the number has to be preceeded by a capital S. # This is the "normal" number. if [ ! -z "$REMOTEMSN" ] then for MSN in $REMOTEMSN; do isdnctrl addphone ${device} out $LEADINGZERO$MSN done fi # addphone name in num # Set the phone number(s) that the IP-interface "name" is supposed to # accept for incoming calls. If no number is given, incoming calls are # disabled. More than one number can be set by calling isdnctrl addphone # repeatedly. Also wildcards can be used (see below). # In the Netherlands (and elsewhere?), # this is with areacode but without leading 0 #if [ ! -z "$REMOTEMSN" ] #then # for MSN in $REMOTEMSN; do # isdnctrl addphone ${device} in $MSN # done #fi # secure name on|off # Turns on or off the security feature for interface "name". If set to # on, incoming calls will only be accepted if the calling number has # been added to the access list with isdnctrl addphone name in. isdnctrl secure ${device} on # huptimeout name seconds # Set the hangup timeout for interface "name" to "seconds". If there # is inactivity (i.e. no traffic on the interface) for the given time # the driver automatically shuts down the connection. # Default is 60 seconds isdnctrl huptimeout ${device} 60 # XXX_ # dialmax name num # Set the number of dial atempts for interface "name" to "num". If # dialing, each phonenumber is tried this many times before giving up. #isdnctrl dialmax ${device} NUM # ihup name on|off # Turn on or off the hangup timeout for incoming calls on interface name #isdnctrl ihup ${device} on # encap name encapname # Set the encapsulation mode for interface "name". Possible modes for # encapname are: rawip ip cisco_h ethernet syncppp uihdlc # (most people use rawip, syncppp or cisco_h; syncppp is normal for # ISP's, rawip is normal for semi-fixed linux-linux connections) isdnctrl encap ${device} $ENCAP # l2_prot name protocol # Set the layer-2 protocol for interface "name". Possible values for # "protocol" are x75i, x75ui, x75bui and hdlc # (most people use hdlc) isdnctrl l2_prot ${device} hdlc # l3_prot name protocol # Set the layer-3 protocol for interface "name". At the moment only # trans is supported. If protocol is omitted the current setting is # printed. isdnctrl l3_prot ${device} trans # verbose num # Set verbosity level to # (2 shows the first package of every connection, that is very useful.) # WARNING: this is a global parameter, that affects all isdn devices! isdnctrl verbose 2 # CHARGEHUP FUNCTION # chargehup name on|off # Turn on or off hangup before next charge info for interface name. This # can only be used if the ISDN provider transmits charge info during and # after the connection. If set to on, the driver will close the # connection just before the next charge info will be received if the # interface is inactive. #isdnctrl chargehup ${device} on # chargeint name seconds # When "seconds" are given, the charge interval for the given interface # is set. This may be of use on ISDN lines with no chargeinfo or no # online chargeinfo. The connection will only be closed 2 seconds before # the end of the next charge interval and only, if huptime out seconds # of inactivity have been reached. If ihup is on, also incomming # connections are closed by this mechanism. #isdnctrl chargeint ${device} NUM # CALLBACK FUNCTION # callback name off|in|out # Selects callback mode for interface "name". If call-back mode is in, # then after getting an incoming call, a callback is triggered. If # callback mode is out, then this system does the initial call, then # waiting for callback of the remote machine. #isdnctrl callback ${device} MODE # cbdelay name seconds # Set the callback delay for interface "name" to "seconds". If callback # mode for this interface is in, dialing is delayed the given time. If # the callback mode is out, after dialing out and waiting the given # time, a hangup is issued to free the line for the incoming callback # from the remote machine. This hangup-after-dial is disabled by setting # cbdelay to 0. #isdnctrl cbdelay ${device} SECONDS # cbhup name on|off # Turns on or off Hangup (Reject) for interface "name" before starting # Callback. #isdnctrl cbhup ${device} MODE # OTHER OPTIONS # There are other options not used by most people. You can insert these # options here. # See also : isdnctrl(8), isdnctrl help text # pppbind is needed when using one ipppd per ippp interface # (like Debian does) bindnum=`expr $device : 'ippp\(.*\)'` || true if [ ! -z "$bindnum" ] then isdnctrl pppbind ${device} $bindnum fi # NETWORK SETUP # Network device setup as usual. # See also : ifconfig(8) route(8) or any book about unix networking. ifconfig ${device} $LOCALIP pointopoint $REMOTEIP netmask 255.255.255.255 ifconfig ${device} up set +e # ignore errors from here on route del -host $REMOTEIP ${device} 2>/dev/null route add -host $REMOTEIP ${device} # setting default route here is only useful if this is your only # outside connection... The default is ippp0 for the default route. if [ "$bindnum" = 0 ]; then route del default 2>/dev/null route add default netmask 0 ${device} fi # FIREWALL RULES XXX_ # Explicitly list what's allowed, and then deny the rest. # I'm assuming kernel 2.2.x here, hence ipchains instead of ipfwadm. # # The firewall rules below will only work here if using static IP # addresses!!! For dynamic addresses the rules should be added in # /etc/ppp/ip-up.d/00-isdnutils and deleted in # /etc/ppp/ip-down.d/99-isdnutils . # Also note you usually only want a setup as below for the interface # facing the internet, not if you're using the interface to connect a # local subnet (unless you're using masquerading). # Also be sure to check the config to make sure it fits what you want. # # ipchains -A input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} 1000: # ipchains -A input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} ssh # ipchains -A input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} smtp # ipchains -A input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} ident # ipchains -A input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} ftp # ipchains -A input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} http # ipchains -A input -j ACCEPT -i ${device} -p UDP -d ${LOCALIP} 1024: # ipchains -A input -j ACCEPT -i ${device} -p ICMP -d ${LOCALIP} # ipchains -A input -j DENY -i ${device} # If you don't have masquerading set up yet, try the following. # Replace 192.168.1 with the network number you use on the hosts # that will use masquerading. # ipchains -I forward -j MASQ -s 192.168.1.0/24 # ignore errors in case of older kernel isdnctrl dialmode $device $DIALMODE >/dev/null 2>&1 ;; # Delete the interface stop) set +e # ignore errors from here on isdnctrl dialmode $device off >/dev/null 2>&1 # FIREWALL RULES XXX_ # Undo the things done above. # # ipchains -D input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} 1000: # ipchains -D input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} ssh # ipchains -D input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} smtp # ipchains -D input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} ident # ipchains -D input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} ftp # ipchains -D input -j ACCEPT -i ${device} -p TCP -d ${LOCALIP} http # ipchains -D input -j ACCEPT -i ${device} -p UDP -d ${LOCALIP} 1024: # ipchains -D input -j ACCEPT -i ${device} -p ICMP -d ${LOCALIP} # ipchains -D input -j DENY -i ${device} # If you don't have masquerading set up yet, try the following. # Replace 192.168.1 with the network number you use on the hosts # that will use masquerading. # ipchains -D forward -j MASQ -s 192.168.1.0/24 # Commands to undo the network stuff route del $REMOTEIP $device 2> /dev/null # only delete default route if set above! # The default is to use ippp0 for your default route. bindnum=`expr $device : 'ippp\(.*\)'` if [ "$bindnum" = 0 ]; then route del default netmask 0 2>/dev/null fi ifconfig $device down 2> /dev/null isdnctrl delif $device 2> /dev/null ;; # the rest is generic, don't touch *) echo "Usage: $0 {start|stop}" exit 1 ;; esac exit 0 isdn.conf [GLOBAL] COUNTRYPREFIX=+ AREAPREFIX=0 # Change this to reflect your city COUNTRYCODE=31 # the Netherlands AREACODE=546 # Almelo # Isdnlog supports two databases for areacode -> name mapping. # avon is the old one, I recommend to use areacode, the new one. # However, it is easier to add to the avon database... CODELIB=AREACODE AREALIB=/usr/share/isdn/areacode.dat # for avon: # CODELIB=AVON # AVON=/usr/share/isdn/avon [VARIABLES] [ISDNLOG] CHARGEMAX = 9999.99 # CURRENCY = 0.08,NLG # 8 cents/unit (approximation in NL!), currency notation ILABEL = %b %e %T %ICall to tei %t from %N2 on %n2 OLABEL = %b %e %T %Itei %t calling %N2 with %n2 # Alternates (easier to read): # ILABEL = %a %b %e %T incoming %I%n2 <- %N2 # OLABEL = %a %b %e %T outgoing %I%n2 -> %N2 # If you're in Germany, and subscribe to Telekom's "cityweekend" tariff: # CITYWEEKEND=Y isdnlog.ippp0 # This is a very short summary with the important options. # for a longer descriptions of all options : please read isdnlog(8) # REMOVE the next line once configuration is complete ######################### # Warning! not configured yet! # REMOVE the above line once configuration is complete ######################## [options] #log=1 # log d-channel messages. value may be 0-15 (bit coded flags) daemon=no # "yes"/"no" : (dont) start isdnlog as daemon. Set no for Debian stdout=0x3f7 # log to stdout and file, and set log level # if you remove "outfile" option, also remove "stdout" option! outfile=+/var/log/isdn/isdnlog # logfile to log to ('+' is append mode) console=/dev/null # where to send stdout text; e.g. /dev/tty12 #monitor=yes # enable support for imon and imontty (monitor progs) syslog=0x1bf7 # log to syslog with log level X #thruput=60 # if you log thruput : one message every X seconds #time=2 # 1=get time from isdn one, 2=everytime #hangup=5:3 # enable chargehup with 5 / 3 seconds security gap #start=yes # enable program start on events # If you have the Deutsche Telekom cityweekend thing, # enable the cityweekend option in isdn.conf. callerid.conf # this is a skeleton for a callerid configuration # edit this file before using isdnlog or vbox ! # See isdn.conf manpage for details. # # These are the parameters that can be used when starting programs; # See callerid.conf(5) manpage for details: # $1 = flags $2 = callernum $3 = calleenum # $4 = connecttime $5 = duration $6 = endtime # $7 = bytesin $8 = bytesout $9 = bpsin # $10 = bpsout $11 = si $12 = charges # $13 = callercountry $14 = calleecountry $15 = callerarea # $16 = calleearea $17 = callertown $18 = calleetown # $19 = calleralias $20 = calleealias [MSN] NUMBER = 4711 ALIAS = Phone SI = 1 ZONE = 1 START = { [FLAG] FLAGS = I|O|R|C|B|A|E|H PROGRAM = /bin/myprog \$1 \$2 \$3 Phone } [MSN] NUMBER = 4711 ALIAS = HDLC SI = 7 ZONE = 1 START = { [FLAG] FLAGS = I|O|R|C|B|A|E| PROGRAM = /bin/myprog \$1 \$2 \$3 HDLC @/home/user1/parameter } [MSN] NUMBER = 4712 ALIAS = Modem SI = 1 ZONE = 1 START = { [FLAG] FLAGS = I|O|R|C|B|A|E|H PROGRAM = /bin/myprog \$1 \$2 \$3 Modem } [NUMBER] NUMBER = 01910 ALIAS = T-Online ZONE = 1 |
|
|
|---|
|
Mein Initskript für ibod, Benutzung auf eigene Gefahr (ich habe es hier unter Debian 2.2 potato getestet). ibod #! /bin/sh # # based on skeleton example file to build /etc/init.d/ scripts. # skeleton originally written by Miquel van Smoorenburg <miquels@cistron.nl> # modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu> # modified for use with ibod by Thomas Freitag <tf@darkwhole.de> # Version: 0.99 16-Jul-2001 Thomas Freitag # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/ibod NAME=ibod DESC="ibod (internet bandwith on demand)" export IBOD_HOME=/etc/isdn test -f $DAEMON || exit 0 set -e case "$1" in start) echo -n "Starting $DESC: " start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \ --make-pidfile --exec $DAEMON & echo "$NAME." ;; stop) echo -n "Stopping $DESC: " start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \ --exec $DAEMON rm -f /var/run/$NAME.pid echo "$NAME." isdnctrl removelink ippp0 ;; #reload) # # If the daemon can reload its config files on the fly # for example by sending it SIGHUP, do it here. # # If the daemon responds to changes in its config file # directly anyway, make this a do-nothing entry. # # echo "Reloading $DESC configuration files." # start-stop-daemon --stop --signal 1 --quiet --pidfile \ # /var/run/$NAME.pid --exec $DAEMON #;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # echo -n "Restarting $DESC: " start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON isdnctrl removelink ippp0 rm -f /var/run/$NAME.pid sleep 1 start-stop-daemon --start --quiet --pidfile \ /var/run/$NAME.pid --make-pidfile --exec $DAEMON echo "$NAME." ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 |
|
|
|
© 2000-2001 by Thomas Freitag Mail: tf |
|
|
|
|