Lines 73-82
Link Here
|
73 |
|
73 |
|
74 |
<itemizedlist> |
74 |
<itemizedlist> |
75 |
<listitem> |
75 |
<listitem> |
76 |
<para>be familiar with basic network terminology.</para> |
76 |
<para>Be familiar with basic network terminology.</para> |
77 |
</listitem> |
77 |
</listitem> |
78 |
<listitem> |
78 |
<listitem> |
79 |
<para>understand the basics and purpose of a dialup connection |
79 |
<para>Understand the basics and purpose of a dialup connection |
80 |
and PPP and/or SLIP.</para> |
80 |
and PPP and/or SLIP.</para> |
81 |
</listitem> |
81 |
</listitem> |
82 |
</itemizedlist> |
82 |
</itemizedlist> |
Lines 103-108
Link Here
|
103 |
<sect1info> |
103 |
<sect1info> |
104 |
<authorgroup> |
104 |
<authorgroup> |
105 |
<author> |
105 |
<author> |
|
|
106 |
<firstname>Tom</firstname> |
107 |
<surname>Rhodes</surname> |
108 |
<contrib>Updated and enhanced by </contrib> |
109 |
</author> |
110 |
</authorgroup> |
111 |
<authorgroup> |
112 |
<author> |
106 |
<firstname>Brian</firstname> |
113 |
<firstname>Brian</firstname> |
107 |
<surname>Somers</surname> |
114 |
<surname>Somers</surname> |
108 |
<contrib>Originally contributed by </contrib> |
115 |
<contrib>Originally contributed by </contrib> |
Lines 186-193
Link Here
|
186 |
Normally, you will be given two IP addresses by your ISP to |
193 |
Normally, you will be given two IP addresses by your ISP to |
187 |
use for this. If they have not given you at least one, then |
194 |
use for this. If they have not given you at least one, then |
188 |
you can use the <command>enable dns</command> command in |
195 |
you can use the <command>enable dns</command> command in |
189 |
your <filename>ppp.conf</filename> file to tell |
196 |
your <filename>ppp.conf</filename> file to have |
190 |
<application>ppp</application> to set the name servers for |
197 |
<application>ppp</application> set the name servers for |
191 |
you. This feature depends on your ISPs PPP implementation |
198 |
you. This feature depends on your ISPs PPP implementation |
192 |
supporting DNS negotiation.</para> |
199 |
supporting DNS negotiation.</para> |
193 |
</listitem> |
200 |
</listitem> |
Lines 228-234
Link Here
|
228 |
<para>If you do not have any of the required information, contact |
235 |
<para>If you do not have any of the required information, contact |
229 |
your ISP.</para> |
236 |
your ISP.</para> |
230 |
|
237 |
|
231 |
|
|
|
232 |
<note> |
238 |
<note> |
233 |
<para>Throughout this section, many of the examples showing |
239 |
<para>Throughout this section, many of the examples showing |
234 |
the contents of configuration files are numbered by line. |
240 |
the contents of configuration files are numbered by line. |
Lines 271-277
Link Here
|
271 |
the existence of the <devicename>tun0</devicename> device should |
277 |
the existence of the <devicename>tun0</devicename> device should |
272 |
be verified (this is not necessary if DEVFS is enabled as device |
278 |
be verified (this is not necessary if DEVFS is enabled as device |
273 |
nodes will be created on demand).</para> |
279 |
nodes will be created on demand).</para> |
274 |
|
280 |
|
275 |
<para>The easiest way to make sure that the |
281 |
<para>The easiest way to make sure that the |
276 |
<devicename>tun0</devicename> device is configured correctly |
282 |
<devicename>tun0</devicename> device is configured correctly |
277 |
is to remake the device. To remake the device, do the |
283 |
is to remake the device. To remake the device, do the |
Lines 286-422
Link Here
|
286 |
|
292 |
|
287 |
<screen>&prompt.root; <userinput>cd /dev</userinput> |
293 |
<screen>&prompt.root; <userinput>cd /dev</userinput> |
288 |
&prompt.root; <userinput>sh MAKEDEV tun15</userinput></screen> |
294 |
&prompt.root; <userinput>sh MAKEDEV tun15</userinput></screen> |
289 |
</sect3> |
|
|
290 |
|
295 |
|
291 |
<sect3> |
296 |
<sect4> |
292 |
<title>Name Resolution Configuration</title> |
297 |
<title>Check the Modem</title> |
|
|
298 |
<para>If you reconfigured your <filename>kernel</filename> |
299 |
then you should recall the <devicename>sio</devicename> |
300 |
device. If your modem acts like a standard serial port |
301 |
then you most likely only need to make the serial device. |
302 |
You can do this by changing your directory to |
303 |
<filename>/dev</filename> and running the <filename>MAKEDEV</filename> |
304 |
script like above. Now make the serial device with |
305 |
<screen>&prompt.root; <userinput>sh MAKEDEV cuaa</userinput></screen> |
306 |
which will create the serial devices for your system. |
307 |
If your modem is on <devicename>sio1</devicename> or |
308 |
<acronym>COM2</acronym> if you are in dos, then your |
309 |
modem device would be <devicename>/dev/cuaa1</devicename>. |
310 |
</para> |
311 |
</sect4> |
312 |
</sect3> |
293 |
|
313 |
|
294 |
<indexterm id="ppp-resolver"> |
314 |
<sect3> |
295 |
<primary>resolver</primary> |
315 |
<title>Manual Connections</title> |
296 |
</indexterm> |
316 |
<para>Connecting to the internet by manually controlling |
297 |
<indexterm id="ppp-hostname"> |
317 |
<command>ppp</command> is quick, easy, and a great way |
298 |
<primary><command>hostname</command></primary> |
318 |
to debug a connection or just get information on how your |
299 |
</indexterm> |
319 |
<acronym>ISP</acronym> handles connections. Lets start |
300 |
<indexterm id="ppp-hosts"> |
320 |
<application>PPP</application> from the command line, |
301 |
<primary><filename>hosts</filename></primary> |
321 |
note that, in all of our examples we will use <emphasis>localhost</emphasis> |
302 |
</indexterm> |
322 |
as the hostname of the machine running <application>PPP</application>. |
303 |
<para>The resolver is the part of the system that looks up IP |
323 |
You start <command>ppp</command> by just typing <command>ppp</command>: |
304 |
addresses into hostnames and vice versa. It can be configured |
324 |
|
305 |
to look for maps that describe IP to hostname mappings in one of |
325 |
<screen>&prompt.root; <userinput>ppp</userinput></screen> |
306 |
two places. The first is a file called |
326 |
|
307 |
<filename>/etc/hosts</filename>. Read &man.hosts.5; for more |
327 |
<para>We have now started <command>ppp</command></para> |
308 |
information. The second is the Internet Domain Name Service |
328 |
|
309 |
(DNS), a distributed data base. For more information on DNS |
329 |
<screen>ppp ON example> set device <devicename>/dev/cuaa1</devicename></screen> |
310 |
and DNS services, refer to <xref linkend="dns">.</para> |
330 |
|
311 |
|
331 |
<para>We set our modem device, in this case it is |
312 |
<para>The resolver is a set of system calls that perform the name |
332 |
<devicename>cuaa1</devicename></para> |
313 |
mappings, but you have to tell it where to find the |
333 |
|
314 |
information. For versions of FreeBSD prior to 5.0. This is done by |
334 |
<screen>ppp ON example> set speed 115200</screen> |
315 |
editing the file <filename>/etc/host.conf</filename>. |
335 |
|
316 |
FreeBSD 5.0 uses the <filename>/etc/nsswitch.conf</filename> file.</para> |
336 |
<para>Set the connection speed, in this case we |
317 |
|
337 |
are using 115,200 <acronym>kbps</acronym></para> |
318 |
<sect4> |
338 |
|
319 |
<title>Edit <filename>/etc/host.conf</filename></title> |
339 |
<screen>ppp ON example> enable dns</screen> |
320 |
|
340 |
|
321 |
<para>For versions of FreeBSD prior to 5.0, this file should |
341 |
<para>Tell <command>ppp</command> to configure our |
322 |
contain the following two lines (in this order):</para> |
342 |
resolver and add the nameserver lines to |
323 |
|
343 |
<filename>/etc/resolv.conf</filename>. If we <command>ppp</command> |
324 |
<programlisting>hosts |
344 |
cannot determine our hostname, we can set one manually later |
325 |
bind</programlisting> |
345 |
</para> |
326 |
|
346 |
|
327 |
<para>This instructs the resolver to first look in the file |
347 |
<screen>ppp ON example> term</screen> |
328 |
<filename>/etc/hosts</filename>, and to then consult the DNS |
348 |
|
329 |
if the name was not found.</para> |
349 |
<para>Switch to "terminal" mode so that we can manually |
330 |
</sect4> |
350 |
control the modem</para> |
331 |
|
351 |
|
332 |
<sect4> |
352 |
<programlisting> |
333 |
<title>Edit <filename>/etc/nsswitch.conf</filename></title> |
353 |
deflink: Entering terminal mode on <devicename>/dev/cuaa1</devicename> |
334 |
|
354 |
type '~h' for help</programlisting> |
335 |
<para>For FreeBSD version 5.0 or above, this file should |
355 |
|
336 |
contain at least the following line:</para> |
356 |
<screen><userinput>at</userinput> |
337 |
|
357 |
OK |
338 |
<programlisting>hosts: files, dns</programlisting> |
358 |
<userinput>atdt<replaceable>123456789</replaceable></userinput></screen> |
339 |
|
359 |
|
340 |
<para>This instructs the resolver to first look in the file |
360 |
<para>Use <command>at</command> to initialize the modem, |
341 |
<filename>/etc/hosts</filename>, and to then consult DNS |
361 |
then use <command>atdt</command> and the number for your |
342 |
if the name was not found.</para> |
362 |
<acronym>ISP</acronym> to begin the dial in process</para> |
343 |
</sect4> |
363 |
|
344 |
|
364 |
<screen>CONNECT</screen> |
345 |
<sect4> |
365 |
|
346 |
<title>Edit <filename>/etc/hosts</filename></title> |
366 |
<para>Confirmation of the connection, if we are going to have |
347 |
|
367 |
any connection problems, unrelated to hardware, here is where |
348 |
<para>This file may contain the IP addresses and names of |
368 |
we will attempt to resolve them.</para> |
349 |
machines on your local network. At a bare minimum it should |
369 |
|
350 |
contain |
370 |
<screen>ISP Login:<userinput>myusername</userinput></screen> |
351 |
entries for the machine which will be running ppp. Assuming |
371 |
|
352 |
that your machine is called <hostid |
372 |
<para>Here you are prompted for a username, return the |
353 |
role="fqdn">foo.example.com</hostid> with the IP address <hostid |
373 |
prompt with the username that was provided by the |
354 |
role="ipaddr">10.0.0.1</hostid>, |
374 |
<acronym>ISP</acronym></para> |
355 |
<filename>/etc/hosts</filename> should contain:</para> |
375 |
|
356 |
|
376 |
<screen>ISP Pass:<userinput>mypassword</userinput></screen> |
357 |
<programlisting>127.0.0.1 localhost.example.com localhost |
377 |
|
358 |
::1 localhost.example.com localhost |
378 |
<para>This time we are prompted for a password, just |
359 |
10.0.0.1 foo.example.com foo</programlisting> |
379 |
reply with the password that was provided by the |
360 |
|
380 |
<acronym>ISP</acronym>. Just like when logging into |
361 |
<para>The first two lines define the alias |
381 |
FreeBSD, the password will not echo.</para> |
362 |
<hostid>localhost</hostid> as a synonym for the current |
382 |
|
363 |
machine. Regardless of your own IP address, the IP addresses |
383 |
<screen>Shell or PPP:<userinput>ppp</userinput></screen> |
364 |
for these lines should always be <hostid |
384 |
|
365 |
role="ipaddr">127.0.0.1</hostid> and <hostid |
385 |
<para>Depending on your <acronym>ISP</acronym> this prompt |
366 |
role="ipaddr">::1</hostid>. The last line maps |
386 |
may never appear. Here we are being asked if we wish to |
367 |
the name <hostid role="fqdn">foo.example.com</hostid> (and the |
387 |
use a shell on the provider, or to start |
368 |
shorthand <hostid>foo</hostid>) to the IP address <hostid |
388 |
<command>ppp</command>. In this example, we have chosen |
369 |
role="ipaddr">10.0.0.1</hostid>.</para> |
389 |
to use <command>ppp</command> as we want an internet |
370 |
|
390 |
connection.</para> |
371 |
<note> |
391 |
|
372 |
<para><hostid role="ipaddr">127.0.0.1</hostid> and |
392 |
<screen>Ppp ON example></screen> |
373 |
<hostid>localhost</hostid> are known as loopback |
393 |
|
374 |
addresses, which loopback to the local machine.</para> |
394 |
<para>Notice that in this example the first <option>p</option> |
375 |
</note> |
395 |
has been capitalized. This shows that we have successfully |
376 |
|
396 |
connected to the <acronym>ISP</acronym>.</para> |
377 |
<para>If your provider allocates you a static IP address and |
397 |
|
378 |
name, and you are not using that as your host name, add this |
398 |
<screen>PPp ON example></screen> |
379 |
to the <filename>/etc/hosts</filename> too.</para> |
399 |
|
380 |
</sect4> |
400 |
<para>We have successfully authenticated with our |
381 |
|
401 |
<acronym>ISP</acronym> and are waiting for the |
382 |
<sect4> |
402 |
assigned <acronym>IP</acronym> address.</para> |
383 |
<title>Edit <filename>/etc/resolv.conf</filename></title> |
403 |
|
384 |
|
404 |
<screen>PPP ON example></screen> |
385 |
<para>The <filename>/etc/resolv.conf</filename> file tells the |
405 |
|
386 |
resolver how to behave. Normally, you will need to enter |
406 |
<para>We have made an agreement on an <acronym>IP</acronym> |
387 |
the following line(s):</para> |
407 |
address and successfully completed our connection</para> |
|
|
408 |
|
409 |
<screen>PPP ON example>add default HISADDR</screen> |
410 |
|
411 |
<para>Here we add our default route, we need to do this |
412 |
before we can talk to the outside world as currently the |
413 |
only established connection is with the peer. If this |
414 |
fails due to existing routes you can put a bang character |
415 |
<emphasis>!</emphasis> in front of the <option>add</option>. |
416 |
Alternatively, you can set this before making the actual connection |
417 |
and it will negotiate a new route accordingly.</para> |
418 |
|
419 |
<para>If everything went good we should now have an active |
420 |
connection to the internet, which could be thrown into |
421 |
the background using |
422 |
<keycombo action="simul"><keycap>CTRL</keycap> <keycap>z</keycap></keycombo> |
423 |
If you notice the <command>PPP</command> return to |
424 |
<command>ppp</command> then we have lost our connection. |
425 |
This is good to know because it shows our connection status. |
426 |
Capital P's show that we have a connection to the |
427 |
<acronym>ISP</acronym> and lowercase p's show that the |
428 |
connection has been lost for whatever reason. |
429 |
<command>ppp</command> only has these 2 states. |
430 |
</para> |
431 |
|
432 |
<sect4> |
433 |
<title>Troubleshooting Manual Connections</title> |
434 |
<para>Like everything else, once in awhile a problem or |
435 |
may occur. <application>PPP</application> is no |
436 |
exemption to this theory. If <command>ppp</command> |
437 |
would happen to stop responding there are some things |
438 |
we can try.</para> |
439 |
|
440 |
<para>If you have a direct line and cannot seem to make a |
441 |
connection, then turn hardware flow <acronym>CTS/RTS</acronym> |
442 |
to off with the <option>set ctsrts off</option>. This is |
443 |
mainly the case if you are connected to some |
444 |
<application>PPP</application> capable terminal servers, |
445 |
where <application>PPP</application> hangs when it tries |
446 |
to write data to your communication link, so it would |
447 |
would be waiting for a <acronym>CTS</acronym>, or Clear |
448 |
To Send signal which may never come. If you use this |
449 |
option however, you should also use the <option>set accmap</option> |
450 |
option, which may be required to defeat hardware dependent on |
451 |
passing certain characters from end to end, most of the time |
452 |
XON/XOFF. See the &man.ppp.8; man page for more information |
453 |
on this option, and how it is used.</para> |
454 |
|
455 |
<para>If you have an older modem, you may need to use the |
456 |
<option>set parity even</option>. Parity is set at none |
457 |
be default, but is used for error checking (with a large |
458 |
increase in traffic) on older modems and some |
459 |
<acronym>ISP</acronym>s. You may need this option for |
460 |
the Compuserve ISP.</para> |
461 |
|
462 |
<para><application>PPP</application> may not return to the |
463 |
command mode, which is usually a negotiation error where |
464 |
the <acronym>ISP</acronym> is waiting for your side to start |
465 |
negotiating. At this point, using the <command>~p</command> |
466 |
command will force ppp to start sending the configuration |
467 |
information.</para> |
468 |
|
469 |
<para>If you never obtain a login prompt, then most likely you |
470 |
you need to use <acronym>PAP</acronym> or <acronym>CHAP</acronym> |
471 |
authentication instead of the Unix-style in the example above. To |
472 |
use <acronym>PAP</acronym> or <acronym>CHAP</acronym> just add the |
473 |
following options to <application>PPP</application> before going |
474 |
into terminal mode:</para> |
475 |
|
476 |
<screen>ppp ON localhost> <userinput>set authname <replaceable>myusername</replaceable></userinput></screen> |
477 |
|
478 |
<para>Where <replaceable>myusername</replaceable> should be replaced with |
479 |
the username that was assigned by the <acronym>ISP</acronym>.</para> |
480 |
|
481 |
<screen>ppp ON localhost> <userinput>set authkey <replaceable>mypassword</replaceable></userinput></screen> |
482 |
|
483 |
<para>Where <replaceable>mypassword</replaceable> should be replaced with |
484 |
the password that was assigned by the <acronym>ISP</acronym>.</para> |
485 |
|
486 |
<para>If you connect fine, but cannot seem to find any domain name, try to |
487 |
use &man.ping.8; with an <acronym>IP</acronym> address and see if you |
488 |
can get any return information. If you experience 100 percent (100%) |
489 |
packet loss, then its most likely that you were not assigned a default |
490 |
route. Double check that the option <option>add default HISADDR</option> |
491 |
was set during the connection. If you can connect to a remote |
492 |
<acronym>IP</acronym> address then it is possible that a resolver address |
493 |
has not been added to the <filename>/etc/resolv.conf</filename>. This |
494 |
file should look like:</para> |
388 |
|
495 |
|
389 |
<programlisting>domain <replaceable>example.com</replaceable> |
496 |
<programlisting>domain <replaceable>example.com</replaceable> |
390 |
nameserver <replaceable>x.x.x.x</replaceable> |
497 |
nameserver <replaceable>x.x.x.x</replaceable> |
391 |
nameserver <replaceable>y.y.y.y</replaceable></programlisting> |
498 |
nameserver <replaceable>y.y.y.y</replaceable></programlisting> |
392 |
|
499 |
|
393 |
<para>The <hostid |
500 |
<para>Where <replaceable>x.x.x.x</replaceable> and |
394 |
role="ipaddr"><replaceable>x.x.x.x</replaceable></hostid> and |
501 |
<replaceable>y.y.y.y</replaceable> should be replaced with the |
395 |
<hostid role="ipaddr"><replaceable>y.y.y.y</replaceable></hostid> |
502 |
<acronym>IP</acronym> address of your <acronym>ISP</acronym>'s DNS servers. |
396 |
addresses are those given to you by your ISP. Add as many |
503 |
This information may or may not have been provided when you signed up, but |
397 |
<literal>nameserver</literal> lines as your ISP provides. The |
504 |
a quick call to your <acronym>ISP</acronym> should remedy that.</para> |
398 |
<literal>domain</literal> line is set to your hosts |
505 |
|
399 |
domain name. Refer to the &man.resolv.conf.5; manual page for |
506 |
<para>You could also have &man.syslog.3; provide a logging function |
400 |
details of other possible entries in this file.</para> |
507 |
for your <application>PPP</application> connection. Just add:</para> |
401 |
|
508 |
|
402 |
<para>If you are running a local name server, replace the |
509 |
<programlisting> |
403 |
above nameserver lines with:</para> |
510 |
!ppp |
404 |
|
511 |
*.* /var/log/ppp.log</programlisting> |
405 |
<programlisting>nameserver <replaceable>0.0.0.0</replaceable></programlisting> |
512 |
|
406 |
|
513 |
<para>to <filename>/etc/syslog.conf</filename>. In most cases, this |
407 |
<indexterm><primary>PPP</primary></indexterm> |
514 |
functionality already exists.</para> |
408 |
<indexterm><primary>ISP</primary></indexterm> |
515 |
|
409 |
<para>The <command>enable dns</command> command (entered in the |
516 |
</sect4> |
410 |
<filename>/etc/ppp/ppp.conf</filename> file - see below) will |
|
|
411 |
tell PPP to request that your ISP confirms the nameserver values. |
412 |
If your ISP supplies different addresses (or if there are no |
413 |
nameserver lines in <filename>/etc/resolv.conf</filename>), PPP |
414 |
will rewrite the file with the ISP-supplied values.</para> |
415 |
</sect4> |
416 |
</sect3> |
517 |
</sect3> |
417 |
|
518 |
|
418 |
<sect3> |
519 |
<sect3> |
419 |
<title><application>PPP</application> Configuration</title> |
520 |
<title>Automatic <application>PPP</application> Configuration</title> |
420 |
|
521 |
|
421 |
<indexterm><primary>PPP</primary><secondary>configuration</secondary></indexterm> |
522 |
<indexterm><primary>PPP</primary><secondary>configuration</secondary></indexterm> |
422 |
<para>Both <command>ppp</command> and <command>pppd</command> |
523 |
<para>Both <command>ppp</command> and <command>pppd</command> |
Lines 444-450
Link Here
|
444 |
<para>Lines that end in a <literal>:</literal> start in |
545 |
<para>Lines that end in a <literal>:</literal> start in |
445 |
the first column (beginning of the line)— all other |
546 |
the first column (beginning of the line)— all other |
446 |
lines should be indented as shown using spaces or |
547 |
lines should be indented as shown using spaces or |
447 |
tabs.</para> |
548 |
tabs. Most of the information you need to provide here |
|
|
549 |
was shown to us by doing the manual dial above.</para> |
448 |
</note> |
550 |
</note> |
449 |
|
551 |
|
450 |
<programlisting>1 default: |
552 |
<programlisting>1 default: |
Lines 574-580
Link Here
|
574 |
|
676 |
|
575 |
<listitem> |
677 |
<listitem> |
576 |
<para>Identifies an entry for a provider called |
678 |
<para>Identifies an entry for a provider called |
577 |
<quote>provider</quote>.</para> |
679 |
<quote>provider</quote>. This could be changed |
|
|
680 |
to the name of your <acronym>ISP</acronym> so |
681 |
that later you can use the <option>load ISP</option> |
682 |
to start the connection.</para> |
578 |
</listitem> |
683 |
</listitem> |
579 |
</varlistentry> |
684 |
</varlistentry> |