⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 how to hook up ppp in linux.htm

📁 How to Hook up PPP in Linux
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0042)http://axion.physics.ubc.ca/ppp-linux.html -->
<HTML><HEAD><TITLE>How to Hook up PPP in Linux</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1561" name=GENERATOR></HEAD>
<BODY>
<CENTER>
<H2>How to hook up PPP</H2></CENTER>
<CENTER>
<H3>in Linux</H3></CENTER>
<CENTER>
<H3>W.G. Unruh</H3></CENTER>
<CENTER><IMG alt="" src="How to Hook up PPP in Linux.files/unruh.png"> 
</CENTER>You can download this file as a text file (no HTML formatting) at <A 
href="http://www.theory.physics.ubc.ca/ppp-linux.txt">www.theory.physics.ubc.ca/ppp-linux.txt</A> 
<BR>or as an HTML version at <A 
href="http://www.theory.physics.ubc.ca/ppp-linux.html">http://www.theory.physics.ubc.ca/ppp-linux.html</A>
<P>This document is copyright W. Unruh. It may be copied freely as a whole for 
non-commercial purposes, but must retain the indication of authorship. If you 
want to include it in a collection for sale, please contact the author. 
Furthermore, any alterations must have the permission of the author. 
<H4>Reason for Document </H4>
<P>The key problem in hooking up a PPP link to an Internet Service Provider 
(ISP) is that the ISP's seem to compete with each other as to who can find 
another obscure way of authenticating users. Thus we have login, PAP, CHAP 05, 
CHAP80, CHAP80-lanman, CHAP81, ... and combinations of these. The chief 
difficulty of connecting to an ISP is discovering which technique is actually 
being used by the ISP in an orderly way. Since few of them know anything about 
Linux, and since few of them even understand what technique they actually use, 
this procedure should allow you to set up without their help, or to understand 
what their help means if it is given. 
<P>The following has a number of steps to connecting to your ISP. The temptation 
is to skip steps. This is a bad idea, as it will almost certainly lead to grief. 
Do each step and you will succeed, and you will also learn something about your 
system in the process. 
<P>These instructions were developed with the 2.0.x versions of the Linux 
kernels, and also work with the 2.2.x or 2.4.x series of kernels as well. 
Similarly, they work with versions of pppd at least from version 2.3.3 on (up to 
2.4.1 by now).(For the 2.4.x kernels you <B>must</B> use pppd version 2.4.1 or 
later.) In fact some of the features below only work with later versions of pppd 
and I would urge you to upgrade to the latest version. You can get the latest 
pppd from <A href="ftp://ftp.samba.org/pub/ppp">ftp://ftp.samba.org/pub/ppp</A>. 
You may be able to get versions from <A 
href="ftp://cs.anu.edu.au/pub/software/ppp/">ftp://cs.anu.edu.au/pub/software/ppp/</A> 
but these sites may not be up to date. 
<P>Unfortunately the man page for pppd has gotten out of date, and a number of 
options have been added/subtracted without proper documentation. For a latest 
man page for pppd 2.4.1 written by James Carlson ( who ported pppd to Solaris 
and is the Solaris maintainer), see <A 
href="http://axion.physics.ubc.ca/pppd-jc.8">pppd-jc.8</A> 
<CENTER>
<H3>INDEX</H3></CENTER>
<UL>
  <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Initial">Initial 
  Setup</A> 
  <UL>
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Modem">Modem</A> 
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Logging">Logging</A> 

    <LI><A 
    href="http://axion.physics.ubc.ca/ppp-linux.html#Resolver">Resolver</A> 
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#NoDefault">No 
    Default Route</A> 
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#PPPDModule">PPPD 
    Module support</A> 
    <UL>
      <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#2.0">2.0.x 
      kernels</A> 
      <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#2.2">2.2.x 
      kernels</A> 
      <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#2.4">2.4.x 
      kernels</A> </LI></UL>
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#PPPOptions">PPP 
    Options</A> </LI></UL>
  <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#ISPWant">What does ISP 
  Want? </A>
  <UL>
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#ImmedPPP">Immediate 
    PPP</A> 
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Which">Which 
    Authentication?</A> 
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Login">Login 
    Authorisation?</A> 
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#PAP">PAP/CHAP</A> 
    <UL>
      <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Types">Types of 
      CHAP</A> 
      <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Settingup">Setting 
      up PAP/CHAP</A> </LI></UL>
    <LI><A 
    href="http://axion.physics.ubc.ca/ppp-linux.html#AreYouConnected">Connected?</A> 

    <LI><A 
    href="http://axion.physics.ubc.ca/ppp-linux.html#Connected!">Connected!</A> 
    </LI></UL>
  <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Testing">Testing 
  Connection</A> 
  <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Other">Various 
  Possible Problems</A> 
  <LI><A 
  href="http://axion.physics.ubc.ca/ppp-linux.html#Automation">Automation</A> 
  <UL>
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#SUID">SUID</A> 
    <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Script">Scripts</A> 
    <LI><A 
    href="http://axion.physics.ubc.ca/ppp-linux.html#Security">Security</A> 
  </LI></UL>
  <LI><A href="http://axion.physics.ubc.ca/ppp-linux.html#Stopping">Stopping 
  PPP</A> </LI></UL><A name=Initial></A>
<CENTER>
<H3>Initial Setup</H3></CENTER>
<P>For much of this document, the steps are essentially independent of your ISP. 
Many ISPs do not know their own systems, and their advice must often be taken 
with a grain of salt. Thus, the document below shows you how to find out what 
your ISP wants, independent of what your ISP says he wants. However, for the 
first step you cannot do without your ISP. You must get a username and a 
password from your ISP-- which usually means that you must open an account with 
them and pay your money. It is worth asking them to make sure that they tell you 
exactly what form that user name must take when you sign on. For example some of 
them demand that you use your full email address with them as your username, 
rather than simply the name itself. Others demand additional additions to the 
bare username. Try to get them to be as specific as possible about exactly what 
you need to use. <BR>You also need to get the ISP's Domain Name Server (DNS-IP) 
address. (This is an address in Internet Protocol (IP) format, which is four 
numbers each less than 256 separated by dots (eg 142.103.234.29).) Often they 
will give you more than one. Occasionally an ISP will refuse. In that case they 
may supply the DNS dynamically instead. Using ppp version greater than 2.3.7 
will allow you still to sign on with them as described below. <BR>&nbsp; Having 
that information, log on as root (use root as the user name when you log on), 
or, after you have logged on as a user, run <BR><B>su</B> <BR>and enter your 
root password at the prompt.) 
<H3><A name=Modem>Modem</A></H3>Make sure that you know which port your modem is 
on. The two programs at <A 
href="http://axion.physics.ubc.ca/modem-chk.html">modem-chk.html</A> can help 
you to determine which port your modem is on. Alternatively, running 
<BR><B>setserial -bg /dev/ttyS*</B> can help find serial devices with something 
attached. <BR>Remember that COM1 (serial port 1) is /dev/ttyS0. COM2 is 
/dev/ttyS1, etc. In the following I will assume /dev/ttyS1. Change for your 
situation. <BR>If you have an internal PCI card modem (which is not a winmodem-- 
see below), looking in /proc/pci can give you a clue as to where the PCI bus 
placed the modem (ie port and irq). You can use the setserial command to set up 
one of the ttyS devices to use that port and irq. <BR>It is preferable to use 
the ttyS device rather than the cua device or the modem device. The cua devices 
will (have) disappear in future releases of Linux, and the /dev/modem device 
hides what you are actually doing and can lead to conflicts with other programs 
which use the serial ports. <BR>[Note that if your modem is a winmodem, it will 
not work as is under Linux. Some winmodems now have drivers for Linux. See <A 
href="http://www.linmodems.org/">http://www.linmodems.org/</A>--- It is probably 
a winmodem if it is a PCI modem, less so if it is an ISA and improbable if it is 
an external modem, and also improbably if it is not a 56K modem. <BR>If you have 
the latest kernels with USB support (Kernels 2.2.17 with the USB patches or 
2.4.x) you may also be able to use USB modems. (They must comply with the ACM 
standard.) See The file Documentation/usb/acm.txt included with the Linux source 
(/usr/src/linux* if included on your system, or <A 
href="http://www.theory.physics.ubc.ca/usb-acm.txt">here</A> is a copy from 
kernel 2.2.17 ) Note that for USB modems, the correct port to use is not the 
serial port ttyS? series but probably the /dev/usb/acm/? series of ports, where 
? is a usb number. I have never used a usb modem, so can provide no guidance on 
setting them up correctly. <A name=Logging></A>
<H3>Message Logging</H3>In order to figure out what is happening while you are 
trying to log on to your ISP, you must turn on debugging and log the debug 
messages to some file. The key programs are pppd, and a program it uses, called 
chat. We will store those debugging messages in a file called /var/log/ppp. (You 
can use any file you wish, including /var/log/messages. Some distributions are 
now installing a directory called /var/log/ppp (Eg, The Corel distribution does 
this). If yours does, you must use a different name, eg, /var/log/ppplog. Use 
that name instead everywhere this document talks about /var/log/ppp.) 
<P>In order that your system will record the debugging information from both 
these programs, do the following: <BR><B>cp /etc/syslog.conf 
/etc/syslog.conf.orig</B> <BR>to make sure you have a copy of a good version in 
case you mess up the next command. If you have trouble, copy back the original 
version. <BR>Edit /etc/syslog.conf and add the lines <PRE>local2.*                                /var/log/ppp 
daemon.*                                /var/log/ppp
</PRE>(Some versions of syslogd (eg on SunOS) demand that those be tabs not 
spaces between the two parts on each line. Some editors refuse to insert tabs 
and convert them to spaces. The syslogd shipped with most recent distributions 
of Linux do not seem to care, but Be warned.) 
<P>Then, to tell syslogd to actually log the information, do <BR><B>killall -1 
syslogd</B> 
<P>SUSE has now gone over to using syslog-ng instead of syslogd. While it does 
give much more room for fine tuning exactly what and how you want things logged, 
it comes with a much more complex setup. As far as I can tell from the docs for 
syslog-ng, you need to add the following lines to the /etc/syslog-ng.config or 
/etc/syslog-ng/syslog-ng.conf file <PRE>destination ppp { file("/var/log/ppp"); };

filter f_ppp {facility(daemon) and facility(local2);};

log { source(src); filter(f_ppp); destination(ppp); };

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -