File: martin.html

package info (click to toggle)
lg-issue38 1-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 2,128 kB
  • ctags: 147
  • sloc: makefile: 36; sh: 4
file content (222 lines) | stat: -rw-r--r-- 7,714 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!--startcut ==========================================================-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<title>PAP HOWTO LG #38</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!--endcut ============================================================-->

<H4>
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>

<P> <HR> <P> 
<!--===================================================================-->

<center>
<H1><font color="maroon">PAP HOWTO</font></H1>
<H4>By <a href="mailto:catfish@alltel.net">Terry Martin</a></H4>
</center>
<P> <HR> <P>  

<P>
This Document is covered by the GPL and can be used in anyway seen fit from 
the license.
<P>
This document is not intended to replace the ppp-howto it is intended to be 
a primer as howto setup PAP for calling an ISP that refuses tech support 
to a Linux user.
<P>
 PAP=Password Authentication Protocol.
<P>
  If your not sure if your ISP uses pap just bring minicom up and 
atdt&lt;isp-number&gt; and wait for the modem to connect.
<P>
If you get login: or some variant of that your isp is not using pap and this 
paper is not for you.
<P>
 If you get a line or two of trash like:
<PRE> 
{}{}{}{}{}}}}{{}{}}}{}{}{}{}[][][][][ 
 </PRE> 
 You know it's looking for PAP or mschap.
<P>
  I won't deal with MSChap since I don't have access to an ISP that uses 
it and I wouldn't want to knowing the reliability of NT.
 Now assuming your dealing with chap we need to figure out what version
of pppd your using. Type /usr/sbin/pppd --version and you will get the 
version number, I'll cover versions 2.2.0-f and 2.3.5 in this doc as 
thats what I'm familiar with.
  
<H3>pppd 2.2.0 version.</H3> 
<P>
This section I will cover the setup and impletation of pap with older 
distributions like RH 4.2 and Slackware 3.6 use this older version of the
pppd daemon.
<P>
 I prefer pico for the new users as editors of choice for console. If you don't
have it look into getting the latest Pine release it's part of it.
<P>
  You have to edit your ppp-on script if you have one if not I'll include 
one here. You need to look into /usr/doc/pppd*/scripts for the ppp scripts, 
at least thats where the defaults reside with RedHat.
<P>
Here's what my ppp-on looks like:<BR> 
<P>
  This is setup for your modem being on com2 in dos or /dev/ttyS1 in Linux.
You need to use ttySxx since the /dev/cua1 is now a defunct format with the 
2.2.x kernels. If you plan to upgrade to kernel 2.2.x you need upgrade your 
pppd to at least pppd-2.3.x to keep ppp working.
<PRE> 
#!/bin/sh
TELEPHONE=&lt;your-isp-phonenumber&gt;

LOCAL_IP=0.0.0.0        # Local IP address if known. Dynamic = 0.0.0.0
REMOTE_IP=0.0.0.0       # Remote IP address if desired. Normally 0.0.0.0
NETMASK=255.255.255.0   # The proper netmask if needed

export TELEPHONE   

DIALER_SCRIPT=/etc/ppp/ppp-on-dialer

exec  /usr/sbin/pppd debug lock modem crtscts /dev/ttyS1 115200 \
        asyncmap 20A0000 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \
        noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT \
        +ua /etc/ppp/pap-secret
</PRE> 
Thats what your ppp-on file will need to make pap work. 
As you can see your login name and password are no longer included in this 
file so that closes a security risk there. 
<P>
   Anyplace you see &lt;name&gt; always omit the &lt; &gt; and just use the 
information needed.
<P>
 Next you need to edit /etc/ppp/ppp-on-dialer to disable the looking for a 
login and password lines.
<P>
Example:
<PRE> 
#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
# This is the ppp-on-dialer for PAP with pppd-2.2.0
exec /usr/sbin/chat -v                                  \
        TIMEOUT         3                               \
        ABORT           '\nBUSY\r'                      \
        ABORT           '\nNO ANSWER\r'                 \
        ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
        ''              \rAT                            \
        'OK-+++\c-OK'   ATH0                            \
        TIMEOUT         30                              \
        OK              ATDT$TELEPHONE                  \
        CONNECT         ''                              \

</PRE> 
 Now we'll cover the password file setup and format. 
This next part is easy all you need is a file named pap-secret
with the login name and password on separate lines.
<P>
i.e., pap-secret with pppd-2.2.0
<PRE>
greg
stinky1
</PRE>
 After you make this file if it's not there. As root type 
 <PRE> 
 chmod -r pap-secret
</PRE>
  Please don't forget the /etc/resolv.conf file for your DNS numbers.
<P>
  I know I said this wasn't goin to be a ppp-howto but I'll include 
 /etc/resolv.conf just to save headaches and email as to why it don't it work.
<PRE> 
domain &lt;your.isp.com&gt;
search &lt;your.isp.com&gt;
nameserver xxx.xxx.xxx.xxx
nameserver xxx.xxx.xxx.xxx
</PRE> 
Your /etc/resolv.conf should look something like this with the proper 
information edited.
<P>
Put the ppp-on in /usr/sbin/ and put ppp-on-dialer in /etc/ppp with pap-secret
as root
<PRE> 
cp ppp-on /usr/sbin/
cp ppp-on-dialer /etc/ppp
cp pap-secret /etc/ppp
</PRE> 
Now all you should have to do is type ppp-on and you should get connected 
to the net with Linux. Enjoy.
<P>
<H3>pppd-2.3.5</H3> 
<P>
  Seting up PAP with pppd-2.3.5 is as easy as pppd-2.2.0 just the syntax 
has changed in the ppp-on script.
 Please refer to the ppp-on-dialerand the resolv.conf in the above for it
 so I don't have to repeat myself here.
<P>
Heres an example ppp-on script.
<PRE> 
#!/bin/sh

TELEPHONE=&lt;you-isp-phone-number&gt;

LOCAL_IP=0.0.0.0        # Local IP address if known. Dynamic = 0.0.0.0
REMOTE_IP=0.0.0.0       # Remote IP address if desired. Normally 0.0.0.0
NETMASK=255.255.255.0   # The proper netmask if needed

export TELEPHONE

DIALER_SCRIPT=/etc/ppp/ppp-on-dialer

exec  /usr/sbin/pppd debug lock modem crtscts /dev/cua1 115200 \
        asyncmap 20A0000 escape FF kdebug 0 name catfish $LOCAL_IP:$REMOTE_IP \
        noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT \
 </PRE>        
 Thats about all there is to it for ppp-on with pppd-2.3.5 and PAP.
<P>
Now for the /etc/pap-secret file the syntax here has changed from the 
earlier pppd-2.2.0 also.
<P>
 All you need here now is a single line with your login name the interface 
and your password. 
<P>
 So your pap-scret file would look like so.
<P>
I.E. pap-secret
<PRE> 
&lt;loginname&gt; ppp0 &lt;password&gt;
</PRE> 
Well thats all there is to it for the PAP howto, pretty basic stuff when 
theres documents for it. 
<P>
  Enjoy and happy surfing.
Terry Martin aka catfish on newnet #alt.linux 
catfish@alltel.net
<P>
If for some reason you can't get it to work or you find an error please 
email me.

<!--===================================================================-->
<P> <hr> <P> 
<center><H5>Copyright &copy; 1999, Terry Martin <BR> 
Published in Issue 38 of <i>Linux Gazette</i>, March 1999</H5></center>

<!--===================================================================-->
<P> <hr> <P> 
<A HREF="./lg_toc38.html"><IMG ALIGN=BOTTOM SRC="../gx/indexnew.gif" 
ALT="[ TABLE OF CONTENTS ]"></A>
<A HREF="../lg_frontpage.html"><IMG ALIGN=BOTTOM SRC="../gx/homenew.gif"
ALT="[ FRONT PAGE ]"></A>
<A HREF="./jenkins7.html"><IMG SRC="../gx/back2.gif"
ALT=" Back "></A>
<A HREF="./adler1.html"><IMG SRC="../gx/fwd.gif" ALT=" Next "></A>
<P> <hr> <P> 
<!--startcut ==========================================================-->
</BODY>
</HTML>
<!--endcut ============================================================-->