- Table of Contents
- Copyright
- About the Lead Authors
- About the Contributing Authors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- I. Red Hat Linux Installation and User Services
- Chapter 1. Introduction to Red Hat Linux
- Chapter 2. Installation of Your Red Hat System
- Chapter 3. LILO and Other Boot Managers
- Chapter 4. Configuring the X Window System, Version 11
- Chapter 5. Window Managers
- Chapter 6. Connecting to the Internet
- Setting Up the Dummy Interface
- Setting Up PPP
- Setting Up a DSL PPPOE Connection
- Setting Up SLIP
- Setting Up a Dial-In PPP Server
- Summary
- Chapter 7. IRC, ICQ, and Chat Clients
- Chapter 8. Using Multimedia and Graphics Clients
- II. Configuring Services
- Chapter 9. System Startup and Shutdown
- Chapter 10. SMTP and Protocols
- Chapter 11. FTP
- Chapter 12. Apache Server
- Chapter 13. Internet News
- Chapter 14. Domain Name Service and Dynamic Host Configuration Protocol
- Chapter 15. NIS: Network Information Service
- Chapter 16. NFS: Network Filesystem
- Chapter 17. Samba
- III. System Administration and Management
- Chapter 18. Linux Filesystems, Disks, and Other Devices
- Chapter 19. Printing with Linux
- Chapter 20. TCP/IP Network Management
- Chapter 21. Linux System Administration
- Chapter 22. Backup and Restore
- Chapter 23. System Security
- IV. Red Hat Development and Productivity
- Chapter 24. Linux C/C++ Programming Tools
- Chapter 25. Shell Scripting
- Chapter 26. Automating Tasks
- Chapter 27. Configuring and Building Kernels
- Chapter 28. Emulators, Tools, and Window Clients
- V. Appendixes
- A. The Linux Documentation Project
- B. Top Linux Commands and Utilities
- C. The GNU General Public License
- D. Red Hat Linux RPM Package Listings
Setting Up a Dial-In PPP Server
You can also set up a simple service on your Linux system to provide PPP for dial-in users. Although commercial ventures such as ISPs must necessarily invest in leased lines, switching service, modem pools, and routers, you can easily configure a standalone Linux box to answer a modem and start PPP. The general steps may include
- Selecting a phone line, modem, and serial port
- Properly configuring the modem to answer incoming calls (using AT commands and saving the modem profile with AT&W)
- Installing a line-monitoring application (such as agetty, getty, or mgetty) to watch a serial port (in /etc/inittab)
- Possibly configuring a DNS server (see Chapter 14, "Domain Name Service and Dynamic Host Configuration Protocol," for more information)
- Configuring Linux to automatically start the pppd daemon after a user logs in
In general, and for many modems, the ATE1Q0V1&C1&S0S0=1&W modem string will set up a modem to autoanswer calls using different terminal monitors. (Some, such as uugetty, have configuration files to automatically set up the modem for a particular serial port.) The next step is to make an appropriate entry in the /etc/inittab file:
001 3:2345:respawn:/sbin/uugetty ttyS1 38400 vt100 002
This entry assumes you have a modem attached to /dev/ttyS1. If you use the uugetty command to monitor your modem's serial port, you'll also need to copy the file uugetty.autoanswer from the /usr/doc/getty_ps-2.0.7j/Examples/default directory to the /etc/default directory. You should then edit this file and look for the ALTLOCK entry:
# alternate lockfile to check... if this lockfile exists, then uugetty is # restarted so that the modem is re-initialized ALTLOCK=cua2
Change the ALTLOCK entry to match your modem's serial port. Using the previous /etc/inittab entry, the string cua2 would be changed to ttyS1. The file should then be saved in the /etc/default directory with the name uugetty and a suffix to match the serial port (such as uugetty.ttyS0). You should then dial in from a remote computer to check the login process.
The next step is to create a user to test PPP service. Use the adduser command to create a user named ppp and then assign a password. Although users can log in to your system and then start pppd from the command line (assuming you've set pppd to SUID), you can have the pppd daemon started automatically by creating a short shell script and then assigning the shell script in the user's /etc/passwd entry like this:
ppp:x:501:501::/home/ppp:/usr/local/bin/doppp
In this instance, the script doppp (made executable with chmod +x) would contain the following:
exec /usr/sbin/pppd -detach
Using this approach, pppd will start automatically after the ppp dial-in user connects and logs in (using the ppp-on scripts or other clients, such as netcfg or kppp).
You should also edit the file options under the /etc/ppp directory to include general dial-in options for PPP service on your system, and create specific options files (such as options.ttyS1 for this example) for each enabled dial-in port. For example, /etc/ppp/options could contain
asyncmap 0 netmask 255.255.255.0 proxyarp lock crtscts modem
There are many approaches to providing PPP service. You may want to assign IP addresses dynamically, or assign static IP addresses for your users. You should probably have DNS enabled, although you will still be sharing hostnames via /etc/hosts and providing static address assignment by using options.ttyX files (where X is the serial port). For example, /etc/ppp/options.ttyS1 could contain
IPofPPPserver:assignedIPofdialinuser
After you set up your /etc/ppp/options and /etc/ppp/options.ttyS files, dial in from a remote computer (perhaps using netcfg, kppp, or the ppp-on script). If your chat script uses pppd's debug option, you can watch the progress of your connection by using the tail command on /var/log/messages:
... May 21 17:05:55 aptiva pppd[7761]: Serial connection established. May 21 17:05:56 aptiva pppd[7761]: Using interface ppp0 May 21 17:05:56 aptiva pppd[7761]: Connect: ppp0 <--> /dev/modem May 21 17:06:02 aptiva pppd[7761]: local IP address 198.168.2.36 May 21 17:06:02 aptiva pppd[7761]: remote IP address 198.168.2.34
For more information about using PPP, see Robert Hart's PPP-HOWTO, available through http://www.linuxdoc.org.
Summary | Next Section

Account Sign In
View your cart