📄 readme.linux
字号:
daemon.*,kern.* /dev/console daemon.*,kern.* /usr/adm/ppplogand HUP the syslog daemon as before. Then, run pppd with the option"kdebug 25". Whatever characters arrive over the PPP terminal linewill appear in the debugging output.Occasionally you may see a message like ppp_toss: tossing frame, reason = 4The PPP code is throwing away a packet ("frame") from the remoteserver because of a serial overrun. This means your CPU isn't able toread characters from the serial port as quickly as they arrive; thebest solution is to get a 16550A serial chip, which gives the CPU somegrace period. Reasons other than 4 indicate other kinds of serialerrors, which should not occur.During the initial connection sequence, you may see one or moremessages which indicate "bad fcs". This refers to a checksum error ina received PPP frame, and usually occurs at the start of a sessionwhen the peer system is sending some "text" messages, such as "hellothis is the XYZ company". Messages of "bad fcs" once the link isestablished and the routes have been added are not normal and indicatetransmission errors or noise on the telephone line.IF IT STILL DOESN'T WORK (OR, BUG REPORTS)If you're still having difficulty, send the linux-ppp list a bugreport. It is extremely important to include as much information aspossible; for example: - the version number of the kernel you are using - the version number of Linux PPP you are using - the exact command you use to start the PPP session - log output from a session run with the 'debug' option, captured using daemon.*,kern.* in your syslog.conf file - the type of PPP peer that you are connecting to (eg, Xyzzy Corp terminal server, Morningstar PPP software, etc) - the kind of connection you use (modem, hardwired, etc...)DYNAMIC ADDRESS ASSIGNMENTYou can use Linux PPP with a PPP server which assigns a different IPaddress every time you connect. This action is automatically performedwhen you don't have a local IP address. pppd connect 'chat -v "" ATDT5551212 CONNECT "" ogin: ppp word: whitewater' \ /dev/cua1 38400 noipdefault debug crtscts modem defaultrouteThe noipdefault, added to the above example, suppresses the attemptsof pppd to deduce its own IP address by looking it up in the/etc/hosts file. Since the process does not have an IP address, onewill be assigned to it from the configuration file on the remotesystem.Sometimes you may get an error message like "Cannot assign requestedaddress" when you use a Linux client (for example, "talk"). Thishappens when the IP address given in /etc/hosts for our hostnamediffers from the IP address used by the PPP interface. The solutionis to use ifconfig ppp0 to get the interface address and then edit/etc/hosts appropriately.SETTING UP A MACHINE FOR INCOMING PPP CONNECTIONSSuppose you want to permit another machine to call yours up and starta PPP session. This is possible using Linux PPP.One way is to create an account named, say, 'ppp', with the loginshell being a short script that starts pppd. For example, the passwdentry might look like this: ppp:(encrypted password):102:50:PPP client login:/home/ppp:/usr/sbin/pppdIn addition, you would edit the file ~ppp/.ppprc to have the followingpieces of information:-detachmodemcrtsctslock:192.1.2.33Here we will insist that the remote machine use IP address 192.1.2.33,while the local PPP interface will use the IP address associated withthis machine's hostname in /etc/hosts. The '-detach' option is requiredfor a server. It tells the pppd process not to terminate until the modemis disconnected. Should it fork, the init process would restart the gettyprocess and the this would cause a severe conflict over the port.The 'modem' option indicates that the connection is via a switched circuit(using a modem) and that the pppd process should monitor the DCD signalfrom the modem.The 'crtscts' option tells the pppd process to use hardware RTS/CTS flowcontrol for the modem.The 'lock' option tells pppd to lock the tty device. This will use the UUCPstyle locking file in the lock directory.This setup is sufficient if you just want to connect two machines sothat they can talk to one another. If you want to use Linux PPP toconnect a single machine to an entire network, or to connect twonetworks together, then you need to arrange for packets to be routedfrom the networks to the PPP link. Setting up a link between networksis beyond the scope of this document; you should examine the routingoptions in the manual page for pppd carefully and find out aboutrouted, etc.Let's consider just the first case. Suppose you have a Linux machineattached to an Ethernet, and you want to allow its PPP peer to be ableto communicate with hosts on that Ethernet. To do this, you shouldhave the remote machine use an IP address that would normally appearto be on the local Ethernet segment and you should give the 'proxyarp'option to pppd on the server. Suppose, for example, we have thissetup: 192.1.2.33 192.1.2.17+-----------+ PPP link +----------+| chelseapc | ------------------- | billpc |+-----------+ +----------+ | Ethernet ----------------------------------- 192.1.2.x Here the PPP and Ethernet interfaces of billpc will have IP address192.1.2.17. (It's OK for one or more PPP interfaces on a machine toshare an IP address with an Ethernet interface.) There is anappropriate entry in /etc/passwd on billpc to allow chelseapc to callin. It will run pppd when the user signs on to the system and pppd willtake the options from the user option file.In addition, you would edit the file ~ppp/.ppprc to have the followingpiece of information:-detachmodemcrtsctslock192.1.2.17:192.1.2.33proxyarpWhen the link comes up, pppd will enter a "proxy arp" entry forchelseapc into the arp table on billpc. What this means effectivelyis that billpc will pretend to the other machines on the 192.1.2.xEthernet that its Ethernet interface is ALSO the interface forchelseapc (192.1.2.33) as well as billpc (192.1.2.17). In practicethis means that chelseapc can communicate just as if it was directlyconnected to the Ethernet.SETTING UP A MACHINE FOR INCOMING PPP CONNECTIONS WITH DYNAMIC IPThe use of dynamic IP assignments is not much different from thatusing static IP addresses. Rather than putting the IP address into thesingle file ~ppp/.ppprc, you would put the IP address for each of theincoming terminals into the /etc/ppp/options.tty files. ('tty' is thename of the tty device. For example /etc/ppp/options.ttyS0 is used forthe /dev/ttyS0 device.)To each of the serial devices, you would attach a modem. To themodems, attach the telephone lines. Place all of the telephone linesinto a hunt group so that the telephone system will select thenon-busy telephone and subsequently, the modem. By selecting themodem, the user will select a tty device and the tty device willselect the IP address. Run a getty process against the tty device suchas /dev/ttyS0.(The general consensus among the users is that you should *not* usethe agetty process to monitor a modem. Use either getty_ps' uugettyprocess or mgetty from the mgetty+sendfax package.)SECURITY CONCERNS ABOUT INCOMING PPP CONNECTIONSThe following security should be considered with the ppp connections.1. Never put the pppd program file into the /etc/shells file. It is nota legal shell for the general user. In addition, if the shell is missingfrom the shells file, the ftpd process will not allow the user to accessthe system via ftp. You would not want Joe Hacker using the ppp accountvia ftp.2. Ensure that the directory /etc/ppp is owned by 'root' and permitswrite access only to the root user.3. The files /etc/ppp/options must be owned by root and writable onlyby root.4. The files /etc/ppp/ip-up and /etc/ppp/ip-down will be executed by thepppd process while it is root. Ensure that these files are writable onlyfrom the root user.5. If you use an incoming PPP connection, you should do the following asthe root user:a) Invalidate the files for rhosts and forwardrm -f ~ppp/.rhosts ~ppp/.forwardtouch ~ppp/.rhosts ~ppp/.forwardchmod 444 ~ppp/.rhosts ~ppp/.forwardb) Prevent users from sending mail to the user 'ppp'.This is best performed by creating a system alias 'ppp' and have itpoint to the name "THIS_USER_CANNOT_RECEIVE_MAIL". It has no specialmeaning other than the obvious one.For sendmail, the sequence is fairly easy. Edit the /etc/aliases fileand add the line:ppp:THIS_USER_CANNOT_RECEIVE_MAILThen run the sendmail program with the option '-bi' to rebuild thealias database.c) Secure the ppp file properly.chown root ~ppp/.ppprcchmod 444 ~ppp/.ppprcYou may wish to extend the security by creating a group 'ppp' and puttingthe ppp user into that group, along with the binaries for pppd and pppstats.Then you may secure the binaries so that they are executable from the owner(which should be root) and the group only. All other users would be deniedall access to the files and executables.d) Prevent the motd file from being sent to the ppp user.touch ~ppp/.hushloginchown root ~ppp/.hushloginchmod 444 ~ppp/.hushloginADDITIONAL INFORMATIONBesides this document, additional information may be found in:- The file README in the source package- The PPP-HOWTO on sunsite.unc.edu- The Net-2-HOWTO on sunsite.unc.edu- The Network Administration Guide published by O'Rielly and AssociatesPlease consult these sources of information should you have questionsabout the program. If you still can not find your answer then ask eitherthe usenet news groups or the mail list.DIP SUPPORTThe dip program used by Linux is not directly supported by the PPPpackage as such. Please don't ask the PPP porting group questionsabout dip. It does work in two areas.1. If you use it as a parameter to 'connect' then you can use the scripting language and establish the connection. You would use the standard set of PPP options.2. dip-3.3.7m-uri and later versions support a 'mode ppp' function which will invoke the pppd program. That is all that it does. It will not pass any parameters to pppd other than its required '-detach' to allow dip to detect the normal termination of pppd. The following information comes from John Phillips in an article which he posted to comp.os.linux.setup.Assuming that you already know how dip supports SLIP, these points are relative to a working SLIP set-up.1. You need dip-3.3.7m-uri, and, of course, PPP compiled into thekernel.2. Make sure pppd is where dip thinks it is: /usr/lib/ppp/pppd, or make a link from there to where pppd really is. (Or re-compile dip to tell it where pppd is on your system - see pathnames.h).3. The key differences between the dip script for PPP, compared to one for SLIP are: a. Use "mode PPP" instead of "mode SLIP" b. Don't set certain options such as mtu and default - these are set by pppd from the file /etc/ppp/options. Mine looks like this: crtscts modem defaultroute asyncmap 0x00000000 mru 576 mtu 576 The actual parameters and values may depend on your IP supplier and his set-up. c. Tell your IP supplier's start-up code to use ppp, not slip: I use "send nolqm,idle=240\n" instead of "send slip,idle=240,mru=576\n" at the "protocol: " prompt. ("nolqm" asks for ppp without the line quality monitoring protocol, which is not - I think - supported in Linux PPP.) This prompt may be different (or absent) with another IP supplier. d. You don't need "get $local <name>", since the ppp protocol negotiates this at start-up. You still need "get $remote <name>". (This may also vary with IP supplier - you may need to set some more parameters in /etc/ppp/options to work with yours - see "man pppd" for details of the options supported by pppd.)4. The dip script will exit after dialling and starting up pppd. When ppp negotiation is completed and IP comes up, pppd runs /etc/ppp/ip-up. This file can contain things you want to run when the network comes up (e.g. running the mail queue).5. When IP goes down (e.g. after you close down the link with "dip -k"), pppd runs /etc/ppp/ip-down, which can contain things you want to do on close-down.CONCLUSIONGood luck!Al and Michael
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -