Re: Avoinding separate ppp options files for multiple ttys
On Wed, 11 Dec 1996, CoB SysAdmin wrote:
> I've got four modems that people can use to dial into my linux machine.
> I keep the standard defaults in a file called "options.std.dialin", and
> then I've got four files that merely read like so:
> # Set IP address...
> file /etc/ppp/options.std.dialin
> It seems kinda silly that there's no way to have just one file that maps
> IP's to ttys.... rather than having to have a separate file for each
yes, i find that silly too. so silly that i refuse to use it. i'd much
rather have all the ip addresses defined in one file (it's much easier
to vi one file than several to make global changes).
my solution is to NOT use /etc/ppp/options.tty*, (i find they're too
inflexible - it's IMPOSSIBLE to override any option specified in the
options.* files) but to just use a bare bones /etc/ppp/options file
and have a /usr/local/bin/ppplogin.sh script which execs pppd with the
e.g. something like:
OPTIONS="-detach modem crtscts passive proxyarp"
# default is to assign IP address by port number.
# also ttyS0 is dedicated to user ljs. no one else is allowed
# to use that line.
case $tty in
ttyS0) if [ "$LOGNAME" -ne "ljs" ] ; then
echo You are not authorised to use this line.
ttyS1) REMIP=d01.taz.net.au ;;
ttyS2) REMIP=d02.taz.net.au ;;
ttyS3) REMIP=d03.taz.net.au ;;
# override default dynamic IP address for certain login names. This
# allows assigning static IPs to certain users.
case $LOGNAME in
ljs) REMIP=nightowl.taz.net.au ; PPPIDLE="" ;;
helenst) REMIP=helenst.taz.net.au ; PPPOPTS="-d" ;;
Ptest) REMIP=22.214.171.124 ;;
ppac) REMIP="" ; PPPIDLE="" ;;
exec /usr/sbin/pppd $OPTIONS $PPPOPTS $PPPIDLE $LOCIP:$REMIP
ppp users have this script as their login shell in /etc/passwd.
There are minor complications when using this with mgetty's AutoPPP
option. Everything works, except for being able to restrict ttyS0 to
user ljs. It's not a huge issue for me at the moment as no-one else
knows the phone number. One of these days i'll install idled or timeoutd
or something and configure it so that everyone but ljs has 0 minutes on
Edit /etc/mgetty/login.config so that it runs
/usr/local/bin/ppplogin.auto for the /AutoPPP/ line:
/AutoPPP/ - - /usr/sbin/pppd auth -chap +pap login
/AutoPPP/ - - /usr/local/bin/ppplogin.auto
The ppplogin.auto shell script is simpler because there is no way of
determining who the user is until after pppd has been run.:
OPTIONS="-detach modem crtscts passive proxyarp auth -chap +pap login"
case $tty in
ttyS0) REMIP=nightowl.taz.net.au ;;
ttyS1) REMIP=d04.taz.net.au ;;
ttyS2) REMIP=d05.taz.net.au ;;
ttyS3) REMIP=d01.taz.net.au ;;
exec /usr/sbin/pppd $OPTIONS $PPPIDLE $LOCIP:$REMIP
Another variant of this that i have used on other systems is to have
an /etc/slip.hosts style file which is parsed by the ppplogin sh/perl
script to assign a static IP address based on either login name, or a
dynamic IP address based on port number if the specified IP address is
the string "-dynamic-".
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com