During the configuration you should monitor the system to determine when and why a connection is made. Otherwise you can quickly rack up unwanted phone bills.
One can be sure, however, that a connection is never made or kept open for no reason. This occurs only even if packets are actually sent out over the line.
Thus, you need to check the server services installed on the computer, whether they were configured correctly and to if necessary find out the cause of the connection.
There are a number of ISDN status monitors. The most important is imon; this console program can be started in any environment, reacts promptly and does not devour system resources.
Other programs are: xisdnload
(also shows the throughput),
isdnmon
and isdnmonp
. All monitors show the telephone
number and the type of connection (incoming or outgoing on).
isdnctrl verbose 3
the i4l
subsystem will write a message in
/var/log/messages
each time a connection is
established so that one can determine between which IP
numbers and port numbers a packet is being sent. This
example is an inquiry to the WWW server www.suse.com
(Alias goldengate
):
Apr 10 21:05:06 glen kernel: OPEN: 1.1.1.1 -> 209.0.51.1 TCP, port: 2224 -> 80
tcpdump
(Paket tcpdump
) is a packet
sniffer that checks all packets on a network device. The
output of the program is not very user-freiends, but it at
least shows the IP number and port numbers. This examples
is an an inquiry to the WWW server www.suse.com
(Alias goldengate
)
glen:/root # tcpdump -i ippp0 tcpdump: listening on ippp0 21:05:39.382188 pec-30.au1.n.uunet.de.2230 > goldengate.suse.com.www: S 1384488919:1384488919(0) win 512 <mss 1460> 21:05:39.642188 goldengate.suse.com.www > pec-30.au1.n.uunet.de.2230: S 3326089293:3326089293(0) ack 1384488920 win 32736 <mss 1460> 21:05:39.642188 pec-30.au1.n.uunet.de.2230 > goldengate.suse.com.www: . ack 1 win 32120 (DF)
ippp0
. tcpdump
won't show any more data after this, and must be aborted and restarted.
The program isdnlog
runs in the backgroud, always
listening to the D channel. All activity is logged to
/var/log/messages
and a protocol is written to
/var/log/isdn.log
.
With the toolM isdnrep
, this file can be read at some
later time. There are a number of parameters; here are the
most important:
isdnrep
: all of today's connectionsisdnrep -a
: all logged connectionsisdnrep -t01/04/98-03/04/98
: all connections
from 1 to 3 April 1998Das i4l-Subsystem ist (wenn es denn einmal gestartet wurde) nicht dafür vorgesehen, daß Verbindungen nur manuell gestartet werden. Man könnte das Konzept bei i4l also auch so formulieren: wenn es gestartet ist, besteht ständig eine Verbindung, die aber automatisch gekappt wird, wenn nichts passiert.
Wer es dennoch machen will, der entferne einfach die Default-Route. In diesen Fall wird nur noch dann eine Verbindung aufgefgebaut, wenn ein IP-Paket an die direkte Gegenstelle geschickt wird, was i.A. nicht vorkommt, da diese Gegenstelle keine Internetdienste anbietet und daher von keinem Client angesprochen wird.
Als endgültigen Schritt, kann man auch das komplette Interface (ippp0) herunterfahren, dann können grundsätzlich keine Verbindungen aufgebaut werden.
Man kann die Runlevel-Scripts natürlich auch manuell benutzen:
/sbin/init.d/i4l stop
/sbin/init.d/i4l start /sbin/init.d/route
Wer bei einer syncPPP-Verbindung die Verbindung nur manuell
starten möchte, kann eine Eigenschaft des Scriptes
/etc/ppp/ip-up
ab S.u.S.E. 5.2 ausnutzen (Siehe FixMe).
Dieses legt beim Verbindungsaufbau eine Defaultroute
auf die neu erkannte PtP-Adresse. Beim Verbindungsabbau
wird das Device neu angelegt und die Defaultroute
gelöscht. Schlisslich wird die Datei /etc/route.conf
durchsucht und die Defaultroute wenn definiert neu angelegt.
Definiert man dort keine Defaultroute, so hat man nach
Verbindungsabbau eben keine.
Gestartet werden kann dann nur mit dem Kommando:
isdnctrl dial ippp0
isdnctrl hangup ippp0
Am besten garnicht, denn das ist Aufgabe des Administrators. Es ist nur diesem vorbehalten, Netzdevices und Routen zu konfigurieren.
Versuche nicht, den notwendigen Programmen suid-Attribute zu geben! Erstens ist die Aufgabe sehr schwer, und zweitens handelt man sich damit ein riesisges Sicherheitsloch ein, denn wenn diese Programme erstmal offen sind, lassen sich auch andere unerwünschte Dinge damit tun.
Einem einzelnen Script suid-Attribute zu geben, ist unter Linux ebenfalls verboten.
Wer es dennoch unbedingt machen will, der benutze ein Paket
wie z.B. sudo
. Damit lassen sich für einzelne Benutzer
bestimmte Kommandos definieren, die diese dann als Benutzer
root
ausführen dürfen.
Hier ein einfaches Beispiel:
sudo
installieren.visudo
die Konfigurationsdatei editieren, z.B.
soll der Benutzer kfr
das Programm
/usr/local/bin/dial
ausführen dürfen:
# User privilege specification kfr ALL=/usr/local/bin/dial
visudo
, um
dieKonfigurationsdatei (/etc/sudoers
) zu
verändern.
dial
könnte z.B. so sein:
#!/bin/sh DEVICE=ippp0 if test $UID -ne 0; then exec sudo $0 $* fi case "$1" in stop) echo stop isdnctrl hangup $DEVICE ;; *) echo dial isdnctrl dial $DEVICE ;; esac
root
aufgerufen, startet es sich
selbst mit sudo
neu. Mit dial
wird gewählt,
mit dial stop
wird aufgelegt.