Here is a write-up I prepared at some earlier time when this question was
asked. It addresses ONE way to enable dial up, limited in that it relies on
agetty (not a common *getty). 

Version sent out in e-mail 990129 � 
        has both short and long version included

Okay. Here are two versions. The first and shorter describes how to set up a
single modem line to act as a PPP server. The second describes the actual
setup I supported about 5 years ago, in which 8 modems had to hunt through a
pool of IP addresses to find one to use on a PPP link.

If you do set up something like this, I'd appreciate hearing back from you
as to how you did it, or at least what you found helpful, what confusing, in
this explanation. There is simply too little information around about how to
set these up, either with my approach or with another (there are others).

Version 1
---------

On the answering end, you don't "run" pppd as such -- you set up agetty (or
equivalent) to watch the port and run pppd in response to a login attempt.
Simplifying our setup a bit to remove complexity you don't require, what is
needed is:

1. in /etc/inittab, use a line like this to accept incoming calls on the port:

s0:45:respawn:/sbin/agetty -ht60 38400 ttyS0 -l /etc/ppp/ppplogin

This calls the script ppplogin instead of the normal login program. (modify
device identifier and serial-line speed as appropriate to your setup.) The
important feature of agetty that is relevant here is that it will let you
specify a program other than /bin/login to run. Any *getty* program that has
this ability should substitute nicely for agetty.

2. Assuming you need to work with only one fixed pair of IP addresses, you
would use a ppplogin script like:

!/bin/sh
exec /usr/lib/ppp/pppd passive modem proxyarp auth login +pap \ 
        192.168.86.23:192.168.86.42

where the first number is the server's IP address and the second the IP
address you want to assign to the client.

3. The modem, of course, needs to be set up to auto answer.

Version 2
---------

Here are the scripts we used to do something fairly similar to what you seem
to want. I've edited them a bit, to replace information like the site's
actual IP numbers with dummies and to eliminate some choices irrelevant to
your problem. From this starting point, you should be able to develop what
you want. 

Step 1 -- in /etc/inittab, add a line for a process that monitors each
serial port that has a modem. Our installation used agetty (still the
default *getty in Slackware, but not included, I don't think, in all the
other distributions). The distinction feature of agetty is that it allows
you to substitute a different program for /bin/login . Our lines, which
managed ports on a BocaBoard 16, looked like this:

b1:45:respawn:/sbin/agetty -ht60 38400 ttyS16 -l /usr/local/etc/login.sh
b2:45:respawn:/sbin/agetty -ht60 38400 ttyS17 -l /usr/local/etc/login.sh
b3:45:respawn:/sbin/agetty -ht60 38400 ttyS18 -l /usr/local/etc/login.sh
b4:45:respawn:/sbin/agetty -ht60 38400 ttyS19 -l /usr/local/etc/login.sh
b5:45:respawn:/sbin/agetty -ht60 38400 ttyS20 -l /usr/local/etc/login.sh
b6:45:respawn:/sbin/agetty -ht60 38400 ttyS21 -l /usr/local/etc/login.sh 
b7:45:respawn:/sbin/agetty -ht60 38400 ttyS22 -l /usr/local/etc/login.sh
b8:45:respawn:/sbin/agetty -ht60 38400 ttyS23 -l /usr/local/etc/login.sh

("-ht60" idnetified the line as a modem line; "man agetty" for details)

Step 2 -- create an appropriate login script (the login.sh in the above).
Ours was designed to allow people connecting to choose between a shell
connection (to a different machine, the one that had their accounts) and a
ppp connection. It looked like this:

#!/bin/bash
export TERM='vt100'
echo "login     `/bin/date`     $2      `tty`" >> /var/adm/logins
if [ $2 = 'ppp' ]; then
        /etc/ppp/ppplogin
else
        /usr/bin/rlogin -E8l $2 192.168.42.1
fi;
echo "logout    `/bin/date`     $2      `tty`" >> /var/adm/logins
#eop

If you don't need to distinguish shell and ppp logins, you can skip this
step and have the inittab entries point directly to the ppplogin script.

Step 3 -- create an appropriate ppplogin script. The main work here is to
set the IP addresses. This does it dynamically -- if you are assigning a
fixed address to each modem, you could use 8 different scripts in the
inittab calls, one for each modem, setting the appropriate address for each.
In any case, our approach looked like this:

#!/bin/sh
pppid=0.0.0.0
if [ `/sbin/ifconfig |grep -c 192.168.42.11` = 0 ]; then
        pppid=192.168.42.11
elif [ `/sbin/ifconfig |grep -c 192.168.42.12` = 0 ]; then
        pppid=192.168.42.12
elif [ `/sbin/ifconfig |grep -c 192.168.42.13` = 0 ]; then
        pppid=192.168.42.13
elif [ `/sbin/ifconfig |grep -c 192.168.42.14` = 0 ]; then
        pppid=192.168.42.14
elif [ `/sbin/ifconfig |grep -c 192.168.42.15` = 0 ]; then
        pppid=192.168.42.15
elif [ `/sbin/ifconfig |grep -c 192.168.42.16` = 0 ]; then
        pppid=192.168.42.16
elif [ `/sbin/ifconfig |grep -c 192.168.42.17` = 0 ]; then
        pppid=192.168.42.17
elif [ `/sbin/ifconfig |grep -c 192.168.42.18` = 0 ]; then
        pppid=192.168.42.18
fi;

[the next bit is all one line in the original script]
exec /usr/lib/ppp/pppd passive modem proxyarp auth login +pap
192.168.42.4:$pppid
# eop

You'll want to change the pppd line to reflect the setup appropriate to your
site, in particular the file you use for authorized userid/password pairs
for connecting. 

At 08:02 AM 1/29/99 -0500, Robert C. Cutchins wrote:
>You had made the offer to send instructions to a Linux subscriber on 
>setting up a PPP connection b/t a Linux box and an NT box. I am very 
>interested in doing the same, and would appreciate your written 
>documentation.

----------------------------------------------------------------------------
---------------------

Older versions
below----------------------------------------------------------------------


I did this (or almost this) years ago on a Slackware box -- ran 8 modems
using a Boca-16 serial multiplexer.

The service was a bit different in that that box needed to accept either a
shell or a PPP connection on each line, so that added some complexity.
Anyway, the client side (the end that dials) is pretty straightforward ...
proably just like what you do now to dial out.

On the answering end, you don't "run" pppd as such -- you set up agetty (or
equivalent) to watch the port and run pppd in response to a login attempt.
Simplifying our setup a bit to remove complexity you don't require, what is
needed is:

1. in /etc/inittab, use a line like this to accept incoming calls on the port:

s0:45:respawn:/sbin/agetty -ht60 38400 ttyS0 -l /etc/ppp/ppplogin

This calls the script ppplogin instead of the normal login program. (modify
device identifier and serial-line speed as appropriate to your setup.)

2. Assuming you need to work with only one fixed pair of IP addresses, you
would use a ppplogin script like:

!/bin/sh
exec /usr/lib/ppp/pppd passive modem proxyarp auth login +pap \ 
        192.168.86.23:192.168.86.42

where the first number is the server's IP address and the second the IP
address you want to assign to the client.

3. The modem, of course, needs to be set up to auto answer.

At 02:09 PM 8/18/98 -0400, you (Michael W. Spraggins) wrote:
>Anyone out there know how to establish a PPP link between two Redhat 5.0
>boxes.  
[rest deleted]


About 4 years ago, I set up a modem pool for a former employer. The general
approach was to do it through /etc/inittab, having a *tty (I think we used
agetty) process watch each serial port that had a modem on it. agetty (or
whatever) can run a program other than /bin/login when it senses a
connection, and we wrote a short script that allowed the user to choose
between a ppp and a shell connection. The ppp choice called a second script,
which set up the actual ppp connection. We had a pool of IP addresses, and
the second script assigned the first available one to the line. 

Way back then, out-of-the-box kernels only supported 4 ppp lines, and we had
8 modems, so there was other fiddling we had to do to account for that
limit. This, as I recall, is why we assigned the addresses dynamically. Were
I doing it now, I'd just assign an address permanently to each line ...
unless my app required associating an IP address with each remote machine.
In that case, I think the old script we used for address assignment could be
modified to handle that, working from a passwd-like flat file.

Anyway, if this sounds helpful, get back to me and I'll try to dig out the
scripts we used back then.

BTW, no, I've never seen any documentation anywhere of this approach, but I
know of a couple of sites that have used variants of it (mainly different in
that they use a different *tty*, I think mgetty) successfully.

Hope this helps. Good luck.

At 06:00 PM 12/16/98 -0600, Hughes, Timothy P wrote:
>I am sorry about the confusion, I have recieve a few mails concerning
>this same subject.  I mean to say that Windoz95 does not recieve the
>gateway information, or an IP address when using the PPP protocol.  The
>modems handshake fine, but they can not negotiate a proper protocol.  I
>am trying to create a dynamic IP address modem pool for my employer, but
>I have not been able to get either PPP or slip to work in providing
>dynamic IP addresses to the users.  I have read all of the documentation
>that comes with both slip and PPP, and have tried many different ways to
>setup dynamic IP addressing, but I have yet been unsuccessfull.  I am
>just wondering if there is more documentation out there on setting up a
>dynamic IP PPP server or slip server.  Thanks for any help.  Sorry again
>for the initial confusion.
[deleted]


Okay. Good. Here are the scripts we used to do something fairly similar to
what you seem to want. I've edited them a bit, to replace information like
the site's actual IP numbers with dummies and to eliminate some choices
irrelevant to your problem. From this starting point, you should be able to
develop what you want. 

Once you get this working, BTW, I'd be interested in feedback as to what
changes you needed to make it work. Also, you say the documentation you
found was "more for the client side...." Everything I have seen has been
*exclusively* for the client side, except for my own stuff and some material
a friend wrote on how he did this using mgetty. Have you seen *any* other
server-sice stuff for ppp?

Anyway, here goes .... 

Step 1 -- in /etc/inittab, add a line for a process that monitors each
serial port that has a modem. Our installation used agetty (still the
default *getty in Slackware, but not included, I don't think, in all the
other distributions). Our lines, which managed ports on a BocaBoard 16,
looked like this:

b1:45:respawn:/sbin/agetty -ht60 38400 ttyS16 -l /usr/local/etc/login.sh
b2:45:respawn:/sbin/agetty -ht60 38400 ttyS17 -l /usr/local/etc/login.sh
b3:45:respawn:/sbin/agetty -ht60 38400 ttyS18 -l /usr/local/etc/login.sh
b4:45:respawn:/sbin/agetty -ht60 38400 ttyS19 -l /usr/local/etc/login.sh
b5:45:respawn:/sbin/agetty -ht60 38400 ttyS20 -l /usr/local/etc/login.sh
b6:45:respawn:/sbin/agetty -ht60 38400 ttyS21 -l /usr/local/etc/login.sh 
b7:45:respawn:/sbin/agetty -ht60 38400 ttyS22 -l /usr/local/etc/login.sh
b8:45:respawn:/sbin/agetty -ht60 38400 ttyS23 -l /usr/local/etc/login.sh

(man agetty for details on the switches)

Step 2 -- create an appropriate login script (the login.sh in the above).
Ours was designed to allow people connecting to choose between a shell
connection (to a different machine, the one that had their accounts) and a
ppp connection. It looked like this:

#!/bin/bash
export TERM='vt100'
echo "login     `/bin/date`     $2      `tty`" >> /var/adm/logins
if [ $2 = 'ppp' ]; then
        /etc/ppp/ppplogin
else
        /usr/bin/rlogin -E8l $2 192.168.42.1
fi;
echo "logout    `/bin/date`     $2      `tty`" >> /var/adm/logins
#eop

If you don't need to distinguish shell and ppp logins, you can skip this
step and have the inittab entries point directly to the ppplogin script. 

Step 3 -- create an appropriate ppplogin script. The main work here is to
set the IP addresses. This does it dynamically -- if you are assigning a
fixed address to each modem, you could use 8 different scripts in the
inittab calls, one for each modem, setting the appropriate address for each.
In any case, our approach looked like this:

#!/bin/sh
pppid=0.0.0.0
if [ `/sbin/ifconfig |grep -c 192.168.42.11` = 0 ]; then
        pppid=192.168.42.11
elif [ `/sbin/ifconfig |grep -c 192.168.42.12` = 0 ]; then
        pppid=192.168.42.12
elif [ `/sbin/ifconfig |grep -c 192.168.42.13` = 0 ]; then
        pppid=192.168.42.13
elif [ `/sbin/ifconfig |grep -c 192.168.42.14` = 0 ]; then
        pppid=192.168.42.14
elif [ `/sbin/ifconfig |grep -c 192.168.42.15` = 0 ]; then
        pppid=192.168.42.15
elif [ `/sbin/ifconfig |grep -c 192.168.42.16` = 0 ]; then
        pppid=192.168.42.16
elif [ `/sbin/ifconfig |grep -c 192.168.42.17` = 0 ]; then
        pppid=192.168.42.17
elif [ `/sbin/ifconfig |grep -c 192.168.42.18` = 0 ]; then
        pppid=192.168.42.18
fi;

[the next bit is all one line in the original script]
exec /usr/lib/ppp/pppd passive modem proxyarp auth login +pap
192.168.42.4:$pppid
# eop

You'll want to change the pppd line to reflect the setup appropriate to your
site, in particular the file you use for authorized userid/password pairs
for connecting. Actually, I think all you really needed from me is the
advice in step 1; I expect you know how to do the rest of this already.

Hope this helps. Good luck.

At 07:43 AM 7/22/99 -0400, Miguel G. wrote:
>Hi all!
>
>Could anyone help me on figure out how to enable dial in access to my
>machine? I know that I might use getty or dip, but, thinks are far from
>clear for me, thanks in advance

------------------------------------"Never tell me the odds!"---
Ray Olszewski                                        -- Han Solo
Palo Alto, CA  94303-3603                       [EMAIL PROTECTED]        
----------------------------------------------------------------

Reply via email to