Léa-Linux & amis :   LinuxFR   GCU-Squad   GNU
Pourquoi la connection ADSL passe en ppp1 ?
Envoyé par: Védy

Bonjour

Sur mandrake 10, j'utilise un script automatique pour la connexion internet. Cependant quelques fois la connexion s'effectue sur ppp1 et non pas en ppp0. Apparemment le ppp0 n'est pas effacé. Ce n'est pas vraiment gênant sauf pour le masquering que j'ai aussi été obligé de mettre en ppp1. Mais celà pourrait aussi psser en pppn et là çà se complique.

Ou est l'erreur ?
----------------------
/etc/initd/internet (démarrer en tant que service) suivant :
------------------------
!/bin/bash
#
# internet Bring up/down internet connection
#
# chkconfig: 2345 11 89
# description: Activates/Deactivates the internet interfaces
#
# dam's (damien@mandrakesoft.com)

# Source function library.
. /etc/rc.d/init.d/functions

case "$1" in
start)
if [ -e /etc/sysconfig/network-scripts/net_cnx_up ]; then
action "Checking internet connections to start at boot" "/etc/sysconfig/network-scripts/net_cnx_up --boot_time"
else
action "No connection to start" "true"
fi
touch /var/lock/subsys/internet
;;
stop)
if [ -e /etc/sysconfig/network-scripts/net_cnx_down ]; then
action "Stopping internet connection if needed: " "/etc/sysconfig/network-scripts/net_cnx_down --boot_time"
else
action "No connection to stop" "true"
fi
rm -f /var/lock/subsys/internet
;;
restart)
$0 stop
echo "Waiting 10 sec before restarting the internet connection."
sleep 10
$0 start
;;
status)
;;
*)
echo "Usage: internet {start|stop|status|restart}"
exit 1
esac
exit 0
----------------------------
Ci après le fichier de déconnexion
/etc/sysconfig/network-script/net_cnx_down
----------------------------
#!/bin/bash
/usr/sbin/adsl-stop
# J'ai rajouté çà, mais apparamment celà ne change rien
/usr/bin/killall pppoe pppd pptp ; rm -rf

---------------------------------

Ci-après le fichier adsl-stop d'origine
/usr/sbin/adsl-stop
------------------------------------
#!/bin/sh
# Generated automatically from adsl-stop.in by configure.
#***********************************************************************
#
# adsl-stop
#
# Shell script to bring down an ADSL connection
#
# Copyright (C) 2000 Roaring Penguin Software Inc.
#
# $Id: adsl-stop.in,v 1.5 2002/04/09 17:28:39 dfs Exp $
#
# This file may be distributed under the terms of the GNU General
# Public License.
#
# LIC: GPL
#
# Usage: adsl-stop [config_file]
# If config_file is omitted, defaults to /etc/ppp/pppoe.conf
#
#***********************************************************************

# Set to "C" locale so we can parse messages from commands
LANG=C
export LANG

ME="`basename $0`"
LOGGER="/usr/bin/logger -t $ME"
CONFIG="$1"
if [ "$CONFIG" = "" ] ; then
CONFIG=/etc/ppp/pppoe.conf
fi

if [ ! -f "$CONFIG" -o ! -r "$CONFIG" ] ; then
echo "$ME: Cannot read configuration file '$CONFIG'" >& 2
exit 1
fi

. $CONFIG

PPPOE_PIDFILE="$PIDFILE.pppoe"
PPPD_PIDFILE="$PIDFILE.pppd"
STARTPID="$PIDFILE.start"

# Backward config file compatibility
if test "$DEMAND" = "" ; then
DEMAND=no
fi

# Ignore SIGTERM
trap "" 15

# Check for pidfile
if [ -r "$PIDFILE" ] ; then
PID=`cat $PIDFILE`

# Check if still running
kill -0 $PID > /dev/null 2>&1
if [ $? != 0 ] ; then
echo "$ME: The adsl-connect script (PID $PID) appears to have died" >& 2
fi

# Kill pppd, which should in turn kill pppoe
if [ -r "$PPPD_PIDFILE" ] ; then
PPPD_PID=`cat "$PPPD_PIDFILE"`
$LOGGER -p daemon.notice "Killing pppd"
echo "Killing pppd ($PPPD_PID)"
kill $PPPD_PID > /dev/null 2>&1 || exit 1
fi

# Kill adsl-start
PIDS=`cat $STARTPID`
kill -0 $PIDS > /dev/null 2>&1
if [ $? = 0 ] ; then
$LOGGER -p daemon.notice "Killing adsl-connect"
kill $PIDS > /dev/null 2>&1
fi

# Kill adsl-connect
$LOGGER -p daemon.notice "Killing adsl-connect"
echo "Killing adsl-connect ($PID)"
kill $PID > /dev/null 2>&1

rm -f "$PIDFILE" "$PPPD_PIDFILE" "$PPPOE_PIDFILE" "$STARTPID"
else
echo "$ME: No ADSL connection appears to be running" >&2
exit 1
fi

exit 0
---------------------------
Fin des fichiers de déconnexion

Poste le Tuesday 28 June 2005 12:27:31
Répondre     Citer    

Veuillez vous authentifier auparavant pour commenter.

 

Ce forum !
Pourquoi la connection ADSL passe en ppp1 ?
Un problème avec une commande du shell ? Comment utiliser la crontab ? Vous avez des soucis pour la gestion réseau sous Linux ? Pour vous la gestion des utilisateurs/groupes est du chinois ? Etc... Posez donc vos questions ici.

Sauf mention contraire, les documentations publiées sont sous licence Creative-Commons