knowplace.org

The 5-minute Linux PPP Howto

 (Updated 04/22/99)

WHO? This document is written for anyone, novice or guru alike, who wants to connect their Linux box to their ISP.

WHAT? This is a step-by-step HOWTO for getting pppd WORKING WITH AN ISP USING A DYNAMIC IP ADDRESS. I actually wrote the first version of this HOWTO as a brand new Linux user after spending many frustrating hours going through the documentation and trying to get PPP working. So why write another HOWTO? After all, there are so many HOWTOs and FAQs already. Well, I don't know about you, but all I really wanted to know was how to get the damn Linux box connected to my Internet Service Provider (ISP). I didn't want to know the history, the background, the protocol, etc. I just wanted to get the darn thing up and working. Well, this is the result. Like I said before, there are other HOWTOs, and FAQs for all the other intricacies.

WHY? Despite how wonderful Linux could be, it's nice to peek out of your Linux box and see what's going on in the outside world. But why pppd? Linux has so many network capabilities, none of which requires going to X-windows. It would be silly to have to start X-windows when all you want to do is to telnet or ftp somewhere. Besides, as you will see, setting up pppd manually will only take a few minutes.

WHERE? The absolute newest version of this HOWTO can always be found at http://www.knowplace.org/ppp.html. You can get a plain text version of this page automatically emailed to you by sending an email to infobot@knowplace.org with ppp.txt as the subject.

HOW? Easy there Banzai, I'm getting to it. But first.. Please Note: While pppd does come on RedHat distributions v4.1 and later, the script files aren't where they should be. Copy ppp-on, ppp-off, and ppp-on-dialer from /usr/doc/ppp-2.2.* to the appropriate places and edit them (see below). If you find that the files are missing altogether, first go and download ppp-2.3.x.tar.gz! If you are a RedHat v5.x user, you might also want to take a look at http://www.redhat.com/support/docs/tips/PPP-Client-Tips/PPP-Client-Tips.html for some setup tips.

  • STEP ONE: Edit your ppp-on file. It's usually in the /usr/sbin/ directory. If you're having trouble finding the file, type find / -name ppp-on at your root directory, although it really should be in /usr/sbin/. If it's missing, you might not have pppd installed. Next, modify and enter all the appropriate data. You'll find fields like:

    TELEPHONE=
    ACCOUNT=
    PASSWORD=
    LOCAL_IP=
    REMOTE_IP=
    NETMASK=


    Note: It's important to not have any spaces while entering the phone number of your ISP (i.e. 1-213-555-1212, and NOT 1 213 555 1212). You should also leave LOCAL_IP and REMOTE_IP alone (i.e. 0.0.0.0), unless you really know what you're doing. NETMASK for most ISP's is 255.255.255.0; consult your ISP to find out for certain. You'll probably also find /dev/ttys1 38400 some where toward the bottom. You'll have to change that to the appropriate setting for your system. I use /dev/cua2 115200 for my system (it stands for COM3, 115200 bauds. /dev/ttys0 or /dev/cua0 is COM1, /dev/ttys1 or /dev/cua1 is COM2 and so on). Use whichever one that works. /dev/modem/ might also work. That should be all the modifications you'll need to make to the ppp-on file. If you find that your connection stalls a lot or is agonizingly slow, you may want to try adding mru 296 mtu 296. They set the Maximum Receive Unit and the Maximum Transmit Unit to 296 bytes. You may also try setting the asyncmap to asyncmap 0.

  • STEP TWO: Edit your hosts file. It should be in your /etc/ directory. Type find / -name hosts at your root directory if you're having trouble finding where it is. Make sure it says:

    127.0.0.1 localhost
    0.0.0.0 host.domain host


    Note: You will have to replace host and domain with the hostname and domain name of your machine. I can't tell you what to enter here because I don't know what you've named your machine. Most likely, the correct settings should already exist if you've named your machine during setup. You can also find files named hosts.allow and hosts.deny in /etc/; but you should not mess with these unless you REALLY know what you are doing! I repeat, you DO NOT need to fiddle with these files to get your dialup working.

  • STEP THREE: Edit and modify your resolv.conf file. It is most likely in your /etc/ directory as well. Again, use find / -name resolv.conf at your root directory if you're having trouble finding it. NOTE: The settings below are for my ISP only, enter what is correct for your ISP. To find out what the appropriate settings for your ISP are, you'll need to contact your ISP. Please DO NOT email me to ask me what to enter here:

    search earthlink.net
    nameserver 207.217.126.81
    nameserver 207.217.120.83


    Note: This is to get your DNS lookup working. earthlink.net is the name of my ISP, and the xxx.xxx.xxx.xxx's are addresses for the Domain Name Servers for earthlink.net.

  • STEP FOUR: Believe it or not, all that's left to do now is to dial in and get connected. If you're not already logged in as root, you'll need to do that now. Type ppp-on, and you should hear your modem dialing. To find out if you're connected or not, type ifconfig or route. You should now be able to use the Internet to your hearts content. Use ppp-off to disconnect. Note: Some related files are pppd, pppd-2.2, ppp-on-dialer, but you shouldn't have to mess with those to get everything working. I decided to put a word or two here about PAP and CHAP. If you have to ask what that is, you probably don't need to fiddle with it (most likely you don't). But on the off chance that your ISP actually uses PAP or CHAP, goto /etc/ppp/ and edit pap-secrets (or chap-secrets) and add your_login_name * your_password to the first available line. If the file does not exists, don't fret. Just go to /etc/ppp/ and create the file in there.
Troubleshooting:
  • If you're getting an error like "ppp service not available" with the v2.0.29 or newer kernel, you'll need at least ppp-2.2.0f.tar.gz (you can find the latest at ppp-2.3.x.tar.gz) and update your pppd. Apparently the v2.0.29 or kernel does not work with older versions of pppd.
  • If you get a message saying something like "permission denied," it probably means that you should check the file permission. Most likely, you do not have execute permission of one or all of the files involved (this applies even if you're logged in as root).
  • If you find that your modem dials in, connects, but that you get disconnected after a few seconds, your ISP probably uses a different login process. You should dial in manually with something like seyon or minicom and look at what the prompts are from your ISP. The etc/ppp/ppp-on-dialer expects the prompt to be Logon: and Password: so you'll need to edit this file and modify it as needed.
  • If your plug-n-play modem refuses to initialize properly, you may want to retrieve the modem settings by using pnpdump and then using isapnp to initialize the modem.
  • If you accidentally entered a gateway address during your Linux installation that is incorrect, you must edit the /etc/rc.d/rc.inet1 and comment out the GATEWAY= line if it exists. Otherwise your ppp setup will connect, but packets won't route properly.
  • Linux isn't completely happy with a dynamic IP address. If you find that talk does not work properly, you should take a look at the Dynamic IP Hacks mini-HOWTO (particularly hack #5).

Some Last Comments: The most obvious thing is that you will have to compile network support into your kernel to get your PPP to work. For how to recompile your kernel consult the Linux Kernel HOW-TO. Also, as is, your system should already be secure. Just make sure the root password exists and is hard to guess. All the server side stuff should be working as well (except the web server, even if you installed one; it takes some special fiddling). Otherwise, all the other stuff like ftp, telnet, finger, etc. should be working. Oh, now that you know how to get your PPP working, download the Linux version of Netscape for X-Windows/XFree86. It's a quick and easy way to be able to browse the net and retrieve some email and maybe even read a few posts. If you're having trouble or need help setting up Netscape for X-Windows/XFree86, goto http://members.ping.at/theofilu/netscape.html.

Also, I decided to comment here about the current situation of this page. I've received some great reactions and comments (thank you all so much!!) about this page. This page is now linked from the Linux Documentation Project (LDP). I want to thank everyone that has sent email to let me (or Greg Hankins--gregh@sunsite.unc.edu, the current LDP site maintainer) know what their experiences has been with the various PPP HOWTOs. Thanks!

 
Shane Tzen © 2008