Blame Manuals/Tcpi-ug/Configurations/Ppp/modem.docbook

07124f
<sect1 id="configurations-ppp-modem">
07124f
07124f
    <title>The Modem Device</title>
07124f
07124f
    <para>
07124f
        This section describes the steps you should follow to install
07124f
        and configure the modem device in the computer. This section
07124f
        applies both to server and client computers.
07124f
    </para>
07124f
07124f
    <sect2 id="configurations-ppp-modem-installation">
07124f
    <title>Installation</title>
07124f
    <para>
07124f
        The modem device installation consists on attacthing the modem
07124f
        hardware both to the computer and the telephone line. To
07124f
        connect the modem to your computer, you need to connect the
07124f
        serial or USB cable that comes from the modem hardware to the
07124f
        appropriate input on your computer. To connect the modem to
07124f
        the telephone line system, you need to unplug the cable that
07124f
        connects your phone device and plug it on the modem device,
07124f
        specifically in the port reserved for data transmission.
07124f
        Later, using a similar cable, you could connect your phone
07124f
        device to the modem's phone port, so you be able of realizing
07124f
        phone calls when no data transmition take place, as well.
07124f
    </para>
07124f
07124f
    <para>
07124f
        To be on the safe side, do all the installation with the
07124f
        computer turned off. Then, when everthing has been put in
07124f
        place, turn it on. Once the system is up, you can verify the
07124f
        modem hardware using either the <command>lsusb</command> or
07124f
        <command>lspci</command> commands. For example, if you are
07124f
        using an USB modem like that one we mentioned before, run the
07124f
        following command:
07124f
    </para>
07124f
07124f
    <screen>sudo /sbin/lsusb</screen>
07124f
07124f
    <para>
07124f
        and you should get an output similar to the following:
07124f
    </para>
07124f
07124f
<screen>
07124f
Bus 003 Device 001: ID 0000:0000  
07124f
Bus 001 Device 001: ID 0000:0000  
07124f
Bus 001 Device 002: ID 058f:6366 Alcor Micro Corp. Multi Flash Reader
07124f
Bus 002 Device 001: ID 0000:0000  
07124f
Bus 005 Device 003: ID 06e0:f104 Multi-Tech Systems, Inc.
07124f
MT5634ZBA-USB MultiModemUSB (new firmware)
07124f
Bus 005 Device 001: ID 0000:0000  
07124f
Bus 005 Device 002: ID 046d:c018 Logitech, Inc. Optical Wheel Mouse
07124f
Bus 004 Device 001: ID 0000:0000 
07124f
</screen>
07124f
07124f
    <para>
07124f
        The relevant line here is that mentioning the existence of a
07124f
        Multi-Tech System, Inc. MT5634ZBA-USB MultiModemUSB (new
07124f
        firmware) device.
07124f
    </para>
07124f
07124f
    </sect2>
07124f
07124f
    <sect2 id="configurations-ppp-modem-config">
07124f
    <title>Configuration</title>
07124f
07124f
    <para>
07124f
        Once the modem hardware has been installed in the computer, it
07124f
        is necessary to determine what device inside the operating
07124f
        system it was assigned to, so applications like
07124f
        <command>pppd</command> and <command>chat</command> can talk
193865
        to it.  This configuration process can be realized through the
193865
        <command>wvdialconf</command> command distributed with the
193865
        <package>wvdial</package> package or the
193865
        <command>system-config-network</command> command. Once the 
193865
    </para>
193865
193865
    <sect3 id="configurations-ppp-modem-config-wvdial">
193865
    <title><command>wvdialconf</command></title>
193865
193865
    <para>
193865
        The <command>wvdialconf</command> automatically detects your
193865
        modem and generates/updates the <command>wvdial</command>
193865
        configuration file (<filename>/etc/wvdial.conf</filename>)
193865
        using the modem's maximum baud rate found in the
193865
        auto-detection process, and a good initialization string for
193865
        it, as well.  To set the modem configuration through
193865
        <command>wvdialconf</command> command, run the following
193865
        command:
07124f
    </para>
07124f
07124f
    <screen>sudo /usr/bin/wvdialconf /etc/wvdial.conf</screen>
07124f
    
07124f
    <para>
193865
        This command will produce an output like the following:
07124f
    </para>
07124f
07124f
<screen>
07124f
Scanning your serial ports for a modem.
07124f
07124f
ttyS0<*1>: ATQ0 V1 E1 -- failed with 2400 baud, next try: 9600 baud
07124f
ttyS0<*1>: ATQ0 V1 E1 -- failed with 9600 baud, next try: 115200 baud
07124f
ttyS0<*1>: ATQ0 V1 E1 -- and failed too at 115200, giving up.
07124f
Port Scan<*1>: S1   S2   S3   
07124f
WvModem<*1>: Cannot get information for serial port.
07124f
ttyACM0<*1>: ATQ0 V1 E1 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 Z -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 -- OK
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
07124f
ttyACM0<*1>: Modem Identifier: ATI -- LT V.90 1.0 MT5634ZBA-USB
07124f
Data/Fax Modem (Dual Config) Version 5.18e
07124f
ttyACM0<*1>: Speed 4800: AT -- OK
07124f
ttyACM0<*1>: Speed 9600: AT -- OK
07124f
ttyACM0<*1>: Speed 19200: AT -- OK
07124f
ttyACM0<*1>: Speed 38400: AT -- OK
07124f
ttyACM0<*1>: Speed 57600: AT -- OK
07124f
ttyACM0<*1>: Speed 115200: AT -- OK
07124f
ttyACM0<*1>: Speed 230400: AT -- OK
07124f
ttyACM0<*1>: Speed 460800: AT -- OK
07124f
ttyACM0<*1>: Max speed is 460800; that should be safe.
07124f
ttyACM0<*1>: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 -- OK
07124f
07124f
Found an USB modem on /dev/ttyACM0.
07124f
Modem configuration written to /etc/wvdial.conf.
07124f
ttyACM0<Info>: Speed 460800; init "ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0"
07124f
</screen>
07124f
07124f
    <para>
193865
        and a <command>wvdial</command> configuration file like the
193865
        following:
07124f
    </para>
07124f
07124f
<screen>
07124f
[Dialer Defaults]
07124f
Modem = /dev/ttyACM0
07124f
Baud = 460800
07124f
Init1 = ATZ
07124f
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
07124f
ISDN = 0
07124f
Modem Type = USB Modem
07124f
; Phone = <Target Phone Number>
07124f
; Username = <Your Login Name>
07124f
; Password = <Your Password>
07124f
</screen>
07124f
07124f
    <para>
07124f
        At this point, the computer should be ready to attend incoming
193865
        calls.  
193865
    </para>
193865
193865
    <para>
193865
        When an incoming call arrives to the server they are attended
193865
        by the <application>pppd</application> deamon. To administer
193865
        the way such incoming calls are attended (e.g., forcing user
193865
        authentication, restricting the phone numbers the calls can be
193865
        initiated from, etc.), you need to set the
193865
        <application>pppd</application> deamon configuration to fit
193865
        your needs.  To know more about how to configure the
193865
        <application>pppd</application> deamon and the options it
193865
        provides, read its man page (e.g., <command>man
193865
        pppd</command>).
193865
    </para>
193865
        
193865
    <para>
193865
        On the other hand, when you are configuring a computer to act
193865
        as client (i.e., you are calling out an ISP to establish
193865
        connection to it), you need to realize a few more tunning
193865
        steps on <filename>/etc/wvdial.conf</filename> to set the
193865
        information related of that Internet Service Provider (ISP)
193865
        you want to get connected to (e.g., uncommenting the
07124f
        Phone, Username and
07124f
        Password lines above to set the appropiate values
193865
        there). 
193865
    </para>
193865
    
193865
    <para>
193865
        Once you've specified the ISP information, run the following
193865
        command to stablish connection: 
07124f
    </para>
07124f
193865
    <screen>sudo /usr/bin/wvdial</screen>
07124f
193865
    <note>
07124f
    <para>
193865
        Both <command>wvdial</command> and
193865
        <command>wvdialconf</command> commands must be run with
193865
        administrative privilages because its configuration file
193865
        (<filename>/etc/wvdial.conf</filename>) is readable by the
193865
        <systemitem class="username">root</systemitem> user only.
07124f
    </para>
193865
    </note>
07124f
07124f
    </sect3>
07124f
193865
    <sect3 id="configuration-ppp-modem-config-scn">
193865
    <title><command>system-config-network</command></title>
193865
07124f
    <para>
193865
        In addition to the configuration process described so far, you
193865
        can manage modem configurations through the
193865
        <command>system-config-network</command> command. This command
193865
        provides a graphical interface (administrative privileges
193865
        required) which let you configure several ISP and alternate
193865
        the one you connect to. This command has been already
193865
        documented in the <citetitle>Deployment Guide</citetitle>
193865
        availabe in the <package>Deployment_Guide</package> and we
193865
        won't duplicate that information here. However, there are some
193865
        differences between the output produced by
193865
        <command>system-config-network</command> and
193865
        <command>wvdialconf</command> commads you need to be aware of.
07124f
    </para>
07124f
193865
    <para>
193865
        The first thing to know is that both
193865
        <command>system-config-network</command> and
193865
        <command>wvdialconf</command> commands write configurations to
193865
        the <filename>/etc/wvdial.conf</filename> file, but the
193865
        interface provided by <command>system-config-network</command>
193865
        command doesn't detect the configuration intially created by
193865
        <command>wvdialconf</command> command. In fact, if you set a
193865
        new (modem) hardware configuration through the interface
193865
        provided by the <command>system-config-network</command>
193865
        command, any configuraion previously created by
193865
        <command>wvdailconf</command> will be lost.
193865
    </para>
193865
193865
    <caution>
193865
    <para>
193865
        The interface provided by
193865
        <command>system-config-network</command> command doesn't
193865
        provide modem device detection (as
193865
        <command>wvdialconf</command> would do) and uses the
193865
        <filename>/dev/modem</filename> as default location. This
193865
        location doesn't exists by default, so whatever configuration
193865
        you set from it will not work. To solve this, chose one of the
193865
        following workarounds: 
193865
    </para>
193865
    <itemizedlist>
193865
    <listitem>
193865
    <para>
193865
        Replace the <filename>/dev/modem</filename> location by that
193865
        one <command>wvdialconf</command> found when the interface
193865
        provided by <command>system-config-network</command> ask you
193865
        to enter the modem device.
193865
    </para>
193865
    </listitem>
193865
    <listitem>
193865
    <para>
193865
        Create <filename>/dev/modem</filename> location as a symbolic
193865
        link to that location found by <command>wvdialconf</command>
193865
        command. For example:
193865
        <screen>sudo /bin/ln -s /dev/ttyACM0 /dev/modem</screen>
193865
    </para>
193865
    </listitem>
193865
    </itemizedlist>
193865
    </caution>
07124f
07124f
    <para>
193865
        Inside the <filename>/etc/wvdial.conf</filename> configuration
193865
        file, the interface provided by
193865
        <command>system-config-network</command> identifies default
193865
        modem configurations through the line [Modem0],
193865
        while the <command>wvdialconf</command> command does the same
193865
        through the line [Dialer Defauls]. Something
193865
        interesting about the configuration file created by
193865
        <command>system-config-network</command> is that it is
193865
        possible to create several ISP configurations that reuse
193865
        default settings in the [Modem0] section. For
193865
        example, consider the following example:
07124f
    </para>
07124f
07124f
<screen>
193865
[Modem0]
193865
Modem = /dev/ttyACM0
193865
Baud = 460800
193865
SetVolume = 2
193865
Dial Command = ATDT
193865
Init1 = ATZ
193865
Init3 = ATM1L2
193865
FlowControl = CRTSCTS
193865
[Dialer Vispa_Internet]
193865
Username = signup
193865
Password = rebel
193865
Phone = 08453080125
193865
Stupid Mode = 1
193865
Init1 = ATZ
193865
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
193865
Inherits = Modem0
07124f
</screen>
193865
193865
    </sect3>
193865
07124f
    </sect2>
07124f
07124f
</sect1>