Install mgetty+sendfax
 

To be able to answer the incoming call from a modem (not ISDN) I use mgetty because it's nice and configurable, and it has an option that will sense a PPP connect, and fire up pppd with PAP. This 'AutoPPP' option is great for Windows users, both 95, 98 and NT, and of course all other operating systems with dial-up PPP.


First download the latest package of mgetty+sendfax which is v1.1.9 when I'm writing this. Copy it into "/usr/local/src" and run:
"tar -xzvf mgetty+sendfax_1.1.9.tar.gz" to decompress it. Then change to the subdirectory where the source are and edit the Makefile. Somewhere around line 110 change the CFLAGS to read:

CFLAGS=-O2 -Wall -pipe -DAUTO_PPP

This will compile in the parts for autodetection of incoming PPP calls.
Next, copy policy.h-dist to policy.h, edit it as it fits, but make sure the line that's around line 40 reads:

#define LOGIN_CFG_FILE "login.config"

Then compile the mgetty as described in "README.1st" (I guess you have already read this? :) That is run "make" if this goes fine run "make testdisk" to see if the disk statistics grabber works and finally run "make install".


Now I edit "/etc/inittab" to run mgetty on my serial ports. The entry looks like this:

S0:2345:respawn:/usr/local/sbin/mgetty -D -x2 /dev/ttyS0
S1:2345:respawn:/usr/local/sbin/mgetty -D -x2 /dev/ttyS1
S2:2345:respawn:/usr/local/sbin/mgetty -D -x2 /dev/ttyS2
S3:2345:respawn:/usr/local/sbin/mgetty -D -x2 /dev/ttyS3

NOTE:Your mgetty file may be installed in another location other than mine.

To test the installation so far; as root type 'kill -1 1' to reload the inittab, and watch your modems. They should initialize. But do not expect the AA light to turn on, because mgetty do not set the modem in autoanswer mode.... Also try to make a call, and the modem should answer. (But you can't log in... yet).


As you see I have 4 modems here. And because I installed two extra com-port, I have made an "/etc/rc.d/rc.serial" that looks like this:

/bin/setserial -v /dev/ttyS0 irq4   # Port 1, 9 pin, onboard
/bin/setserial -v /dev/ttyS1 irq3   # Port 1, 25 pin, onboard
/bin/setserial -v /dev/ttyS2 irq5   # Port 1, 9 pin, xtracard
/bin/setserial -v /dev/ttyS3 irq7   # Port 1, 25 pin, xtracard

This is because Linux does not recognize which IRQ resource the extra board shall use, and just places them an IRQ4 and IRQ3 as default.


To tell the mgetty to kick of the ppp-daemon when it get's a call the file "login.config", probably located in "/usr/local/etc/mgetty+sendfax". Somewhere around line 53 there's a line starting with "#/AutoPPP/". Edit this line so it looks like this (check your path to pppd...):

/AutoPPP/ - - /usr/sbin/pppd

But if the pppd that is in the RedHat 5.2 distribution is used the you might want to use:

/AutoPPP/ - ppp_user /usr/sbin/pppd

This will give a more reasonable result when using "ps aux". Or I rather downloaded pppd version 2.3 patch level 4 and used this one instead of pppd version 2.3 patch level 5 that's included in RedHat 5.2. This one reports real username when using "w", "who" or "finger".

Then we the file "/etc/ppp/options" needs to be edited and mine looks like this:

-detach
auth
login
proxyarp
lock
+pap
-chap

NB: To get the pppd to start and authenticate properly when I used RedHat 4.2 I had to remove the following file: "/etc/ppp/pap-secrets" otherwise it will look for username and passwords there.


I also wanted to do dynamic ip-addresses with PPP. This simplifies the installation of the client a bit because the caller will get an ip-address from the terminalserver and do not have to configure one in his setup. For modems I make some files located in "/etc/ppp" called "options.ttySX" where X are the device number, and it looks like this (x=local ip-address, y=ip-address to assign):

xxx.xxx.xxx.xxx:yyy.yyy.yyy.yyy

Now you can test the configuration, by first as root type 'kill -1 1' to reload the inittab, and then final up from an other machine using username and password that is defined on the terminal server.

 
  | Index | mgetty+sendfax | Kernel | isdn4linux | Links |

Design 19©96-20©03, Robert Grefstad