Add a new translated section.

This commit is contained in:
Marc Fonvieille 2003-11-11 22:35:53 +00:00
parent 3cdb4e6b0d
commit 9c57d60819
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=18813

View file

@ -121,8 +121,497 @@
</sect1>
<sect1 id="ppp">
<title>Using Kernel PPP ** Traduction en Cours **</title>
<para></para>
<sect1info>
<authorgroup>
<author>
<firstname>Gennady B.</firstname>
<surname>Sorokopud</surname>
<contrib>Contribution originale de </contrib>
</author>
<author>
<firstname>Robert</firstname>
<surname>Huff</surname>
</author>
</authorgroup>
</sect1info>
<title>Utiliser PPP int&eacute;gr&eacute; au noyau</title>
<sect2>
<title>Configurer PPP int&eacute;gr&eacute; au noyau</title>
<indexterm><primary>PPP</primary><secondary>PPP int&eacute;gr&eacute; au noyau</secondary></indexterm>
<para>Avant de configurer PPP sur votre machine, v&eacute;rifiez
que <command>pppd</command> est bien dans le r&eacute;pertoire
<filename role="directory">/usr/sbin</filename> et que le
r&eacute;pertoire <filename
role="directory">/etc/ppp</filename> existe.</para>
<para>La commande <command>pppd</command> peut fonctionner selon
deux modes:</para>
<orderedlist>
<listitem>
<para>Comme &ldquo;client&rdquo; &mdash; si vous
d&eacute;sirez connecter votre machine au monde
ext&eacute;rieur via une liaison PPP s&eacute;rie ou un
modem.</para>
</listitem>
<indexterm><primary>PPP</primary><secondary>serveur</secondary></indexterm>
<listitem>
<para>Comme &ldquo;serveur&rdquo; &mdash; si votre machine
est sur le r&eacute;seau, et sert &agrave; y connecter
d'autres ordinateurs avec PPP.</para>
</listitem>
</orderedlist>
<para>Dans les deux cas, vous devrez renseigner un fichier
d'options (<filename>/etc/ppp/options</filename> ou
<filename>~/.ppprc</filename> si vous avez plus d'un
utilisateur sur votre machine utilisant PPP).</para>
<para>Vous aurez &eacute;galement besoin d'un logiciel
&ldquo;modem/s&eacute;rie&rdquo; (de pr&eacute;f&eacute;rence
<filename role="package">comms/kermit</filename>), pour
appeler et &eacute;tablir la connexion avec la machine
distante.</para>
</sect2>
<sect2>
<sect2info>
<authorgroup>
<author>
<firstname>Trev</firstname>
<surname>Roydhouse</surname>
<contrib>Bas&eacute; sur des informations fournies
par </contrib>
<!-- Trev.Roydhouse@f401.n711.z3.fidonet.org -->
</author>
</authorgroup>
</sect2info>
<title>Utiliser <command>pppd</command> comme client</title>
<indexterm><primary>PPP</primary><secondary>client</secondary></indexterm>
<indexterm><primary>Cisco</primary></indexterm>
<para>Le fichier <filename>/etc/ppp/options</filename> suivant
pourrait &ecirc;tre utilis&eacute; pour se connecter &agrave; la
liaison PPP d'un concentrateur Cisco:</para>
<programlisting>crtscts # enable hardware flow control
modem # modem control line
noipdefault # remote PPP server must supply your IP address.
# if the remote host does not send your IP during IPCP
# negotiation, remove this option
passive # wait for LCP packets
domain ppp.foo.com # put your domain name here
:&lt;remote_ip&gt; # put the IP of remote PPP host here
# it will be used to route packets via PPP link
# if you didn't specified the noipdefault option
# change this line to &lt;local_ip&gt;:&lt;remote_ip&gt;
defaultroute # put this if you want that PPP server will be your
# default router</programlisting>
<para>Pour se connecter:</para>
<indexterm><primary>kermit</primary></indexterm>
<indexterm><primary>modem</primary></indexterm>
<procedure>
<step>
<para>Appelez la machine distante en utilisant
<application>kermit</application> (ou un autre programme
pour modem), puis entrez votre nom d'utilisateur et mot de
passe (ou ce qu'il faut pour activer PPP sur la machine
distante).</para>
</step>
<step>
<para>Quittez <application>kermit</application> (sans
raccrocher la ligne).</para>
</step>
<step>
<para>Entrez la commande suivante:</para>
<screen>&prompt.root; <userinput>/usr/src/usr.sbin/pppd.new/pppd <replaceable>/dev/tty01</replaceable> <replaceable>19200</replaceable></userinput></screen>
<para>Assurez-vous d'utiliser la vitesse et le nom de
p&eacute;riph&eacute;rique ad&eacute;quats.</para>
</step>
</procedure>
<para>Votre ordinateur est maintenant connect&eacute; via PPP.
Si la connection &eacute;choue, vous pouvez ajouter l'option
<option>debug</option> au fichier
<filename>/etc/ppp/options</filename>, et consulter les
messages sur la console pour tracer le probl&egrave;me.</para>
<para>La proc&eacute;dure <filename>/etc/ppp/pppup</filename>
ci-dessous effectuera automatiquement ces trois
&eacute;tapes:</para>
<programlisting>#!/bin/sh
ps ax |grep pppd |grep -v grep
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
echo 'killing pppd, PID=' ${pid}
kill ${pid}
fi
ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
echo 'killing kermit, PID=' ${pid}
kill -9 ${pid}
fi
ifconfig ppp0 down
ifconfig ppp0 delete
kermit -y /etc/ppp/kermit.dial
pppd /dev/tty01 19200</programlisting>
<indexterm><primary>kermit</primary></indexterm>
<para><filename>/etc/ppp/kermit.dial</filename> est une
proc&eacute;dure <application>kermit</application> qui appelle
et fournit toutes les informations d'authentification
n&eacute;cessaires &agrave; la machine distante (un exemple
d'une telle proc&eacute;dure est donn&eacute; &agrave; la fin de
ce document).</para>
<para>Utilisez la proc&eacute;dure
<filename>/etc/ppp/pppdown</filename> suivante pour terminer
la session PPP et vous d&eacute;connecter:</para>
<programlisting>#!/bin/sh
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ X${pid} != "X" ] ; then
echo 'killing pppd, PID=' ${pid}
kill -TERM ${pid}
fi
ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
echo 'killing kermit, PID=' ${pid}
kill -9 ${pid}
fi
/sbin/ifconfig ppp0 down
/sbin/ifconfig ppp0 delete
kermit -y /etc/ppp/kermit.hup
/etc/ppp/ppptest</programlisting>
<para>V&eacute;rifiez si <command>pppd</command> tourne toujours
en lan&ccedil;ant la proc&eacute;dure
<filename>/usr/etc/ppp/ppptest</filename>, qui devrait
ressembler &agrave; ceci:</para>
<programlisting>#!/bin/sh
pid=`ps ax| grep pppd |grep -v grep|awk '{print $1;}'`
if [ X${pid} != "X" ] ; then
echo 'pppd running: PID=' ${pid-NONE}
else
echo 'No pppd running.'
fi
set -x
netstat -n -I ppp0
ifconfig ppp0</programlisting>
<para>Pour racccrocher la ligne, ex&eacute;cutez
<filename>/etc/ppp/kermit.hup</filename>, qui devrait
contenir:</para>
<programlisting>set line /dev/tty01 ; put your modem device here
set speed 19200
set file type binary
set file names literal
set win 8
set rec pack 1024
set send pack 1024
set block 3
set term bytesize 8
set command bytesize 8
set flow none
pau 1
out +++
inp 5 OK
out ATH0\13
echo \13
exit</programlisting>
<para>Voici une autre m&eacute;thode qui utilise
<command>chat</command> au lieu de
<command>kermit</command>.</para>
<para>Les deux fichiers suivants suffisent &agrave;
&eacute;tablir une connexion avec
<command>pppd</command>.</para>
<para><filename>/etc/ppp/options</filename>:</para>
<programlisting>/dev/cuaa1 115200
crtscts # enable hardware flow control
modem # modem control line
connect "/usr/bin/chat -f /etc/ppp/login.chat.script"
noipdefault # remote PPP serve must supply your IP address.
# if the remote host doesn't send your IP during
# IPCP negotiation, remove this option
passive # wait for LCP packets
domain &lt;your.domain&gt; # put your domain name here
: # put the IP of remote PPP host here
# it will be used to route packets via PPP link
# if you didn't specified the noipdefault option
# change this line to &lt;local_ip&gt;:&lt;remote_ip&gt;
defaultroute # put this if you want that PPP server will be
# your default router</programlisting>
<para><filename>/etc/ppp/login.chat.script</filename>:</para>
<note>
<para>Ce qui suit doit &ecirc;tre tap&eacute; sur une seule
ligne.</para>
</note>
<programlisting>ABORT BUSY ABORT 'NO CARRIER' "" AT OK ATDT&lt;phone.number&gt;
CONNECT "" TIMEOUT 10 ogin:-\\r-ogin: &lt;login-id&gt;
TIMEOUT 5 sword: &lt;password&gt;</programlisting>
<para>Une fois que ces fichiers sont install&eacute;s et
correctement modifi&eacute;s, tout ce dont vous avez besoin de
faire est de lancer <command>pppd</command>, comme
suit:</para>
<screen>&prompt.root; <userinput>pppd</userinput></screen>
</sect2>
<sect2>
<title>Utiliser <command>pppd</command> comme serveur</title>
<para>Le contenu du fichier
<filename>/etc/ppp/options</filename> devrait &ecirc;tre
semblable &agrave; ce qui suit:</para>
<programlisting>crtscts # Hardware flow control
netmask 255.255.255.0 # netmask ( not required )
192.114.208.20:192.114.208.165 # ip's of local and remote hosts
# local ip must be different from one
# you assigned to the ethernet ( or other )
# interface on your machine.
# remote IP is ip address that will be
# assigned to the remote machine
domain ppp.foo.com # your domain
passive # wait for LCP
modem # modem line</programlisting>
<para>La proc&eacute;dure <filename>/etc/ppp/pppserv</filename>
ci-dessous demandera &agrave; <application>pppd</application>
de se comporter comme un serveur:</para>
<programlisting>#!/bin/sh
ps ax |grep pppd |grep -v grep
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
echo 'killing pppd, PID=' ${pid}
kill ${pid}
fi
ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
echo 'killing kermit, PID=' ${pid}
kill -9 ${pid}
fi
# reset ppp interface
ifconfig ppp0 down
ifconfig ppp0 delete
# enable autoanswer mode
kermit -y /etc/ppp/kermit.ans
# run ppp
pppd /dev/tty01 19200</programlisting>
<para>Utilisez cette proc&eacute;dure
<filename>/etc/ppp/pppservdown</filename> pour arr&ecirc;ter
le serveur:</para>
<programlisting>#!/bin/sh
ps ax |grep pppd |grep -v grep
pid=`ps ax |grep pppd |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
echo 'killing pppd, PID=' ${pid}
kill ${pid}
fi
ps ax |grep kermit |grep -v grep
pid=`ps ax |grep kermit |grep -v grep|awk '{print $1;}'`
if [ "X${pid}" != "X" ] ; then
echo 'killing kermit, PID=' ${pid}
kill -9 ${pid}
fi
ifconfig ppp0 down
ifconfig ppp0 delete
kermit -y /etc/ppp/kermit.noans</programlisting>
<para>La proc&eacute;dure <application>kermit</application>
ci-dessous (<filename>/etc/ppp/kermit.ans</filename>) activera
ou d&eacute;sactivera le mode r&eacute;ponse automatique de
votre modem:</para>
<programlisting>set line /dev/tty01
set speed 19200
set file type binary
set file names literal
set win 8
set rec pack 1024
set send pack 1024
set block 3
set term bytesize 8
set command bytesize 8
set flow none
pau 1
out +++
inp 5 OK
out ATH0\13
inp 5 OK
echo \13
out ATS0=1\13 ; change this to out ATS0=0\13 if you want to disable
; autoanswer mod
inp 5 OK
echo \13
exit</programlisting>
<para>Une proc&eacute;dure nomm&eacute;e
<filename>/etc/ppp/kermit.dial</filename> est utilis&eacute;e
pour appeler et s'authentifier sur la machine distante. Vous
devrez l'adapter &agrave; vos besoins. Mettez-y votre nom
d'utilisateur et votre mot de passe; vous devrez
&eacute;galement modifier les entr&eacute;es en fonctions des
r&eacute;ponses que vous envoient votre modem et la machine
distante.</para>
<programlisting>;
; put the com line attached to the modem here:
;
set line /dev/tty01
;
; put the modem speed here:
;
set speed 19200
set file type binary ; full 8 bit file xfer
set file names literal
set win 8
set rec pack 1024
set send pack 1024
set block 3
set term bytesize 8
set command bytesize 8
set flow none
set modem hayes
set dial hangup off
set carrier auto ; Then SET CARRIER if necessary,
set dial display on ; Then SET DIAL if necessary,
set input echo on
set input timeout proceed
set input case ignore
def \%x 0 ; login prompt counter
goto slhup
:slcmd ; put the modem in command mode
echo Put the modem in command mode.
clear ; Clear unread characters from input buffer
pause 1
output +++ ; hayes escape sequence
input 1 OK\13\10 ; wait for OK
if success goto slhup
output \13
pause 1
output at\13
input 1 OK\13\10
if fail goto slcmd ; if modem doesn't answer OK, try again
:slhup ; hang up the phone
clear ; Clear unread characters from input buffer
pause 1
echo Hanging up the phone.
output ath0\13 ; hayes command for on hook
input 2 OK\13\10
if fail goto slcmd ; if no OK answer, put modem in command mode
:sldial ; dial the number
pause 1
echo Dialing.
output atdt9,550311\13\10 ; put phone number here
assign \%x 0 ; zero the time counter
:look
clear ; Clear unread characters from input buffer
increment \%x ; Count the seconds
input 1 {CONNECT }
if success goto sllogin
reinput 1 {NO CARRIER\13\10}
if success goto sldial
reinput 1 {NO DIALTONE\13\10}
if success goto slnodial
reinput 1 {\255}
if success goto slhup
reinput 1 {\127}
if success goto slhup
if < \%x 60 goto look
else goto slhup
:sllogin ; login
assign \%x 0 ; zero the time counter
pause 1
echo Looking for login prompt.
:slloop
increment \%x ; Count the seconds
clear ; Clear unread characters from input buffer
output \13
;
; put your expected login prompt here:
;
input 1 {Username: }
if success goto sluid
reinput 1 {\255}
if success goto slhup
reinput 1 {\127}
if success goto slhup
if < \%x 10 goto slloop ; try 10 times to get a login prompt
else goto slhup ; hang up and start again if 10 failures
:sluid
;
; put your userid here:
;
output ppp-login\13
input 1 {Password: }
;
; put your password here:
;
output ppp-password\13
input 1 {Entering SLIP mode.}
echo
quit
:slnodial
echo \7No dialtone. Check the telephone line!\7
exit 1
; local variables:
; mode: csh
; comment-start: "; "
; comment-start-skip: "; "
; end:</programlisting>
</sect2>
</sect1>
<sect1 id="pppoe">
@ -195,7 +684,7 @@ nom_du_fournisseur_d'acc&egrave;s:
<programlisting>ppp_enable="YES"
ppp_mode="ddial"
ppp_nat="YES" # si vous voulez activer NAT pour votre réseau local, sinon NO
ppp_nat="YES" # si vous voulez activer NAT pour votre r&eacute;seau local, sinon NO
ppp_profile="nom_du_fournisseur_d'acc&egrave;s"</programlisting>
</sect2>