old-www/HOWTO/PPP-HOWTO/manual.html

523 lines
11 KiB
HTML

<HTML
><HEAD
><TITLE
>Setting up the PPP connection manually</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.52"><LINK
REL="HOME"
TITLE="Linux PPP HOWTO"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="Handling multiple PAP-authenticated connections"
HREF="x1071.html"><LINK
REL="NEXT"
TITLE="Automating your connections - Creating the connection scripts"
HREF="automate.html"></HEAD
><BODY
CLASS="CHAPTER"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
><A
HREF="http://www.linuxports.com/howto/ppp"
TARGET="_top"
>Linux PPP HOWTO</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x1071.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="automate.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="CHAPTER"
><H1
><A
NAME="MANUAL"
>Chapter 17. Setting up the PPP connection manually</A
></H1
><P
>Now that you have created your <TT
CLASS="LITERAL"
>/etc/ppp/options</TT
> and
<TT
CLASS="LITERAL"
>/etc/resolv.conf</TT
> files (and, if necessary, the
<TT
CLASS="LITERAL"
>/etc/ppp/pap|chap-secrets</TT
> file), you can test the settings by
manually establishing a PPP connection. (Once we have the manual
connection working, we will automate the process).</P
><P
>To do this, your communications software must be capable of quitting
WITHOUT resetting the modem. Minicom can do this - ALT Q (or in older
version of minicom CTRL A Q)</P
><P
>Make sure you are logged in as root.</P
><P
>Fire up you communications software, (such as minicom), dial into the PPP
server and log in as normal. If you need to issue a command to start up
PPP on the server, do so. You will now see the garbage you saw before.</P
><P
>If you are using pap or chap, then merely connecting to the remote system
should start ppp on the remote and you will see the garbage without
logging in, (although this may not happen for some servers - try pressing
<I
CLASS="EMPHASIS"
>Enter</I
> and see if the garbage starts up).</P
><P
>Now quit the communications software <I
CLASS="EMPHASIS"
>without resetting the modem</I
> (ALT Q
or CTL A Q in minicom) and at the Linux prompt (as root) type...</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>pppd -d -detach /dev/ttySx 38400 &#38;</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>The -d option turns on debugging - the ppp connection start up
conversation will be logged to your system log - which is useful if
you are having trouble.</P
><P
>Your modem lights should now flash as the PPP connection is established.
It will take a short while for the PPP connection to be made.</P
><P
>At this point you can look at the PPP interface, by issuing the command:-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>ifconfig</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>In addition to any Ethernet and loop back devices you have, you
should see something like :-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>ppp0 Link encap:Point-Point Protocol
inet addr:10.144.153.104 P-t-P:10.144.153.51 Mask:255.255.255.0
UP POINTOPOINT RUNNING MTU:552 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>Where
<P
></P
><UL
><LI
><P
>inet addr:10.144.153.10 is the IP number of your end of the link.</P
></LI
><LI
><P
>P-t-P:10.144.153.5 is the SERVER's IP number.</P
></LI
></UL
>&#13;</P
><P
>(Naturally, ifconfig will not report these IP numbers, but the ones used
by your PPP server.)</P
><P
>Note: ifconfig also tells you that the link is UP and RUNNING!</P
><P
>If you get no ppp device listed or something like:-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>ppp0 Link encap:Point-Point Protocol
inet addr:0.0.0.0 P-t-P:0.0.0.0 Mask:0.0.0.0
POINTOPOINT MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>Your PPP connection has not been made...see the later section on
debugging!</P
><P
>You should also be able to see a route to the the remote host (and
beyond). To do this, issue the command</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>route -n</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>You should se something like:-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>Kernel routing table
Destination Gateway Genmask Flags MSS Window Use Iface
10.144.153.3 * 255.255.255.255 UH 1500 0 1 ppp0
127.0.0.0 * 255.0.0.0 U 3584 0 11 lo
10.0.0.0 * 255.0.0.0 U 1500 0 35 eth0
default 10.144.153.3 * UG 1500 0 5 ppp0</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>Of particular importance here, notice we have TWO entries pointing to our
ppp interface.</P
><P
>The first is a HOST route, (indicated by the H flag) and
that allows us to see the host to which we are connected to - but no
further.</P
><P
>The second is the default route, (established by giving pppd the option
<TT
CLASS="LITERAL"
>defaultroute</TT
>. This is the route that tells our
Linux PC to send any packets NOT destined for the local Ethernet(s) - to
which we have specific network routes - to the PPP server itself. The
PPP server then is responsible for routing our packets out onto the
Internet and routing the return packets back to us.</P
><P
>If you do not see a routing table with two entries, something is wrong.
In particular if your syslog shows a message telling you pppd is not
replacing an existing default route, then you have a default route
pointing at your Ethernet interface - which <I
CLASS="EMPHASIS"
>MUST</I
> be replaced by a
specific network route: <I
CLASS="EMPHASIS"
>YOU CAN ONLY HAVE ONE DEFAULT ROUTE!!!</I
></P
><P
>You will need to explore your system initialization files to find out
where this default route is being set up (it will use a <TT
CLASS="LITERAL"
>route add
default...</TT
> command). Change this command to something like <TT
CLASS="LITERAL"
>route
add net...</TT
>.</P
><P
>Now test the link by 'pinging' the server at its IP number as reported
by the ifconfig output, i.e.</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>ping 10.144.153.51</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>You should receive output like</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>PING 10.144.153.51 (10.144.153.51): 56 data bytes
64 bytes from 10.144.153.51: icmp_seq=0 ttl=255 time=328.3 ms
64 bytes from 10.144.153.51: icmp_seq=1 ttl=255 time=190.5 ms
64 bytes from 10.144.153.51: icmp_seq=2 ttl=255 time=187.5 ms
64 bytes from 10.144.153.51: icmp_seq=3 ttl=255 time=170.7 ms</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>This listing will go on for ever - to stop it press CTRL C, at which
point you will receive some more information :-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>--- 10.144.153.51 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 170.7/219.2/328.3 ms</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>So far so good.</P
><P
>Now try pinging a host by name (not the name of the PPP server itself)
but a host at another site that you KNOW is probably going to be up and
running...). For example</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>ping sunsite.unc.edu</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>This time there will be a bit of a pause as Linux obtains the IP number
for the fully qualified host name you have 'ping'ed from the DNS you
specified in <TT
CLASS="LITERAL"
>/etc/resolv.conf</TT
> - so don't worry (but you will
see your modem lights flash). Shortly you will receive output like</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
> PING sunsite.unc.edu (152.2.254.81): 56 data bytes
64 bytes from 152.2.254.81: icmp_seq=0 ttl=254 time=190.1 ms
64 bytes from 152.2.254.81: icmp_seq=1 ttl=254 time=180.6 ms
64 bytes from 152.2.254.81: icmp_seq=2 ttl=254 time=169.8 ms
64 bytes from 152.2.254.81: icmp_seq=3 ttl=254 time=170.6 ms
64 bytes from 152.2.254.81: icmp_seq=4 ttl=254 time=170.6 ms</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>Again, stop the output by pressing CTRL C and get the statistics...</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>--- sunsite.unc.edu ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 169.8/176.3/190.1 ms</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>If you don't get any response, try pinging the IP address of the DNS
server at your ISP's site. If you get a result from this, then it looks
like you have a problem with <TT
CLASS="LITERAL"
>/etc/resolv.conf</TT
>.</P
><P
>If this doesn't work, you have a routing problem, or your ISP has a
problem routing packets back to you. Check your routing table as shown
above and if that is OK, contact your ISP. A good test of the ISP is to
use another operating system to connect. If you can get beyond your ISP
with that, then the problem is at your end.</P
><P
>If everything works, shut down the connection by typing:-</P
><P
>&#13;<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>ppp-off</PRE
></TD
></TR
></TABLE
>&#13;</P
><P
>After a short pause, the modem should hang itself up.</P
><P
>If that does not work, either turn off your modem or fire up your
communications software and interrupt the modem with +++ and then hang
up with ATH0 when you receive the modem's OK prompt.</P
><P
>You may also need to clean up the lock file created by pppd.
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>rm -f /var/lock/LCK..ttySx</PRE
></TD
></TR
></TABLE
>&#13;</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x1071.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="automate.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Handling multiple PAP-authenticated connections</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Automating your connections - Creating the connection scripts</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>