Initial PPP Setup
Pages: 1, 2
The computers on the Internet are referenced by numbers called IP
However, as people are often bad at remembering numbers, names are used instead
axion.physics.ubc.ca instead of 18.104.22.168). The name resolver is a
that asks another computer, the nameserver, to translate Internet names
to IP numbers which your computer can actually use. Once
you are connected, you are able to actually resolve host names,
/etc/resolv.conf and add a line (or lines) like
Instead of 111.222.333.444 use the Domain Name Server IP address (DNS-IPaddress) which your ISP gave you. If they gave you two numbers enter another nameserver line with the second address.
It can also be useful to include a line like domain ISP.domain.name where ISP.domain.name is the domain name of your ISP. For example, my /etc/resolv.conf file looks like
domain physics.ubc.ca nameserver 22.214.171.124 nameserver 126.96.36.199
[Note: Do NOT put leading zeros on any of those numbers. They will not work. 137.082.43.9 is a different number from 188.8.131.52]
Edit /etc/host.conf and make sure the line
order hosts, bind
is in there. Also check /etc/nsswitch.conf and make sure a line like
hosts: files dns
is there. (that line may also contain other options like nis, which will do no harm)
Also make sure that all of these files are readable by everyone.
chmod a+r /etc/resolv.conf /etc/host.conf /etc/nsswitch.conf
No Default Route
Your computer passes messages for addresses it does not know to the default route. ppp assumes that there can only be one default route on any system. This is almost always the route to ISP's computer. However, if pppd finds that a default route already exists, it will not set up one to your ISP, causing problems (nothing gets through). In order that you not have any conflicts between the routing across ppp and onto some network you have, run
(or you can also run
which does the same thing) while not connected via ppp, and look for a default entry. (First entry in line is 0.0.0.0). This almost certainly should not be there. (Unless you already have a hookup to the internet via an ethernet connection, you do not want such a default route.) Unless you know that your computer has an ethernet connection to other computers already, the only thing there should be a route to 127.0.0.1 or 127.0.0.0 If there is such a default route (line starting with 0.0.0.0), and you want the ppp interface to be your default route, (the usual situation), run
/sbin/route del default
Also find out what was setting that wrong default route, and stop it from doing so. (If you cannot figure out what is doing so, put that line
/sbin/route del default
at the end of whichever of /etc/rc.local or /etc/rc.d/rc.local
on your system.)
PPPD module support
Now check to see if the module support for ppp is set up properly. Run
You should get a line of garbage which repeats about 10 times and then the command exits. This is good. Skip to the PPPD Options section.
If you get nothing and the command return to the prompt after a few seconds, this is probably OK as well, but try
where those are backward apostrophes (under the ~ on the US keyboard). This should give you the lines of garbage. If you do get this line of garbage, skip the next section. If you do not get that line of garbage, it is probable that the module support is not set up properly.
Setting up module support
If you did not get that line of garbage, but instead get "permission denied", you are not running as root. Log on as root and try again.
If you get a message saying that your kernel does not support ppp, do not recompile the kernel. This error message is a grab bag error message which the pppd program produces almost anytime something goes wrong. What it almost certainly means in the 2.0.x series of kernels is that you are not running kerneld.
To test if kerneld is running, run the command
ps aux|grep kerneld|grep -v grep
It will produce output if kerneld is running. If kerneld is running (or you have the 2.2.x kernels which use kmod instead) and you get this error message, try doing
insmod slhc insmod ppp
and try again. ( these load the modules permanently and you may have to put those lines into the file rc.local (/etc/rc.d/rc.local on RedHat and in various places under /etc on other distributions)
(If none of this works, then there are more severe problems that this note cannot solve.)
Assuming that you find that kerneld is not running, then on a Redhat system, run
or even just
(which should work on any Linux system).
[ If kerneld was not running, you will need to make sure that it is set to run each time you switch on your system. Unfortunately every distribution has a slightly different way of starting up daemons at bootup. In Redhat, also make sure that there are lines like S01kerneld as links to /etc/rc.d/init.d/kerneld in each of the directories /etc/rc.d/rc1.d to /etc/rc.d/rc5.d in RedHat. On other systems, you may need to put a line like
into /etc/rc.local, or /etc/rc.d/rc.local, or ....]
One final item, especially for Redhat systems, make sure that your give your machine a name (any single word name you want). You can set it with
But you also want to change it permanently. In Redhat/Mandrake, put the line
into /etc/sysconfig/network. On other systems I am not sure, but you
could always put the hostname command at the end of your rc.local file.
This is not essential to running ppp, but if you do not do it, you will
find yourself unable to run any X application while running ppp.
The 2.4.x series of kernels.
The kernel and module support has changed significantly for the 2.4.x series of Linux kernels, and require a number of additional actions on your part.
First, you must make sure that you are use at least pppd 2.4.0b2.(Do not be confused with the fact that both the kernel numbering and the ppp version numbering are now almost the same. This is just an accident.) The older 2.3.x series of ppp will not work with the new kernel.
Now you must make sure that you have the device /dev/ppp on your system. Do
ls -lga /dev/ppp
which should show that this file is owned by root, and has only read and write permissions for root. If it does not exist, do
mknod /dev/ppp c 108 0 chmod 600 /dev/ppp
Now, you must also make sure that you have the correct entries in the /etc/modules.conf file. (Note that this file has changed name from conf.modules on the older kernels to modules.conf on the 2.4.x series of kernels.) Enter the lines
alias /dev/ppp ppp_generic alias char-major-108 ppp_generic alias tty-ldisc-3 ppp_async alias tty-ldisc-14 ppp_synctty
into /etc/modules.conf if they are not already there. At this point the the test above (just running /usr/sbin/pppd) should work and produce garbage.
You have now set up the critical files on your system and you know that you have a an operational pppd. You now need to set up the ppp options so that you can get debugging information when you try to connect, and so that it is minimally usable.
/etc/ppp/options so it contains
lock crtscts defaultroute noauth
[note that if you are in the unlikely situation that you already have a working default route to an Ethernet, omit the defaultroute option. If you are not sure, put that option in.]
[Also other options can be used. In general do not do so unless advised to do so. More harm is done by putting in too many un-understood options than by putting in too few. If you have a local Ethernet, and if your ISP demands that they assign your IP address for the PPP connection, then also use
You could also put in a line containing debug here but we will use it explicitly on the command line.]
Bill Unruh works for the Advanced Research Department of the Canadian Institute for Physics and Astronomy.
Return to ONLamp.com.