From owner-freebsd-doc Mon Feb 18 22:31:15 2002 Delivered-To: freebsd-doc@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1F5E937B419 for ; Mon, 18 Feb 2002 22:30:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1J6U1850669; Mon, 18 Feb 2002 22:30:01 -0800 (PST) (envelope-from gnats) Received: from pittgoth.com (14.zlnp1.xdsl.nauticom.net [209.195.149.111]) by hub.freebsd.org (Postfix) with ESMTP id 6007337B402 for ; Mon, 18 Feb 2002 22:28:38 -0800 (PST) Received: (from darklogik@localhost) by pittgoth.com (8.11.6/8.11.6) id g1J6UOL17025; Tue, 19 Feb 2002 01:30:24 -0500 (EST) (envelope-from darklogik) Message-Id: <200202190630.g1J6UOL17025@pittgoth.com> Date: Tue, 19 Feb 2002 01:30:24 -0500 (EST) From: Tom Rhodes Reply-To: Tom Rhodes To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: docs/35105: [PATCH] handbook User-ppp chapter Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35105 >Category: docs >Synopsis: [PATCH] handbook User-ppp chapter >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 18 22:30:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: >Release: FreeBSD 4.5 i386 >Organization: >Environment: System: FreeBSD localhost 4.5 >Description: Many times over has it mentioned in the past that the PPP chapter either lacks content, needs more information, is difficult to work with, or some other problem... In the pr database, we have a pr requesting a merge of ppp(8) and the handbook PPP chapter. >How-To-Repeat: Read the handbook >Fix: A patch is here for all to review, and someone to commit. Only in handbook: imagelib diff -ru handbook.old/ppp-and-slip/chapter.sgml handbook/ppp-and-slip/chapter.sgml --- handbook.old/ppp-and-slip/chapter.sgml Mon Feb 18 23:57:54 2002 +++ handbook/ppp-and-slip/chapter.sgml Tue Feb 19 01:11:17 2002 @@ -73,10 +73,10 @@ - be familiar with basic network terminology. + Be familiar with basic network terminology. - understand the basics and purpose of a dialup connection + Understand the basics and purpose of a dialup connection and PPP and/or SLIP. @@ -103,6 +103,13 @@ + Tom + Rhodes + Updated and enhanced by + + + + Brian Somers Originally contributed by @@ -186,8 +193,8 @@ Normally, you will be given two IP addresses by your ISP to use for this. If they have not given you at least one, then you can use the enable dns command in - your ppp.conf file to tell - ppp to set the name servers for + your ppp.conf file to have + ppp set the name servers for you. This feature depends on your ISPs PPP implementation supporting DNS negotiation. @@ -228,7 +235,6 @@ If you do not have any of the required information, contact your ISP. - Throughout this section, many of the examples showing the contents of configuration files are numbered by line. @@ -271,7 +277,7 @@ the existence of the tun0 device should be verified (this is not necessary if DEVFS is enabled as device nodes will be created on demand). - + The easiest way to make sure that the tun0 device is configured correctly is to remake the device. To remake the device, do the @@ -286,137 +292,232 @@ &prompt.root; cd /dev &prompt.root; sh MAKEDEV tun15 - - - Name Resolution Configuration + + Check the Modem + If you reconfigured your kernel + then you should recall the sio + device. If your modem acts like a standard serial port + then you most likely only need to make the serial device. + You can do this by changing your directory to + /dev and running the MAKEDEV + script like above. Now make the serial device with +&prompt.root; sh MAKEDEV cuaa + which will create the serial devices for your system. + If your modem is on sio1 or + COM2 if you are in dos, then your + modem device would be /dev/cuaa1. + + + - - resolver - - - hostname - - - hosts - - The resolver is the part of the system that looks up IP - addresses into hostnames and vice versa. It can be configured - to look for maps that describe IP to hostname mappings in one of - two places. The first is a file called - /etc/hosts. Read &man.hosts.5; for more - information. The second is the Internet Domain Name Service - (DNS), a distributed data base. For more information on DNS - and DNS services, refer to . - - The resolver is a set of system calls that perform the name - mappings, but you have to tell it where to find the - information. For versions of FreeBSD prior to 5.0. This is done by - editing the file /etc/host.conf. - FreeBSD 5.0 uses the /etc/nsswitch.conf file. - - - Edit <filename>/etc/host.conf</filename> - - For versions of FreeBSD prior to 5.0, this file should - contain the following two lines (in this order): - - hosts -bind - - This instructs the resolver to first look in the file - /etc/hosts, and to then consult the DNS - if the name was not found. - - - - Edit <filename>/etc/nsswitch.conf</filename> - - For FreeBSD version 5.0 or above, this file should - contain at least the following line: - - hosts: files, dns - - This instructs the resolver to first look in the file - /etc/hosts, and to then consult DNS - if the name was not found. - - - - Edit <filename>/etc/hosts</filename> - - This file may contain the IP addresses and names of - machines on your local network. At a bare minimum it should - contain - entries for the machine which will be running ppp. Assuming - that your machine is called foo.example.com with the IP address 10.0.0.1, - /etc/hosts should contain: - - 127.0.0.1 localhost.example.com localhost -::1 localhost.example.com localhost -10.0.0.1 foo.example.com foo - - The first two lines define the alias - localhost as a synonym for the current - machine. Regardless of your own IP address, the IP addresses - for these lines should always be 127.0.0.1 and ::1. The last line maps - the name foo.example.com (and the - shorthand foo) to the IP address 10.0.0.1. - - - 127.0.0.1 and - localhost are known as loopback - addresses, which loopback to the local machine. - - - If your provider allocates you a static IP address and - name, and you are not using that as your host name, add this - to the /etc/hosts too. - - - - Edit <filename>/etc/resolv.conf</filename> - - The /etc/resolv.conf file tells the - resolver how to behave. Normally, you will need to enter - the following line(s): + + Manual Connections + Connecting to the internet by manually controlling + ppp is quick, easy, and a great way + to debug a connection or just get information on how your + ISP handles connections. Lets start + PPP from the command line, + note that, in all of our examples we will use localhost + as the hostname of the machine running PPP. + You start ppp by just typing ppp: + +&prompt.root; ppp + + We have now started ppp + +ppp ON example> set device /dev/cuaa1 + + We set our modem device, in this case it is + cuaa1 + +ppp ON example> set speed 115200 + + Set the connection speed, in this case we + are using 115,200 kbps + +ppp ON example> enable dns + + Tell ppp to configure our + resolver and add the nameserver lines to + /etc/resolv.conf. If we ppp + cannot determine our hostname, we can set one manually later + + +ppp ON example> term + + Switch to "terminal" mode so that we can manually + control the modem + + +deflink: Entering terminal mode on /dev/cuaa1 +type '~h' for help + +at +OK +atdt123456789 + + Use at to initialize the modem, + then use atdt and the number for your + ISP to begin the dial in process + +CONNECT + + Confirmation of the connection, if we are going to have + any connection problems, unrelated to hardware, here is where + we will attempt to resolve them. + +ISP Login:myusername + + Here you are prompted for a username, return the + prompt with the username that was provided by the + ISP + +ISP Pass:mypassword + + This time we are prompted for a password, just + reply with the password that was provided by the + ISP. Just like when logging into + FreeBSD, the password will not echo. + +Shell or PPP:ppp + + Depending on your ISP this prompt + may never appear. Here we are being asked if we wish to + use a shell on the provider, or to start + ppp. In this example, we have chosen + to use ppp as we want an internet + connection. + +Ppp ON example> + + Notice that in this example the first + has been capitalized. This shows that we have successfully + connected to the ISP. + +PPp ON example> + + We have successfully authenticated with our + ISP and are waiting for the + assigned IP address. + +PPP ON example> + + We have made an agreement on an IP + address and successfully completed our connection + +PPP ON example>add default HISADDR + + Here we add our default route, we need to do this + before we can talk to the outside world as currently the + only established connection is with the peer. If this + fails due to existing routes you can put a bang character + ! in front of the . + Alternatively, you can set this before making the actual connection + and it will negotiate a new route accordingly. + + If everything went good we should now have an active + connection to the internet, which could be thrown into + the background using + CTRL z + If you notice the PPP return to + ppp then we have lost our connection. + This is good to know because it shows our connection status. + Capital P's show that we have a connection to the + ISP and lowercase p's show that the + connection has been lost for whatever reason. + ppp only has these 2 states. + + + + Troubleshooting Manual Connections + Like everything else, once in awhile a problem or + may occur. PPP is no + exemption to this theory. If ppp + would happen to stop responding there are some things + we can try. + + If you have a direct line and cannot seem to make a + connection, then turn hardware flow CTS/RTS + to off with the . This is + mainly the case if you are connected to some + PPP capable terminal servers, + where PPP hangs when it tries + to write data to your communication link, so it would + would be waiting for a CTS, or Clear + To Send signal which may never come. If you use this + option however, you should also use the + option, which may be required to defeat hardware dependent on + passing certain characters from end to end, most of the time + XON/XOFF. See the &man.ppp.8; man page for more information + on this option, and how it is used. + + If you have an older modem, you may need to use the + . Parity is set at none + be default, but is used for error checking (with a large + increase in traffic) on older modems and some + ISPs. You may need this option for + the Compuserve ISP. + + PPP may not return to the + command mode, which is usually a negotiation error where + the ISP is waiting for your side to start + negotiating. At this point, using the ~p + command will force ppp to start sending the configuration + information. + + If you never obtain a login prompt, then most likely you + you need to use PAP or CHAP + authentication instead of the Unix-style in the example above. To + use PAP or CHAP just add the + following options to PPP before going + into terminal mode: + +ppp ON localhost> set authname myusername + + Where myusername should be replaced with + the username that was assigned by the ISP. + +ppp ON localhost> set authkey mypassword + + Where mypassword should be replaced with + the password that was assigned by the ISP. + + If you connect fine, but cannot seem to find any domain name, try to + use &man.ping.8; with an IP address and see if you + can get any return information. If you experience 100 percent (100%) + packet loss, then its most likely that you were not assigned a default + route. Double check that the option + was set during the connection. If you can connect to a remote + IP address then it is possible that a resolver address + has not been added to the /etc/resolv.conf. This + file should look like: domain example.com nameserver x.x.x.x nameserver y.y.y.y - The x.x.x.x and - y.y.y.y - addresses are those given to you by your ISP. Add as many - nameserver lines as your ISP provides. The - domain line is set to your hosts - domain name. Refer to the &man.resolv.conf.5; manual page for - details of other possible entries in this file. - - If you are running a local name server, replace the - above nameserver lines with: - - nameserver 0.0.0.0 - - PPP - ISP - The enable dns command (entered in the - /etc/ppp/ppp.conf file - see below) will - tell PPP to request that your ISP confirms the nameserver values. - If your ISP supplies different addresses (or if there are no - nameserver lines in /etc/resolv.conf), PPP - will rewrite the file with the ISP-supplied values. - + Where x.x.x.x and + y.y.y.y should be replaced with the + IP address of your ISP's DNS servers. + This information may or may not have been provided when you signed up, but + a quick call to your ISP should remedy that. + + You could also have &man.syslog.3; provide a logging function + for your PPP connection. Just add: + + + !ppp + *.* /var/log/ppp.log + + to /etc/syslog.conf. In most cases, this + functionality already exists. + + - <application>PPP</application> Configuration + Automatic <application>PPP</application> Configuration PPPconfiguration Both ppp and pppd @@ -444,7 +545,8 @@ Lines that end in a : start in the first column (beginning of the line)— all other lines should be indented as shown using spaces or - tabs. + tabs. Most of the information you need to provide here + was shown to us by doing the manual dial above. 1 default: @@ -574,7 +676,10 @@ Identifies an entry for a provider called - provider. + provider. This could be changed + to the name of your ISP so + that later you can use the + to start the connection. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message