[ Pobierz całość w formacie PDF ]
.Other than the machine's default values, you can add the addresses with an option to pppd.The general format is to specify the local IP address, a colon, and then the remote IP address.For example, the option147.23.43.1:36.23.1.34when added to the pppd command line sets the local IP address as 147.23.43.1 and the remote IP address to 36.23.1.34, regardless of that the local values are.If you only want to modify one IP address, leave the other portion blank.The command147.23.43.1:sets the local IP address and accepts the remote IP address as whatever the machine sends.Because you need chat to establish the connection in the first place, you can embed the chat command as part of the pppd command.This is best done when reading the contents of the chat script from a file (using the -f option).For example, you couldissue the following pppd command:pppd connect "chat -f chat_file" /dev/cua1 38400 -detach crtscts modem defaultrouteYou will notice a few modifications to the pppd command other than the addition of the chat command in quotation marks.The connect command specifies the dialup script that pppd should start with, while the -detach command tells pppd not to detach fromthe console and move to background.The modem keyword tells pppd to monitor the modem port (in case the line drops prematurely) and hang up the line when the call is finished.The pppd daemon begins setting up the connection parameters with the remote by exchanging IP addresses, then setting communications values.Once that is done, pppd sets the network layer on your Linux kernel to use the PPP link by setting the interfaceto /dev/ppp0 (if it's the first PPP link active on the machine).Finally, pppd establishes a kernel routing table entry to point to the machine on the other end of the PPP link.If you want to change the default behavior of the pppd daemon, you can do it through command line options or a control file.The file is a better approach if you want to change the parameters for every connection established using PPP.Before completing the command line, pppd scans a number of possible options files.The more common file is /etc/ppp/options, which usually is used to set global defaults.An example of a /etc/ppp/options file looks like this:# /etc/ppp/options: global definitionsdomain merlin.comauth # force authenticationusehostname # use local hostname for authenticationlock # use file locking UUCP-styleThe domain is established with the domain keyname followed by the full domain name (minus the machine name).The next two lines above (auth and usehostname) deal with authentication of the PPP line, preventing unwanted usage and access.We will look atauthentication later in this section.The lock keyword tells pppd to use UUCP-style file locking to prevent device clashes.Locking should be used on all PPP systems to prevent problems.Checking ProblemsThe pppd daemon echoes all warnings and error messages to the syslog facility.If you used the -v option with the chat script, chat's messages are also sent to syslog.If you are having trouble with your PPP connections, you can check the syslog fordetails and try to isolate the problem.Unless there is an entry in the /etc/syslog.conf file that redirects incoming error and warning messages to another file, the messages are discarded by syslog.To save the messages from pppd and chat, add this line to the /etc/syslog.conf file:daemon.* /tmp/ppp-logThis entry tells syslog to save any incoming messages from a daemon to the /tmp/ppp-log file.You can use any filename you want instead of /tmp/ppp-log.Many Linux versions of the syslog.conf file insist on tabs to separate the columns instead ofspaces.Once your script is working, remember to remove this line or the log file will grow quite large!If you really want to watch what is going on with pppd, you can invoke a debugging option with the kdebug command followed by a number.There are three values for debugging, which are:1.general debug messages2.display incoming HLDC data3.display outgoing HLDC dataThe numbers are added together to give the debug level you want.For example, the command kdebug 5 will display all general debug messages and all outgoing HLDC data
[ Pobierz całość w formacie PDF ]