From owner-svn-doc-all@FreeBSD.ORG Tue Oct 1 21:10:10 2013 Return-Path: Delivered-To: svn-doc-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EF79E949; Tue, 1 Oct 2013 21:10:09 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DC0EE2A90; Tue, 1 Oct 2013 21:10:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r91LA9jA011512; Tue, 1 Oct 2013 21:10:09 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r91LA9xR011510; Tue, 1 Oct 2013 21:10:09 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201310012110.r91LA9xR011510@svn.freebsd.org> From: Glen Barber Date: Tue, 1 Oct 2013 21:10:09 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r42796 - head/en_US.ISO8859-1/books/handbook/ppp-and-slip X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 21:10:10 -0000 Author: gjb Date: Tue Oct 1 21:10:09 2013 New Revision: 42796 URL: http://svnweb.freebsd.org/changeset/doc/42796 Log: MF-ISBN r41456: Remove slip, pppd, and 7.x from PPP chapter. Reviewed by: dru Sponsored by: The FreeBSD Foundation Modified: head/en_US.ISO8859-1/books/handbook/ppp-and-slip/chapter.xml Directory Properties: head/en_US.ISO8859-1/ (props changed) Modified: head/en_US.ISO8859-1/books/handbook/ppp-and-slip/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/handbook/ppp-and-slip/chapter.xml Tue Oct 1 20:34:47 2013 (r42795) +++ head/en_US.ISO8859-1/books/handbook/ppp-and-slip/chapter.xml Tue Oct 1 21:10:09 2013 (r42796) @@ -32,7 +32,7 @@ FreeBSD has a number of ways to link one computer to another. To establish a network or Internet connection through a dial-up modem, or to allow others to do so through you, - requires the use of PPP or SLIP. This chapter describes setting + requires the use of PPP. This chapter describes setting up these modem-based communication services in detail. After reading this chapter, you will know: @@ -42,9 +42,6 @@ How to set up user PPP. - How to set up kernel PPP (&os; 7.X only). - - How to set up PPPoE (PPP over Ethernet). @@ -52,10 +49,6 @@ How to set up PPPoA (PPP over ATM). - - How to configure and set up a SLIP client and - server (&os; 7.X only). - @@ -79,29 +72,9 @@ Understand the basics and purpose of a dialup connection - and PPP and/or SLIP. + and PPP. - - You may be wondering what the main difference is between - user PPP and kernel PPP. The answer is simple: user PPP - processes the inbound and outbound data in userland rather than - in the kernel. This is expensive in terms of copying the data - between the kernel and userland, but allows a far more - feature-rich PPP implementation. User PPP uses the - tun device to communicate with the - outside world whereas kernel PPP uses the - ppp device. - - - Throughout in this chapter, user PPP will simply be - referred to as ppp unless a - distinction needs to be made between it and any other PPP - software such as pppd - (&os; 7.X only). Unless otherwise stated, all of the - commands explained in this chapter should be executed as - root. - @@ -239,11 +212,9 @@ configuration - Both ppp and pppd - (the kernel level implementation of PPP, &os; 7.X only) - use the configuration files located in the /etc/ppp directory. - Examples for user ppp can be found in ppp uses the configuration files + located in /etc/ppp. + Examples can be found in /usr/share/examples/ppp/. Configuring ppp requires that you @@ -1314,505 +1285,6 @@ ifconfig_tun0= - - - - - Gennady B. - Sorokopud - Parts originally contributed by - - - Robert - Huff - - - - - Using Kernel PPP - - - This section applies and is valid only for - &os; 7.X. - - - - Setting Up Kernel PPP - - - PPP - kernel PPP - - - Before you start setting up PPP on your machine, make sure - that pppd is located in - /usr/sbin and the - directory /etc/ppp - exists. - - pppd can work in two modes: - - - - As a client — you want to connect - your machine to the outside world via a PPP serial - connection or modem line. - - - - - PPP - server - - - As a server — your machine is - located on the network, and is used to connect other - computers using PPP. - - - - In both cases you will need to set up an options file - (/etc/ppp/options or - ~/.ppprc if you have more than one user - on your machine that uses PPP). - - You will also need some modem/serial software (preferably - comms/kermit), so you - can dial and establish a connection with the remote - host. - - - - - - - Trev - Roydhouse - Based on information provided by - - - - - - Using <command>pppd</command> as a Client - - - PPP - client - - - - Cisco - - - The following /etc/ppp/options might - be used to connect to a Cisco terminal server PPP line. - - crtscts # enable hardware flow control -modem # modem control line -noipdefault # remote PPP server must supply your IP address - # if the remote host does not send your IP during IPCP - # negotiation, remove this option -passive # wait for LCP packets -domain ppp.foo.com # put your domain name here - -:remote_ip # put the IP of remote PPP host here - # it will be used to route packets via PPP link - # if you didn't specified the noipdefault option - # change this line to local_ip:remote_ip - -defaultroute # put this if you want that PPP server will be your - # default router - - To connect: - - Kermit - modem - - - Dial to the remote host using - Kermit (or some other modem - program), and enter your user name and password (or - whatever is needed to enable PPP on the remote - host). - - - - Exit Kermit (without - hanging up the line). - - - - Enter the following: - - &prompt.root; /usr/sbin/pppd /dev/tty01 19200 - - Be sure to use the appropriate speed and device - name. - - - - Now your computer is connected with PPP. If the - connection fails, you can add the - option to the /etc/ppp/options file, - and check console messages to track the problem. - - Following /etc/ppp/pppup script will - make all 3 stages automatic: - - #!/bin/sh -pgrep -l pppd -pid=`pgrep pppd` -if [ "X${pid}" != "X" ] ; then - echo 'killing pppd, PID=' ${pid} - kill ${pid} -fi -pgrep -l kermit -pid=`pgrep kermit` -if [ "X${pid}" != "X" ] ; then - echo 'killing kermit, PID=' ${pid} - kill -9 ${pid} -fi - -ifconfig ppp0 down -ifconfig ppp0 delete - -kermit -y /etc/ppp/kermit.dial -pppd /dev/tty01 19200 - - - Kermit - - - /etc/ppp/kermit.dial is a - Kermit script that dials and makes - all necessary authorization on the remote host (an example - of such a script is attached to the end of this - document). - - Use the following /etc/ppp/pppdown - script to disconnect the PPP line: - - #!/bin/sh -pid=`pgrep pppd` -if [ X${pid} != "X" ] ; then - echo 'killing pppd, PID=' ${pid} - kill -TERM ${pid} -fi - -pgrep -l kermit -pid=`pgrep kermit` -if [ "X${pid}" != "X" ] ; then - echo 'killing kermit, PID=' ${pid} - kill -9 ${pid} -fi - -/sbin/ifconfig ppp0 down -/sbin/ifconfig ppp0 delete -kermit -y /etc/ppp/kermit.hup -/etc/ppp/ppptest - - Check to see if pppd is still running - by executing /usr/etc/ppp/ppptest, which - should look like this: - - #!/bin/sh -pid=`pgrep pppd` -if [ X${pid} != "X" ] ; then - echo 'pppd running: PID=' ${pid-NONE} -else - echo 'No pppd running.' -fi -set -x -netstat -n -I ppp0 -ifconfig ppp0 - - To hang up the modem, execute - /etc/ppp/kermit.hup, which should - contain: - - set line /dev/tty01 ; put your modem device here -set speed 19200 -set file type binary -set file names literal -set win 8 -set rec pack 1024 -set send pack 1024 -set block 3 -set term bytesize 8 -set command bytesize 8 -set flow none - -pau 1 -out +++ -inp 5 OK -out ATH0\13 -echo \13 -exit - - Here is an alternate method using chat - instead of kermit: - - The following two files are sufficient to accomplish a - pppd connection. - - /etc/ppp/options: - - /dev/cuad1 115200 - -crtscts # enable hardware flow control -modem # modem control line -connect "/usr/bin/chat -f /etc/ppp/login.chat.script" -noipdefault # remote PPP serve must supply your IP address - # if the remote host doesn't send your IP during - # IPCP negotiation, remove this option -passive # wait for LCP packets -domain your.domain # put your domain name here - -: # put the IP of remote PPP host here - # it will be used to route packets via PPP link - # if you didn't specified the noipdefault option - # change this line to local_ip:remote_ip - -defaultroute # put this if you want that PPP server will be - # your default router - - /etc/ppp/login.chat.script: - - - The following should go on a single line. - - - ABORT BUSY ABORT 'NO CARRIER' "" AT OK ATDTphone.number - CONNECT "" TIMEOUT 10 ogin:-\\r-ogin: login-id - TIMEOUT 5 sword: password - - Once these are installed and modified correctly, all - you need to do is run pppd, like so: - - &prompt.root; pppd - - - - Using <command>pppd</command> as a Server - - /etc/ppp/options should contain - something similar to the following: - - crtscts # Hardware flow control -netmask 255.255.255.0 # netmask (not required) -192.114.208.20:192.114.208.165 # IP's of local and remote hosts - # local ip must be different from one - # you assigned to the Ethernet (or other) - # interface on your machine. - # remote IP is IP address that will be - # assigned to the remote machine -domain ppp.foo.com # your domain -passive # wait for LCP -modem # modem line - - The following /etc/ppp/pppserv script - will tell pppd to behave as a - server: - - #!/bin/sh -pgrep -l pppd -pid=`pgrep pppd` -if [ "X${pid}" != "X" ] ; then - echo 'killing pppd, PID=' ${pid} - kill ${pid} -fi -pgrep -l kermit -pid=`pgrep kermit` -if [ "X${pid}" != "X" ] ; then - echo 'killing kermit, PID=' ${pid} - kill -9 ${pid} -fi - -# reset ppp interface -ifconfig ppp0 down -ifconfig ppp0 delete - -# enable autoanswer mode -kermit -y /etc/ppp/kermit.ans - -# run ppp -pppd /dev/tty01 19200 - - Use this /etc/ppp/pppservdown script - to stop the server: - - #!/bin/sh -pgrep -l pppd -pid=`pgrep pppd` -if [ "X${pid}" != "X" ] ; then - echo 'killing pppd, PID=' ${pid} - kill ${pid} -fi -pgrep -l kermit -pid=`pgrep kermit` -if [ "X${pid}" != "X" ] ; then - echo 'killing kermit, PID=' ${pid} - kill -9 ${pid} -fi -ifconfig ppp0 down -ifconfig ppp0 delete - -kermit -y /etc/ppp/kermit.noans - - The following Kermit script - (/etc/ppp/kermit.ans) will enable/disable - autoanswer mode on your modem. It should look like - this: - - set line /dev/tty01 -set speed 19200 -set file type binary -set file names literal -set win 8 -set rec pack 1024 -set send pack 1024 -set block 3 -set term bytesize 8 -set command bytesize 8 -set flow none - -pau 1 -out +++ -inp 5 OK -out ATH0\13 -inp 5 OK -echo \13 -out ATS0=1\13 ; change this to out ATS0=0\13 if you want to disable - ; autoanswer mode -inp 5 OK -echo \13 -exit - - A script named /etc/ppp/kermit.dial - is used for dialing and authenticating on the remote host. - You will need to customize it for your needs. Put your login - and password in this script; you will also need to change the - input statement depending on responses from your modem and - remote host. - - ; -; put the com line attached to the modem here: -; -set line /dev/tty01 -; -; put the modem speed here: -; -set speed 19200 -set file type binary ; full 8 bit file xfer -set file names literal -set win 8 -set rec pack 1024 -set send pack 1024 -set block 3 -set term bytesize 8 -set command bytesize 8 -set flow none -set modem hayes -set dial hangup off -set carrier auto ; Then SET CARRIER if necessary, -set dial display on ; Then SET DIAL if necessary, -set input echo on -set input timeout proceed -set input case ignore -def \%x 0 ; login prompt counter -goto slhup - -:slcmd ; put the modem in command mode -echo Put the modem in command mode. -clear ; Clear unread characters from input buffer -pause 1 -output +++ ; hayes escape sequence -input 1 OK\13\10 ; wait for OK -if success goto slhup -output \13 -pause 1 -output at\13 -input 1 OK\13\10 -if fail goto slcmd ; if modem doesn't answer OK, try again - -:slhup ; hang up the phone -clear ; Clear unread characters from input buffer -pause 1 -echo Hanging up the phone. -output ath0\13 ; hayes command for on hook -input 2 OK\13\10 -if fail goto slcmd ; if no OK answer, put modem in command mode - -:sldial ; dial the number -pause 1 -echo Dialing. -output atdt9,550311\13\10 ; put phone number here -assign \%x 0 ; zero the time counter - -:look -clear ; Clear unread characters from input buffer -increment \%x ; Count the seconds -input 1 {CONNECT } -if success goto sllogin -reinput 1 {NO CARRIER\13\10} -if success goto sldial -reinput 1 {NO DIALTONE\13\10} -if success goto slnodial -reinput 1 {\255} -if success goto slhup -reinput 1 {\127} -if success goto slhup -if < \%x 60 goto look -else goto slhup - -:sllogin ; login -assign \%x 0 ; zero the time counter -pause 1 -echo Looking for login prompt. - -:slloop -increment \%x ; Count the seconds -clear ; Clear unread characters from input buffer -output \13 -; -; put your expected login prompt here: -; -input 1 {Username: } -if success goto sluid -reinput 1 {\255} -if success goto slhup -reinput 1 {\127} -if success goto slhup -if < \%x 10 goto slloop ; try 10 times to get a login prompt -else goto slhup ; hang up and start again if 10 failures - -:sluid -; -; put your userid here: -; -output ppp-login\13 -input 1 {Password: } -; -; put your password here: -; -output ppp-password\13 -input 1 {Entering SLIP mode.} -echo -quit - -:slnodial -echo \7No dialtone. Check the telephone line!\7 -exit 1 - -; local variables: -; mode: csh -; comment-start: "; " -; comment-start-skip: "; " -; end: - - - @@ -2521,760 +1993,4 @@ tun0: flags=8051<UP,POINTOPOINT,RUNNI /var/log/ppp.log for clues. - - - - - - Satoshi - Asami - Originally contributed by - - - - - Guy - Helmer - With input from - - - Piero - Serini - - - - - Using SLIP - - SLIP - - - This section applies and is valid only for - &os; 7.X. - - - - Setting Up a SLIP Client - - - SLIP - client - - - The following is one way to set up a FreeBSD machine for - SLIP on a static host network. For dynamic hostname - assignments (your address changes each time you dial up), you - probably need to have a more complex setup. - - First, determine which serial port your modem is connected - to. Many people set up a symbolic link, such as - /dev/modem, to point - to the real device name, /dev/cuadN. - This allows you to abstract the actual device name should you - ever need to move the modem to a different port. It can - become quite cumbersome when you need to fix a bunch of files - in /etc and - .kermrc files all over the system! - - - /dev/cuad0 - is COM1, /dev/cuad1 is - COM2, etc. - - - Make sure you have the following in your kernel - configuration file: - - device sl - - It is included in the GENERIC kernel, - so this should not be a problem unless you have deleted - it. - - - Things You Have to Do Only Once - - - - Add your home machine, the gateway and nameservers - to your /etc/hosts file. Ours - looks like this: - - 127.0.0.1 localhost loghost -136.152.64.181 water.CS.Example.EDU water.CS water -136.152.64.1 inr-3.CS.Example.EDU inr-3 slip-gateway -128.32.136.9 ns1.Example.EDU ns1 -128.32.136.12 ns2.Example.EDU ns2 - - - - Make sure you have files before - dns in the hosts: - section of your /etc/nsswitch.conf - file. Without these parameters funny things may - happen. - - - - Edit the /etc/rc.conf - file. - - - - Set your hostname by editing the line that - says: - - hostname="myname.my.domain" - - Your machine's full Internet hostname should be - placed here. - - - - default - route - - Designate the default router by changing the - line: - - defaultrouter="NO" - - to: - - defaultrouter="slip-gateway" - - - - - - Make a file /etc/resolv.conf - which contains: - - domain CS.Example.EDU -nameserver 128.32.136.9 -nameserver 128.32.136.12 - - nameserver - domain name - As you can see, these set up the nameserver hosts. - Of course, the actual domain names and addresses depend - on your environment. - - - - Set the password for root and - toor (and any other - accounts that do not have a password). - - - - Reboot your machine and make sure it comes up with - the correct hostname. - - - - - - Making a SLIP Connection - - - SLIP - connecting with - - - - - Dial up, type slip at the prompt, - enter your machine name and password. What is required - to be entered depends on your environment. If you use - Kermit, you can try a script - like this: - - # kermit setup -set modem hayes -set line /dev/modem -set speed 115200 -set parity none -set flow rts/cts -set terminal bytesize 8 -set file type binary -# The next macro will dial up and login -define slip dial 643-9600, input 10 =>, if failure stop, - -output slip\x0d, input 10 Username:, if failure stop, - -output silvia\x0d, input 10 Password:, if failure stop, - -output ***\x0d, echo \x0aCONNECTED\x0a - - Of course, you have to change the username and - password to fit yours. After doing so, you can just - type slip from the - Kermit prompt to - connect. - - - Leaving your password in plain text anywhere in - the filesystem is generally a bad - idea. Do it at your own risk. - - - - - Leave the Kermit there - (you can suspend it by - - Ctrl - z - ) and as root, - type: - - &prompt.root; slattach -h -c -s 115200 /dev/modem - - If you are able to ping hosts - on the other side of the router, you are connected! - If it does not work, you might want to try - instead of as - an argument to slattach. - - - - - - How to Shutdown the Connection - - Do the following: - - &prompt.root; kill -INT `cat /var/run/slattach.modem.pid` - - to kill slattach. Keep in mind you - must be root to do the above. Then - go back to kermit (by running - fg if you suspended it) and exit from - it (q). - - The &man.slattach.8; manual page says you have to use - ifconfig sl0 down to mark the interface - down, but this does not seem to make any difference. - (ifconfig sl0 reports the same - thing.) - - Some times, your modem might refuse to drop the carrier. - In that case, simply start kermit and - quit it again. It usually goes out on the second - try. - - - - Troubleshooting - - If it does not work, feel free to ask on &a.net.name; - mailing list. The things that people tripped over so - far: - - - - Not using or - in slattach (This should not be - fatal, but some users have reported that this solves - their problems.) - - - - Using instead of - (might be hard to see the - difference on some fonts). - - - - Try ifconfig sl0 to see your - interface status. For example, you might get: - - &prompt.root; ifconfig sl0 -sl0: flags=10<POINTOPOINT> - inet 136.152.64.181 --> 136.152.64.1 netmask ffffff00 - - - - If you get no route to host - messages from &man.ping.8;, there may be a problem - with your routing table. You can use the - netstat -r command to display the - current routes : - - &prompt.root; netstat -r -Routing tables -Destination Gateway Flags Refs Use IfaceMTU Rtt Netmasks: - -(root node) -(root node) - -Route Tree for Protocol Family inet: -(root node) => -default inr-3.Example.EDU UG 8 224515 sl0 - - -localhost.Exampl localhost.Example. UH 5 42127 lo0 - 0.438 -inr-3.Example.ED water.CS.Example.E UH 1 0 sl0 - - -water.CS.Example localhost.Example. UGH 34 47641234 lo0 - 0.438 -(root node) - - The preceding examples are from a relatively busy - system. The numbers on your system will vary depending - on network activity. - - - - - - - - Setting Up a SLIP Server - - - SLIP - server - - - This document provides suggestions for setting up SLIP - Server services on a FreeBSD system, which typically means - configuring your system to automatically start up connections - upon login for remote SLIP clients. - - - - - Prerequisites - - TCP/IP networking - This section is very technical in nature, so background - knowledge is required. It is assumed that you are familiar - with the TCP/IP network protocol, and in particular, network - and node addressing, network address masks, subnetting, - routing, and routing protocols, such as RIP. Configuring - SLIP services on a dial-up server requires a knowledge of - these concepts, and if you are not familiar with them, - please read a copy of either Craig Hunt's TCP/IP - Network Administration published by O'Reilly - & Associates, Inc. (ISBN Number 0-937175-82-X), or - Douglas Comer's books on the TCP/IP protocol. - - modem - It is further assumed that you have already set up your - modem(s) and configured the appropriate system files to - allow logins through your modems. If you have not prepared - your system for this yet, please see for details on dialup services - configuration. You may also want to check the manual pages - or &man.sio.4; for information on the serial port device - driver and &man.ttys.5;, &man.gettytab.5;, &man.getty.8;, - & &man.init.8; for information relevant to configuring - the system to accept logins on modems, and perhaps - &man.stty.1; for information on setting serial port - parameters (such as clocal for - directly-connected serial interfaces). - - - - Quick Overview - - In its typical configuration, using FreeBSD as a SLIP - server works as follows: a SLIP user dials up your FreeBSD - SLIP Server system and logs in with a special SLIP login - ID that uses /usr/sbin/sliplogin as - the special user's shell. The sliplogin - program browses the file - /etc/sliphome/slip.hosts to find a - matching line for the special user, and if it finds a match, - connects the serial line to an available SLIP interface and - then runs the shell script - /etc/sliphome/slip.login to configure - the SLIP interface. - - - An Example of a SLIP Server Login - - For example, if a SLIP user ID were - Shelmerg, - Shelmerg's entry in - /etc/master.passwd would look - something like this: - - Shelmerg:password:1964:89::0:0:Guy Helmer - SLIP:/usr/users/Shelmerg:/usr/sbin/sliplogin - - When Shelmerg logs in, - sliplogin will search - /etc/sliphome/slip.hosts for a line - that had a matching user ID; for example, there may be - a line in /etc/sliphome/slip.hosts - that reads: - - Shelmerg dc-slip sl-helmer 0xfffffc00 autocomp - - sliplogin will find that matching - line, hook the serial line into the next available SLIP - interface, and then execute - /etc/sliphome/slip.login like - this: - - /etc/sliphome/slip.login 0 19200 Shelmerg dc-slip sl-helmer 0xfffffc00 autocomp - - If all goes well, - /etc/sliphome/slip.login will issue - an ifconfig for the SLIP interface to - which sliplogin attached itself (SLIP - interface 0, in the above example, which was the first - parameter in the list given to - slip.login) to set the local IP - address (dc-slip), remote IP address - (sl-helmer), network mask for the SLIP - interface (0xfffffc00), - and any additional flags (autocomp). *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***