Mserver
ou
comment lancer une connexion ppp à distance

Cette page n'est que le compte-rendu d'une expérimentation basée sur la lecture des guides réalisés par Olivier Hoarau d'une part et par Charles P.Wright d'autre part.
Pour tout dire, cette page est à la limite du plagiat de celle d'Olivier (j'espère que mon approche est complémentaire: elle ne retient qu'un sous-cas de figure).
Je vous renvoie à la rubrique Liens pour des travaux plus poussés que cette page.


Installation et configuration de mserver:

Le poste serveur, sous Mdk9.1, se nomme DingDong, dispose de l'IP 192.168.52.3 et est raccordé à internet via un modem AcerModem 56 Surf qui a été configuré lors de l'installation de la distribution (Olivier Hoarau a une approche plus complète pour prendre en compte la configuration à la main avec des FAI multiples, ce que j'élude complètement ici: Je pars d'une config qui permet à DingDong de surfer).


J'ai récupéré le fichier ftp://rpmfind.net/linux/Mandrake-devel/contrib/i586/mserver-0.5.5-2mdk.i586.rpm
Je l'ai installé.


Première étape:

J'ai effectué une copie de sauvegarde du fichier de config de mserver:
[root@DingDong steph]# cp /etc/mserver.conf /etc/mserver.conf.initial


Deuxième étape:

Modification/configuration de /etc/mserver.conf
J'ai suivi les indications d'Olivier Hoarau.
Voici mon fichier de config élagué:

# c-mserver config file
# Charles P. Wright
# cpwright@villagenet.com

# Which interface does the server listen on . Default is 0.0.0.0:224, which
# means the server listens on ALL interfaces on port 224.
listen_on = "192.168.52.3:224,127.0.0.1:224"

# Do we fork into the background and close stdin, stdout, and sterr?
demon = true

# How many clients can we have waiting on the incoming queue before they get
# locked out
slimit = 10

# Should we disconnect if we are not currently serving any clients?
zeroclientdisconnect = false

# If there is more than one client is one of them allowed to hangup the
# connection?
multiclientkill = true

# The location of the file containing the LICENSE that is returned by the
# LICENSE command.  You should have recieved a copy of the GPL with this
# program.
license = /usr/share/doc/mserver-0.5.5/COPYING

# The location of the file containing the version history that is returned by
# the HISTORY command.
history = /usr/share/doc/mserver-0.5.5/ChangeLog

# What version of getstat should we use?  pppdlock, netdev, lockonly and
# exitcode are your choices if you are using PPP then you should really use
# pppdlock.  If you have a weird method of connecting use netdev.  If you want
# to check if a file simply exists then use lockonly. Exitcode will execute a
# program and if it returns the value in goodcode then the link will count as
# being up.  pppdpid will record the pid of pppd when it connects and ensures
# that that process is still a pppd.
# Olivier signale des soucis avec ce paramètre.
# Il a opté pour lockonly (j'ai fait de même; c'est lui le guide).
#stattype = pppdlock

# Other stattype options:
# stattype = netdev
# stattype = exitcode
 stattype = lockonly
# stattype = pppdpid

# What should pppdlock look for in /proc/net/dev?
pppkey = "pppd"

# What is the name of your interface that exists when and only when you are
# connected?  This can used for the stat check and it is used for the netload
# feature.  You can set this on a device by device basis.
netdev = ppp0

# What file should we look for netdevices in?
devfile = "/proc/net/dev"

# What command should we use to check the link status?  If the link is good
# it should return 0, otherwise it should return a non-zero value.  This is used
# as the format string to snprintf, the %s will be replaced with the checkhost
# which is defined below.
linkcheck = "/bin/ping -c 1 %s"

# This is for testing non-link dependent portions of the server.  The linkhost
# is ignored for this entry.
# linkcheck = "/home/cpwright/src/mserver/fakelink/linkcheck %s"

# What host should we make sure is active when performing a linkcheck?  I
# suggest using an IP number instead of a hostname to expedite the operation,
# this gets performed a lot and the longer it takes for it to happen the more
# frustrated a user will get.
# Le poste à pinguer sur internet pour déterminer si la connexion est établie
# J'ai mis l'adresse d'un DNS
checkhost = "195.221.20.10"

# What code do we want our linkcheck command to return.  This is most likely
# zero.
goodcode = 0

# What is the lockfile for your modem, dial out as normal and then look in
# /var/lock
# Le point évoqué au "déboggage"
# Ce que j'ai finalement mis:
#lockfile = "/var/lock/LCK..modem"
# La config correspondant à la doc d'Olivier Hoarau:
lockfile = "/var/lock/LCK..ttyS0"

# Where do pppd and chat spit out their messages?
logfile = "/var/log/messages"

# What machines are allowed to capture the modem?
capture_ipallow = "127.0.0.1:192.168.52.*"

# What machines are allowed to administer the server.  I recommend you make
# this a machine that only you have access to.  The firewall (localhost) is
# usually a good choice.  You can disable this by setting it to 0.0.0.0 (I am
# assuming no host will have that IP address).
admin_ipallow = "127.0.0.1"

# What users are allowed to administer the server.  I would choose your account
# but not root.  Having the root password being transmitted over the network
# can be a *really* bad thing.  If you are using it on only loopback it isn't
# as bad.
admin_userallow = "steph"

# What machines are allowed to lock and unlock connections?
lock_ipallow="192.168.52.*:127.0.0.1"

# What users are allowed to lock and unlock connections?
lock_userallow = "steph,marie-laure"

# Accept KILL requests when locked and kill connection when the last KILL lock
# is released?
lock_pendingkill = false

# How fast is your modem, this is a hack so that it will return a value
# for the connection speed if it can not obtain it from the chat script.
cspeed = 57600

# The default kill action, this must be a script that will kill your connection
# regardless of which one is active, the default is internal and you probably
# shouldn't change it
kill = "internal"

# The signal to use when killing PPPD for an internal shutdown method, you
# need to preface it with a - since this is the second argument to the kill
# command
killsig = "-TERM"

# How long will we try to look at the PPPD logfile before giving up?
logtimeout = 120

# How long after doing something to  the connection should we wait to try a
# stat method?
statwait = 2

# What should we do to parse the logfile to give interactive output?
# Valid options are pppd, ipppd, pap, or none.
parselog = pppd

# Should we check for the speed, or just use the cspeed variable?
speedsearch = true

# What indicates a modem speed.  This was originally hardcoded, most people
# should not have a need to change it, but if your modem returns something
# different you may need too.  You should put them in descending order.
validspeed = "128000,112000,64000,57333,56000,54666,54667,54000,53333,52000,50666,50667,50000,49333,48000,46666,46667,46000,45333,44000,42666,42667,42000,41333,40000,38000,37333,36000,34000,33333,32000,31200,28800,26400,24000,12600,19200,16800,14400,12000,9600,7200,4800,2400,1200,300,110,ARQ,V34,V90,LAPM,V42,V90,V120"

# What should we look for in the logfile to decide what a (I)PPPD string is?
# If you have a normal modem this is most probably "pppd[", however if you use
# IPPPD this may be "pppd[" or "ipppd[".
pppdstr = "pppd["

# What should we look for in the logfile to decide what a chat string is?
# I don't know why you would want to change this, but put it in for
# completeness since you can select the pppd string.
chatstr = "chat["

# What is an identifying feature of your modems connect string.  Most say
# CONNECT, but I have been told CARRIER crops up as well.
connectstr = "CONNECT"

# What file contains the username/password combinations.  It is in the format of
# /etc/passwd.  You might want to choose something else as your file since
# transmitting unix passwords over the network in the clear is a bad thing.
# You can use the provided authgen utility to setup an authorization file.
authfile = "/etc/passwd"

# Should we use shadow passwords?  This requires that you run the daemon as
# root and that you use the account names in /etc/passwd.  This is probably
# not as good as a separate authorization file because the passwords are being
# sent over the network, but it is convenient.  If you use this option the
# authfile will be ignored and the server will use the functions in shadow.h!
shadow = true

# Should we use PAM (Pluggable Authentication Modules) to authenticate? This
# If you use this option the authfile will be ignored and the server will use
# the PAM system.  This requires that you run the daemon as root and provide a
# valid PAM configuration file for mserver.  An example PAM file is
# distributed with mserver, and is normally placed in /etc/pam.d/mserver.
# This option is ignored if you compiled mserver without PAM support.
# This option will take precedence over shadow, and any other authorization
# configuration!
pamauth = true

# Should we allow only valid users to perform the who command?  This in theory
# could provide information to nasty people, but your blocking this port to the
# outside world anyway (or you should be).
whoauth = false

# Require valid authentication to do any manipulations? (You can achieve this
# that is * would be only validated users, not any user if set to true,
# other wise anyone can dial!)
reqauth = false

# What script should we run just after a client connects?
# The argument is the client hostname
# Fichier créé plus loin, mais non utilisé pour le moment
clientup = "/usr/share/mserver/clientup"

# What script should we run just after a client disconnects?
# The argument is the client hostname
# Fichier créé plus loin, mais non utilisé pour le moment
clientdown = "/usr/share/mserver/clientdown"

# What script should we run just after a user authenticates?
# The argument is the client hostname and username
# Fichier créé plus loin, mais non utilisé pour le moment
authup = "/usr/share/mserver/authup"

# What script should we run just after a client unauthenticates?
# The argument is the cleint hostname and username
# Fichier créé plus loin, mais non utilisé pour le moment
authdown = "/usr/share/mserver/authdown"

# What script should we run after the link has been brought up?
# This can be specified on a per connection basis.
# The argument is the connection's name
#linkup = "/usr/share/mserver/linkup"
linkup = "/etc/ppp/ip-up"

# What script should we run right before the link has been intentionally brought
# down?
#prekill = "/usr/share/mserver/prekill"
# Fichier créé plus loin, mais non utilisé pour le moment
prekill = "/etc/ppp/goingdown"

# What script should we run after the link has been intentionally brought down?
#linkdown = "/usr/share/mserver/linkdown"
linkdown = "/etc/ppp/ip-down"

# how long do we allow a silent client ? (default = 0 = no timeout)
client_timeout = 0


# Which connection do you want mserver to auto-dial?
# comment this out if you don't want it to auto-dial.
#autodial "VillageNet(Balder)"
#autodial "ppp0"

# What are the names of our connections?  The order that they are listed
# is the order that LIST will use, the first one is the default connection
# for some clients.
#cname = "VillageNet(Balder),VillageNet(Dynamic),ASB"
cname = "ppp0"

# Actually Define our connections

# What is the command you use to bring up the connection, this can be a script
# or you can call pppd directly.
#ASB_script = "/sbin/ifup asb"

# What IP addresses are allowed to manipulate this connection.  You are allowed
# up to 10 different masks separated by colons.  You must either use the real
# numbers or a '*' to match any in each quad.  You must specify all of the quads# that is '*' wouldn't work but '*.*.*.*' would.
#ASB_ipallow = "192.168.1.*:127.0.0.1"

# What users are allowed to dial out this connection? "*" or "" will allow any
# user to dial out, otherwise provide a comma separated list of users.

# This is a string that is displayed when CINFO is called, it isn't actually
# used for any dialing, but just for cosmetics.  The clients may eventually
# depend on this so I suggest setting it.
#ASB_info = "America's Suggestion Box"

# The internal kill method is much more reliable unless you have something wierd# you should really use it!
# ASB_kill = "/sbin/ifdown asb"

# The per connection netdev, this is only needed for the netdev stat method
# it defaults to the value of netdev.
#ASB_netdev = "ppp0"

# The per connection checkhost, this is only needed for the exitcode stat method
# it defaults to the value of checkhost.
#ASB_checkhost = "164.254.128.5"

# Which method of parsing the logfile should we use for this connection?
#ASB_parselog = "pap"

# Default connection
ppp0_script = "/sbin/ifup ppp0"
ppp0_info = "Default Dialup Connection"
ppp0_kill = "/sbin/ifdown ppp0"
ppp0_netdev = "ppp0"
# Le poste à pinguer sur internet pour déterminer si la connexion est éablie
# J'ai mis l'adresse d'un DNS
ppp0_checkhost = "195.221.20.10"

# Another connection
#VillageNet(Dynamic)_script = "/sbin/ifup vnet"
#VillageNet(Dynamic)_info = "dialup-*-*.villagenet.com"
#VillageNet(Dynamic)_checkhost = "205.136.35.149"
#VillageNet(Dynamic)_ipallow = "127.0.0.1:192.168.1.*"

# Yet Another Connection
#VillageNet(Balder)_script = "/sbin/ifup balder"
#VillageNet(Balder)_info = "balder.villagenet.com"
#VillageNet(Balder)_checkhost = "205.136.35.149"
#VillageNet(Balder)_ipallow = "127.0.0.1:192.168.1.*"


# What users are allowed to do what?
userallow = "steph"        # This guy can do anything
userallow_connect = "*"        # Anyone can connect
userallow_disconnect = "*"    # Anyone can disconnect


Le voici: mserver.conf


Une fois les modifications effectuées, on redémarre le serveur mserver:

[root@DingDong steph]# /etc/init.d/mserver restart
Shutting down Masqdialer server:                               [  OK  ]
Starting Masqdialer server:                                    [  OK  ]
[root@DingDong steph]#


Troisième étape:

J'ai créé les fichiers auxquels il est fait référence dans /etc/mserver.conf (je ne les ai pas utilisés pour le moment):

[root@DingDong steph]# mkdir -p /usr/share/mserver
[root@DingDong steph]# touch /usr/share/mserver/clientup
[root@DingDong steph]# touch /usr/share/mserver/clientdown
[root@DingDong steph]# touch /usr/share/mserver/authup
[root@DingDong steph]# touch /usr/share/mserver/authdown
[root@DingDong steph]# touch /etc/ppp/goingdown
[root@DingDong steph]#

Je les ai rendu exécutables:

[root@DingDong steph]# chmod +x /usr/share/mserver/clientup
[root@DingDong steph]# chmod +x /usr/share/mserver/clientdown
[root@DingDong steph]# chmod +x /usr/share/mserver/authup
[root@DingDong steph]# chmod +x /usr/share/mserver/authdown
[root@DingDong steph]#

J'ai ensuite contrôlé le port d'écoute de mserver:

[root@DingDong steph]# cat /etc/services | grep 224
masqdialer      224/tcp          masqdialer     # added by c-mserver
masqdialer      224/udp          masqdialer     # added by c-mserver
[root@DingDong steph]# 

J'ai ensuite renseigné le fichier /etc/hosts pour que le serveur connaisse les clients:

[root@DingDong steph]# echo "192.168.52.2 DeepGreen" >> /etc/hosts
[root@DingDong steph]# echo "192.168.52.182 DeepGlue" >> /etc/hosts

La configuration proprement dite de mserver est réalisée (à un détail près; voir plus loin).

Et avec cela, les clients (une fois configurés) peuvent initier la connexion (lire la suite quand même).


Quatrième étape:

C'est bien beau de configurer mserver, mais si je peux seulement initier/interrompre la connexion depuis les clients et que je ne peux ni surfer, ni récupérer mon courrier depusi les clients, l'intérêt va être limité.

Il me faut donc configurer le masquage d'adresse pour que tous les postes de mon réseau apparaissent avec l'adresse de l'interface ppp0 sur internet.


Installation d'iptables (qui n'est pas installé par défaut sur la Mdk9.1):

[steph@DingDong steph]$ su
Password:
[root@DingDong steph]# urpmi iptables
installation de /mnt/win_e/mdk91/Mandrake/RPMS/iptables-1.2.7a-2mdk.i586.rpm

Préparation...             ##################################################
1:iptables              ##################################################
[root@DingDong steph]#


A ce stade, iptables laisse tout passer (et je ne décris pas ici comment filtrer):

[root@DingDong steph]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source              destination

Chain FORWARD (policy ACCEPT)
target     prot opt source              destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source
[root@DingDong steph]#


Activation du masquage d'adresse:

Avec la ligne qui suit, on autorise le forwarding des paquets (c'est-à-dire qu'on autorise le poste DingDong à faire passer les paquets d'une interface à une autre eth0 vers ppp0 et inversement):

[root@DingDong steph]# echo 1 > /proc/sys/net/ipv4/ip_forward

[root@DingDong steph]#


Et avec les lignes suivantes, tous les postes du réseau local se présenteront sur internet avec la même IP (celle attribuée dynamiquement par le FAI à votre interface ppp0):

[root@DingDong steph]# iptables -t nat -F
[root@DingDong steph]# iptables -t nat -X
[root@DingDong steph]# iptables -t nat -P POSTROUTING ACCEPT
[root@DingDong steph]# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
[root@DingDong steph]#


Avec cela, les clients peuvent non seulement initier la connexion, mais il peuvent en plus surfer et récupérer leurs mails.


Remarque:
(1) Les quelques lignes ci-dessus (5 commandes) devraient-être inclues dans un script à exécuter automatiquement au démarrage du poste.
(2) Par ailleurs, le masquage d'adresse est activé, mais aucun filtrage n'est assuré.
Voir la rubrique Liens pour apprendre à configurer iptables conformément à vos besoins.


Cinquième étape: "Déboggage"

Les clients parviennent à initier la connexion, surfer,... mais ils ne parvenaient pas à interrompre la connexion.
Une petite phrase dans la configuration de /etc/mserver.conf d'Olivier Hoarau m'est revenue à l'esprit.

Pendant que le serveur DingDong était connecté, j'ai relevé le nom du fichier de lock:

[steph@DingDong steph]$ ls /var/lock/
LCK..modem  subsys/
[steph@DingDong steph]$


Sur ma Mdk9.1, ce n'était pas /var/lock/LCK..ttyS0, mais /var/lock/LCK..modem

#lockfile = "/var/lock/LCK..modem"
lockfile = "/var/lock/LCK..ttyS0"

Après correction dans /etc/mserver.conf et redémarrage, tout est rentré dans l'ordre déconnexion comprise.

[root@DingDong steph]# /etc/init.d/mserver restart
Shutting down Masqdialer server:                               [  OK  ]
Starting Masqdialer server:                                    [  OK  ]
[root@DingDong steph]#


Installation et configuration du client:

Sous Linux:

J'ai récupéré le client mclient en ligne de commande réalisé par Charles P. Wright à l'adresse http://w3.cpwright.com/cli-mclient/cli-mclient-2.8.tar.gz

Il existe d'autres clients (graphiques ou non).
Pour en avoir la liste, rendez-vous à l'adresse http://w3.cpwright.com/mserver/index.html#downloads


Compilation du client:

Des compilations comme celle-là sont un plaisir.
Pas de dépendance, vous avez juste besoin d'un compilateur installé.

[steph@DeepGlue mclient-2.8]$ make
gcc  -g -O2 -Wall  -c -o mclient.o mclient.c
gcc -o mclient mclient.o
[steph@DeepGlue mclient-2.8]$

Et voilà le programme mclient est généré et ne nécessite pas de configuration (juste des paramètres).

Il serait judicieux de le copier en tant que root dans un dossier situé dans le PATH (/usr/local/bin/ par exemple).


Configuration de la passerelle sur le client DeepGlue:

Il s'agit d'un portable, qui utilise habituellement une autre passerelle.
J'ai donc commencé par suppprimer cette passerelle et définit la passerelle pour accéder à internet comme étant la machine DingDong:

[steph@DeepGlue steph]$ su
Password:
[root@DeepGlue steph]# route
Table de routage IP du noyau
Destination    Passerelle     Genmask         Indic Metric Ref    Use Iface
192.168.52.0   *              255.255.255.0  U     0     0       0 eth0
127.0.0.0      *              255.0.0.0       U     0     0      0 lo

<<CTRL+C: DeepGlue est un portable
et la passerelle par défaut n'est pas présente sur le réseau
sur lequel sont effectués ces tests
>>

[root@DeepGlue steph]# route del default
[root@DeepGlue steph]# route add default gw 192.168.52.3
[root@DeepGlue steph]# route
Table de routage IP du noyau
Destination    Passerelle     Genmask         Indic Metric Ref    Use Iface
192.168.52.0   *              255.255.255.0   U    0     0      0 eth0
127.0.0.0      *              255.0.0.0      U    0     0       0 lo
default         DingDong.MaMais0.0.0.0      UG    0     0      0 eth0
[root@DeepGlue steph]#


Renseignement du /etc/resolv.conf du client DeepGlue:

J'ai ajouté la ligne correspondant au DNS de Libertysurf:
    nameserver 213.36.80.1
au fichier /etc/resolv.conf du client.

Il n'est pas du tout certain que ce soit indispensable.
Il faut toutefois au moins un DNS valide dans ce fichier sous peine de n'accéder aux sites que par leur IP.


Connexion:

Ma première connexion ne s'est pas déroulée comme prévu.
J'ai eu un problème pour interrompre la connexion et le modem relançait automatiquement la connexion.
Voir le "déboggage" (étape 5) sur le mserver pour des précisions sur ce que j'ai corrigé.


Voici le déroulement de ce premier essai:

[steph@DeepGlue mclient-2.8]$ ./mclient -h DingDong -U steph -P MOTDEPASSE -v -d
Unix Command Line Masqdialer Client v2.7
Copyright (c) 1998, 1999 Kevin Lindsay and Charles P. Wright

Connecting to server: DingDong

Connection Established...

Authentication Successful!

Using default connection ppp0

Dialing ...
Dialing connection: ppp0 by user steph
Executing: /sbin/ifup ppp0
PPPD Process Started
Initializing Modem
Dialing Modem
Modem connected
Chat script successful
PPP Link Established
Connected to ppp0 at 57600

[steph@DeepGlue mclient-2.8]$

Magnifique, j'ai pu lancer la connexion depuis mon poste Linux distant.

Depuis konqueror, je tente d'accéder à http://www.google.fr et ça ne passe pas.

Je tente de pinger un DNS sur internet:

[steph@DeepGlue mclient-2.8]$ ping 195.221.20.10
PING 195.221.20.10 (195.221.20.10) 56(84) bytes of data.

--- 195.221.20.10 ping statistics ---
32 packets transmitted, 0 received, 100% packet loss, time 31017ms

[steph@DeepGlue mclient-2.8]$

Ben mince alors, ça ne passe pas, non plus!

Et ceci, alors que depuis DingDong je pouvais bien accéder à internet.

Qu'avais-je oublié d'après vous?
Le forwarding et le masquage d'adresse!
C'est-à-dire ce que j'ai expliqué plus haut à l'étape 4 de la configuration du serveur.
J'ai trouvé tout seul comme un grand mon erreur et cela m'a évité un peu de ridicule (je sais qu'il faut apprendre un jour, mais il s'agit là d'une chose que je connais depuis un moment déjà).

J'ai ensuite été embêté pour couper la connexion.
J'ai tenté de le faire en lançant:

 [steph@DeepGlue mclient-2.8]$ ./mclient -h DingDong -U steph -P MOTDEPASSE -v -k
Unix Command Line Masqdialer Client v2.7
Copyright (c) 1998, 1999 Kevin Lindsay and Charles P. Wright

Connecting to server: DingDong

Connection Established...

Authentication Successful!

ERROR: There is no active connection!

[steph@DeepGlue mclient-2.8]$

Allons bon, il ne trouve pas la connexion qui a été lancée.

J'ai tenté d'obtenir le statut de la connexion:

[steph@DeepGlue mclient-2.8]$ ./mclient -h DingDong -U steph -P MOTDEPASSE -v -s
Unix Command Line Masqdialer Client v2.7
Copyright (c) 1998, 1999 Kevin Lindsay and Charles P. Wright

Connecting to server: DingDong

Connection Established...

Authentication Successful!

Connection Status
-----------------

No connections!

[steph@DeepGlue mclient-2.8]$

En effet, il ne la trouve pas (et elle est pourtant active).

Je suis passé sur le serveur DingDong et j'ai tenté de couper la connexion:

[root@DingDong steph]# /etc/ppp/ppp-off
PPP link to ppp0 terminated.
[root@DingDong steph]#

Ca a coupé, mais ça a renuméroté aussitôt.
J'ai fini par éteindre le modem et redémarrer carrément DingDong et DeepGlue parce que cela merdouillait.


Le problème venait du fichier de LOCK du modem.
Je l'ai corrigé (voir étape 5) et j'ai cette fois pu

Ce problème réglé, j'ai effectué un autre test:

[steph@DeepGlue mclient-2.8]$ ./mclient -h DingDong -U steph -P MOTDEPASSE -v -d
Unix Command Line Masqdialer Client v2.7
Copyright (c) 1998, 1999 Kevin Lindsay and Charles P. Wright

Connecting to server: DingDong

Connection Established...

Authentication Successful!

Using default connection ppp0

Dialing ...
Dialing connection: ppp0 by user steph
Executing: /sbin/ifup ppp0
PPPD Process Started
Initializing Modem
Dialing Modem
Modem connected
Chat script successful
PPP Link Established
Connected to ppp0 at 57600

[steph@DeepGlue mclient-2.8]$

La connexion est établie  depuis le poste distant DeepGlue et je peux surfer depuis ce poste distant (comme depuis les autres postes du réseau d'ailleurs simultanément).

J'ai ensuite contrôlé le statut de la connexion:

[steph@DeepGlue mclient-2.8]$ ./mclient -h DingDong -U steph -P MOTDEPASSE -v -s
Unix Command Line Masqdialer Client v2.7
Copyright (c) 1998, 1999 Kevin Lindsay and Charles P. Wright

Connecting to server: DingDong

Connection Established...

Authentication Successful!

Connection Status
-----------------

  Connection: ppp0
      Status: UP
       Speed: 57600

    Duration: 39 Seconds

    Bytes In: 47916
  Packets In: 59
   Bytes Out: 11952
 Packets Out: 78

[steph@DeepGlue mclient-2.8]$

Cette fois, cela fonctionne.

Et j'ai pu interrompre la connexion à distance:

[steph@DeepGlue mclient-2.8]$ ./mclient -h DingDong -U steph -P MOTDEPASSE -v -k
Unix Command Line Masqdialer Client v2.7
Copyright (c) 1998, 1999 Kevin Lindsay and Charles P. Wright

Connecting to server: DingDong

Connection Established...

Authentication Successful!

Connection terminated!

[steph@DeepGlue mclient-2.8]$

Et cette fois, la connexion n'a pas été relancée inopinément.


Remarque:
Le -U steph, n'est pas indispensable puisque dans le fichier /etc/mserver.conf, on a autorisé tous les utilisateurs à lancer/couper la connexion:

userallow_connect = "*"        # Anyone can connect
userallow_disconnect = "*"    # Anyone can disconnect


Sous window$:

Le client sur lequel les tests ont été effectués est un poste sous window$98.

J'ai récupéré et dézippé le fichier http://w3.cpwright.com/win95nt-mclient/win95nt-mclient-1.2.2-i386.zip
Il existe d'autres clients.
Pour en avoir la liste, rendez-vous à l'adresse http://w3.cpwright.com/mserver/index.html#downloads

J'ai effectué l'installation via le SETUP.EXE

J'ai effectué la configuration du réseau:
Clic-droit sur l'icone du Voisinage réseau, Propriétés, TCP/IP, Propriétés.
J'ai saisi l'IP du serveur DingDong 192.168.52.3 pour la passerelle et j'ai précisé l'ip du DNS de Libertysurf 213.36.80.1
pour la résolution DNS.

Puis j'ai lancé le client, j'ai précisé l'IP et le port sur lequel mserver tourne et numéroté:

Mclient

J'ai pu surfer sous Window$ avec Mozilla,... et couper la connexion depuis l'interface de MasqDialerClient.


Remarque:
Il est possible de préciser les paramètres:

Paramètres de mclient




Liens:

Mserver et mclient:
Le site de l'auteur de mserver/masqdialer: http://w3.cpwright.com/mserver/

Le site d'Olivier Hoarau est une mine de documentations: http://www.funix.org
Et plus particulièrement pour ce document: http://www.funix.org/fr/linux/main-linux.php3?ref=masqdialer&page=menu

Configuration d'iptables:
Pour apprendre à configurer le firewall netfilter/iptables, je vous propose les adresses suivantes:
Les pages de C.Caleca (pédagogique et précis à souhait): http://www.eme-enseignement.fr/caleca/netfilter/index.html
Les documentations du site Léa-Linux: http://lea-linux.org/reseau/murdefeu.php3 et http://lea-linux.org/reseau/iptables.php3
Ces sites méritent le détour en dehors même de ce qui concerne iptables.