This depends on the kernel version you're using.
Since 1.1.14, Linux kernels have had built-in support for PPP. You'll be asked whether you want PPP when you run "make config". It's as easy as that.
Reboot with the new kernel. At startup, you should see something similar to one of the following.
If you have one of the latter 1.3 kernels or anyone after the stable relese: 2.0, you have dynamic allocation of PPP lines. This means that your PPP support will not be loaded until you run the PPP daemon (pppd). The messages you receive at startup will look like this:
PPP: version 2.2.0 (dynamic channel allocation) TCP compression code copyright 1989 Regents of the University of California PPP Dynamic channel allocation code copyright 1995 Caldera, Inc. PPP line discipline registered.
If you have a stable release 1.2 kernel or an earlier one, then 4 PPP channels are entered into your network devices. The messages you receive at startup will look like this:
PPP: version 0.2.7 (4 channels) NEW_TTY_DRIVERS OPTIMIZE_FLAGS TCP compression code copyright 1989 Regents of the University of California PPP line discipline registered.Don't worry if the words in capitals on the first line are slightly different.
Now, if your kernel is version 1.2 or below you can look at your network devices and 4 ppp devices will be registered. You can do this by looking at the contents of /proc/net/dev. It should look something like this:
Inter-| Receive | Transmit
face |packets errs drop fifo frame|packets errs drop fifo colls carrier
lo: 0 0 0 0 0 0 0 0 0 0 0
ppp0: 0 0 0 0 0 0 0 0 0 0 0
ppp1: 0 0 0 0 0 0 0 0 0 0 0
ppp2: 0 0 0 0 0 0 0 0 0 0 0
ppp3: 0 0 0 0 0 0 0 0 0 0 0
This indicates that the driver is successfully installed.
(Of course, you should keep a kernel without PPP around, in case something goes wrong.)
The first file that requires attention is the rc script that does network configuration at boot time, called /etc/rc.net or /etc/rc.d/rc.net.{1,2} or something similar, depending on your Linux distribution. If you are using the Red Hat distribution then you should use the control-panel program which comes with this distribution to edit your network settings unless you really know what you are doing. But if you are using another distribution, this file should 'ifconfig' the loopback interface lo, and should add an interface route for it. These lines might look something like this:
$CONFIG lo 127.0.0.1
$ROUTE add loopback
or
/sbin/ifconfig lo 127.0.0.1
/sbin/route add 127.0.0.1
However, it should *not* config an ethernet card or install any other
routes (unless you actually have an ethernet card, in which case I'll
assume you know what to do). Many distributions will provide scripts
that expect you to have an ethernet card.
You also need to decide whether you want to allow incoming telnet/ftp/finger, etc. If so, you should have the rc startup script run the 'inetd' daemon.
Next, you should set up /etc/hosts to have two lines. The first should just give the loopback or localhost address and the second should give your own host name and the IP address your PPP connection will use. For example:
127.0.0.1 loopback localhost # useful aliases
192.1.1.17 billpc.whitehouse.gov bill # my hostname
where my IP address is 192.1.1.17 and my hostname is
billpc.whitehouse.gov. (Not really, you understand.) If your PPP
server does dynamic IP address assignment, give a guess as to an
address you might get (see also "Dynamic Address Assignment" below).
Finally, you need to configure the domain name system by putting appropriate lines in /etc/resolv.conf . It should look something like this:
domain whitehouse.gov
nameserver 192.1.2.1
nameserver 192.1.2.10
Assuming there are nameservers at 192.1.2.1 and 192.1.2.10, then when
you get connected with PPP, you can reach hosts whose full names are
'hillarypc.whitehouse.gov' and 'chelseapc.whitehouse.gov' by the names
'hillarypc' and 'chelseapc'. You can probably find out the right
domain name to use and the IP numbers of nameservers from whoever's
providing your PPP link.
Example: A simple dial-up connection.
Here's a command for connecting to a PPP server by modem.
pppd connect 'chat -v "" ATDT5551212 CONNECT "" ogin: ppp word: whitewater' \
/dev/cua1 38400 -detach debug crtscts modem defaultroute 192.1.1.17:
Going through pppd's options in order:
pppd will write error messages and debugging logs to the syslogd daemon using the facility name "local2". (Verbose output from chat is the same.) These messages may already be logged to the console or to a file like /usr/adm/messages; consult your /etc/syslog.conf file to see. If you want to make all pppd and chat messages go to the console, add the line
local2.* /dev/consoleto syslog.conf; make sure to put one or more TAB characters between the two fields.
Anyway, assuming your connection is working, you should see chat dial the modem, then perhaps some messages from pppd (depending on your syslog.conf setup), then some kernel messages like this:
ppp: channel ppp0 mtu changed to 1500 ppp: channel ppp0 open ppp: channel ppp0 going up for IP packets!(These messages will only appear if you gave the option "kdebug 2" and have kern.info messages directed to the screen.) Simultaneously, pppd is also writing interesting things to /usr/adm/messages (or other log file, depending on syslog.conf).
First, type
/sbin/ifconfig(ifconfig may live elsewhere, depending on your distribution.) This should show you all the network interfaces that are 'UP'. ppp0 should be one of them, and you should recognize the first IP address as your own and the "POINT-TO-POINT ADDR" as the address of your server. Here's what it looks like on my machine:
lo Link encap Local Loopback
inet addr 127.0.0.1 Bcast 127.255.255.255 Mask 255.0.0.0
UP BROADCAST LOOPBACK RUNNING MTU 2000 Metric 1
RX packets 0 errors 0 dropped 0 overruns 0
TX packets 1468 errors 1 dropped 0 overruns 0
ppp0 Link encap UNSPEC HWaddr 00-00-00-00-00-00-00-F5-00-00-00-00-00-00-00-00
inet addr 128.175.13.100 P-t-P 128.175.13.37 Mask 255.255.0.0
UP POINTOPOINT RUNNING MTU 1500 Metric 1
RX packets 0 errors 0 dropped 0 overruns 0
TX packets 0 errors 0 dropped 0 overruns 0
If you have a kernel version 2.0 or later you should now have a networking
device for ppp, you can check this by looking at /proc/net/dev, it could
like like this:
# cat /proc/net/dev
Inter-| Receive | Transmit
face |packets errs drop fifo frame|packets errs drop fifo colls carrier
lo: 0 0 0 0 0 0 0 0 0 0 0
ppp0: 551 1 1 0 0 700 0 0 0 0 0
#
Now, try this:
ping z.z.z.zwhere z.z.z.z is the address of your server. This should work. Here's what it looks like for me:
# ping 128.175.13.37 PING 128.175.13.37 (128.175.13.37): 56 data bytes 64 bytes from 128.175.13.37: icmp_seq=0 ttl=255 time=446.5 ms 64 bytes from 128.175.13.37: icmp_seq=1 ttl=255 time=459.0 ms 64 bytes from 128.175.13.37: icmp_seq=2 ttl=255 time=420.4 ms 64 bytes from 128.175.13.37: icmp_seq=3 ttl=255 time=460.4 ms 64 bytes from 128.175.13.37: icmp_seq=4 ttl=255 time=440.4 ms 64 bytes from 128.175.13.37: icmp_seq=5 ttl=255 time=440.4 ms 64 bytes from 128.175.13.37: icmp_seq=6 ttl=255 time=399.7 ms ^C --- 128.175.13.37 ping statistics --- 7 packets transmitted, 7 packets received, 0% packet loss round-trip min/avg/max = 399.7/438.1/460.4 ms #Try typing:
netstat -nrThis should show three routes, something like this:
Kernel routing table Destination Gateway Genmask Flags Metric Ref Use Iface 128.175.13.37 0.0.0.0 255.255.255.255 UH 0 0 7 ppp0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 1640 lo 0.0.0.0 128.175.13.37 0.0.0.0 UG 0 0 30 ppp0If your output looks similar but doesn't have the destination 0.0.0.0 line (which refers to the default route used for connections), you may have run pppd without the 'defaultroute' option.
At this point you can try telnetting/ftping/fingering whereever you want, bearing in mind that you'll have to use numeric IP addresses unless you've set up your /etc/resolv.conf correctly.
local2.* /dev/console
local2.* /usr/adm/ppplog
This will cause pppd's messages to be written to the current virtual
console and to the file /usr/adm/ppplog. Note that the left-hand
field and the right-hand field must be separated by at least one TAB
character. After modifying /etc/syslog.conf, you must execute the
command 'kill -HUP Some messages to look for:
local2.*,kern.* /dev/console
local2.*,kern.* /usr/adm/ppplog
and HUP the syslog daemon as before. Then, run pppd with the option
"kdebug 5". Whatever characters arrive over the PPP terminal line
will 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 remote server because of a serial overrun. This means your CPU isn't able to read characters from the serial port as quickly as they arrive; the best solution is to get a 16550A serial chip, which gives the CPU some grace period. Reasons other than 4 indicate other kinds of serial errors, which should not occur.
During the initial connection sequence, you may see one or more messages which indicate "bad fcs". This refers to a checksum error in a received PPP frame, and usually occurs at the start of a session when the peer system is sending some "text" messages, such as "hello this is the XYZ company". Messages of "bad fcs" once the link is established and the routes have been added are not normal and indicate transmssion errors or noise on the telephone line.
The University of Delaware uses dynamic IP assignment.
Sometimes you may get an error message like "Cannot assign requested address" when you use a Linux client (for example, "talk"). This happens when the IP address given in /etc/hosts for our hostname differs from the IP address used by the PPP interface. The solution is to use ifconfig ppp0 to get the interface address and then edit /etc/hosts appropriately.