Installer le package ppp en RPM. modifier le fichier /etc/resolv.conf
search cogitec.home nameserver 192.168.99.1 nameserver 212.27.32.5 nameserver 212.27.32.6droit sur les fichiers dans /etc/ppp
-rwxr-xr-x 1 root root 265 Sep 16 1997 ip-down -rwxr-xr-x 1 root root 55 May 15 06:56 ip-down.local -rwxr-xr-x 1 root root 349 May 8 1998 ip-up -rwxr-xr-x 1 root root 197 May 18 19:59 ip-up.local -rw-r--r-- 1 root root 10728 May 15 01:06 options -rwx------ 1 root daemon 97 May 15 01:20 pap-secrets -rwsr-sr-x 1 root root 982 May 15 00:50 ppp-off -rwsr-sr-x 1 root root 1173 May 15 01:01 ppp-on -rwxr-xr-x 1 root root 704 May 15 01:14 ppp-on-dialernoter le suid root sur le ppp-on et ppp-off pour que les utilisateurs puissent commencer/arreter la connection. Penser aussi au fichier pppd et /dev/ttyS0 ou /dev/ttyS1 Pour mettre ces fichiers avec les bons droits, faites en root:
chmod +s /etc/ppp/ppp-on chmod +s /etc/ppp/ppp-on chmod +s /usr/sbin/pppdet selon sur quelle port série est votre modem (com1 = ttyS0, com2 = ttyS1)
ln -s /dev/ttyS0 /dev/modem chmod 666 /dev/ttyS0Maintenant, quelque soit l'utilisateur qui cherche à se connecter, les mêmes fichier de configuration seront lu. le fichier options
asyncmap 0 crtscts defaultroute lock modem -detach name bpoussinPensez à mettre votre login au lieu du mien "bpoussin" :-) le fichier ppp-on
#!/bin/sh TELEPHONE=0251866060 # The telephone number for the connection ACCOUNT=bpoussin # The account name for logon (as in 'George Burns') PASSWORD=******** # The password for this account (and 'Gracie Allen') LOCAL_IP=0.0.0.0 # Local IP address if known. Dynamic = 0.0.0.0 REMOTE_IP=0.0.0.0 # Remote IP address if desired. Normally 0.0.0.0 NETMASK=255.255.255.0 # The proper netmask if needed export TELEPHONE ACCOUNT PASSWORD DIALER_SCRIPT=/etc/ppp/ppp-on-dialer exec /usr/sbin/pppd idle 300 /dev/modem 38400 \ connect $DIALER_SCRIPTidle 300, indique à pppd de raccrocher si aucun packet ip n'est passé par le modem durant 300secondes (5min). le fichier ppp-on-dialer
#!/bin/sh exec /usr/sbin/chat -v \ TIMEOUT 3 \ ABORT '\nBUSY\r' \ ABORT '\nNO ANSWER\r' \ ABORT '\nRINGING\r\n\r\nRINGING\r' \ '' \rAT \ 'OK-+++\c-OK' ATH0 \ TIMEOUT 30 \ OK ATDT$TELEPHONE \ CONNECT ''vous pouvez vous amuser à ajouter un ATMO pour ne pas entendre le modem numéroter. le fichier ppp-off
#!/bin/sh if [ -n "`ps ax |grep fetchmail |grep -v grep`" ] then echo "Attendez 2 secondes que je finisse de ramener les mails" fi while [ -n "`ps ax |grep fetchmail |grep -v grep`" ] do sleep 2 done ###################################################################### # # Determine the device to be terminated. # if [ "$1" = "" ]; then DEVICE=ppp0 else DEVICE=$1 fi ###################################################################### # # If the ppp0 pid file is present then the program is running. Stop it. if [ -r /var/run/$DEVICE.pid ]; then kill -INT `cat /var/run/$DEVICE.pid` # # If the kill did not work then there is no process running for this # pid. It may also mean that the lock file will be left. You may wish # to delete the lock file at the same time. if [ ! "$?" = "0" ]; then rm -f /var/run/$DEVICE.pid echo "ERROR: Removed stale pid file" exit 1 fi # # Success. Let pppd clean up its own junk. echo "PPP link to $DEVICE terminated." exit 0 fi # # The ppp process is not running for ppp0 echo "ERROR: PPP link is not active on $DEVICE" exit 1Les premières ligne indique d'attendre que fetchmail est fini de récuperer les mails avant de raccrocher. Cela n'est pas util si vous n'utilisez pas fetchmail. :-) le fichier /etc/ppp/pap-secrets
bpoussin * mon-mot-de-passe-iciDans les 2 fichiers suivants vous ne devez mettre que ce que vous installerez par la suite. le fichier /etc/ppp/ip-up.local, ce fichier contient les actions a faire en debut de connection.
/usr/local/bin/wwwoffle -online -c /etc/wwwoffle.conf /usr/sbin/sendmail -q & fetchmail -f /etc/fetchmail.conf & /var/lib/suck/get.news.inn & /usr/local/bin/wwwoffle -fetch -c /etc/wwwoffle.conf &le fichier /etc/ppp/ip-down.local, ce fichier contient les actions a faire en fin de connection.
/usr/local/bin/wwwoffle -offline -c /etc/wwwoffle.confMaintenant pour vous connect faites /etc/ppp/ppp.on, et pour arrêter la connection /etc/ppp/ppp-off
Précédent | Sommaire | Suivant |
Connection ppp | Niveau supérieur | Serveur proxy |