Setting Up Dial-IN Server on RedHat Linux 9

This is a small writeup on how I setup a Dial-in Server on a RedHat Linux 9 Server. The procedure is quite simple, though unlike in setup of Dial-up using KPPP there is no GUI based interface in this case.

I am heavily indebted to Ming Jiang whose page helped me immensely through a step-by-step procedure on the setup.
My page here gives only the process of configuring the dial-in server what I had with one telephone line and one modem. But it can be easily extended to multiple incoming lines.

What I had ?
  1. A Celeron based PC 64MB RAM and  40GB Hard Disk.
  2. Red Hat Linux 9 (Shrike) installed on it.
  3. KPPP configured for dialout to my ISP. The configuration details are available here.
  4. mgetty1.1.30-2 installed from the RPM. I had this RPM in the Disk 2 of the RedHat Linux 9 CD set. You can as well try downloading the same from here or from the Official mgetty site here. Mgetty site says, 1.1.30 is a beta version. 
  5. I had a US Robotics Sportster modem, connected to COM2 (ttyS1 in Linux parlance) which got installed fairly easily without any problems whatsoever. I connected a telephone line cable (RJ11) to the modem
What I wanted ?
  1. I wanted to set-up a dial-in server to which I can connect from my home PC and work from home. Why I wanted this thing on a dial-in server rather than making my servers available on the Internet is : since this becomes a Extranet Server, the threat to my systems and servers becomes minimal.
  2. Of course, this was also to further my knowledge on RedHat Linux9 Administration. 
What I did?

Here comes the details of the procedure that I followed in configuring the server for dial-in access.  I have strictly followed what is documented in
Ming Jiang's Page. Below is the step-by-step procedure for configuring the dial-in on a RedHat Linux 9:

1. Login to the server as root and run the command : setserial -a  /dev/ttyS1

2. For finding if there are any IRQ conflicts, vi / more / cat the file:  /proc/interrupts

3. Open the /etc/rc.d/rc.serial file and add the following line :  
       setserial   /dev/ttyS1    autoconfig    ^skip_test
       The general syntax of setserial command is : setserial device [parameters]
        autoconfig  must be specified in conjunction with the port parameter. When this parameter is supplied, setserial instructs the kernel to attempt to automatically determine the UART type located at the supplied port address. If the auto_irq parameter is also supplied, the kernel attempts to automatically determine the IRQ, too.
        skip_test  instructs the kernel not to bother performing the UART type test during auto-configuration. This is necessary when the UART is incorrectly detected by the kernel.
More details on setserial configuration are available here.

4. Next I installed mgetty from the rpm available in Disc 2 of Red Hat Linux 9.

5. Added the following line at the end of  /etc/inittab:
S1:2345:respawn:/sbin/mgetty ttyS1 /dev/ttyS1
. Do not know why this is being done. No further configurations are put here. All the options is configured in the main configuration file of mgetty: /etc/mgetty+sendfax/mgetty.config

6. In the mgetty.config file added the ffollowing lines:
    speed 230400
    modem-type data
    term vt100
    init-chat "" AT&F1M3
    port ttyS1 
    Remaining all lines I have left as it is.

7.
My aim is to set up the computer as an dialin login server. Because, my applications are based on Database as well as other activities like mail, web etc. So I need telnet, sqlplus etc. The setting is using the "standard" behavior:
The following entry is put in the login.config file.
*   -   -   /bin/login @

8. dialin.config : No changes done in this file, as I do nto have caller-id on my phone.

9. nologin.ttyS1 : Create this empty file only when you want to disable the login. You can move this file to this directory during barred times, and have it moved to some other directory when you want to login, using cron. This is an extremely useful arrangement.

10. Run  init   q  to reload the init. I however, restarted the server by issuing init 6 command to restart the server.

11. As a prerequisite, the Kernel should have support for PPP. For this check the following: Run  uname  -r. This would give you the Kernel version. Now run :
ls -l /lib/modules/<kernel version from uname -r>/kernel/drivers/net/ppp_*
This should show the following files:
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_async.o
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_deflate.o
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_generic.o
/lib/modules/2.4.2-2/kernel/drivers/net/ppp_synctty.o
Since I installed KPPD, I had all the above modules.

12. The Kernel IP Forwarding should be enabled. For this run echo "1"   > /proc/sys/net/ipv4/ip_forward
"0" indicates
IP forwarding is not turned on.


12a. chmod  u+s   /usr/sbin/pppd ( Change the permission of pppd to
-rwsr-xr-x)

14. Open the file /etc/ppp/options and add the followign lines:
asyncmap 0
crtscts
nodetach
deflate 15
debug
lock
login
modem
netmask 255.255.0.0
proxyarp
require-pap
refuse-chap



15. In my /etc/ppp/options.ttyS1, add the following lines:
#SERVER's IP: PEER's IP
180.18.1.233:180.18.7.1


16. In the file /
etc/ppp/pap-secrets add
Usernames, passwords and IP addresses for PAP authentication. Since we use the system password as specified by the login option for pppd, so it is
# client        server     secret                  IP addresses
*                   *              ""                              *

17. To combine mgetty and pppd add the following line in the
/etc/mgetty+sendfax/login.config
/AutoPPP/       -       a_ppp   /usr/sbin/pppd 

18. I am not giving the dialup procedure for connecting to this dial-in server from a windows client, as it is trivial. In case you want to connect from a Linux Client, check this page for details.


Gratitude:

http://ct.radiology.uiowa.edu/~jiangm/software-docs/ppp-dialin-server/ppp-dialin-server.html  to Ming Giang for making such a beautifula and compact documentation.

Google - The neverending source of all informatio on any thing that you want.