This section describes step-by-step how to set up a dial-in server using mgetty and pppd applications.
The dial-in server is built using the mgetty and pppd utilities. mgetty is responsible for TTY interface initialization and call answering. pppd provides a method for transmitting datagrams over point-to-point links and is responsible for link control, authentication, and for network protocol configuration.
The Dialogic® Diva® TTY interface is set in auto-detection mode. In this mode, the TTY driver will detect the type of the used protocol and PPP framing and will convert it to ASYNC PPP. This allows the calls to be served by pppd in the same way.
To set up a "ppp" dial-in server, proceed as described below:
Make sure that the mgetty+sendfax package is installed on your system.
Change the context of the /etc/mgetty+sendfax/mgetty.config file as follows:
# set the global debug level to "4" (default from policy.h)
#debug 9
# access the modem(s) with 38400 bps
speed 38400
# This is 33600 only
#init-chat "" AT&F14;S0=0;E0;\\V1#CID=1;+ms=v34,1 OK
init-chat "" AT&F14+IF5+IM4;S0=0;E0;\\V1#CID=1 OK
data-only y
blocking no
toggle-dtr no
modem-type data
modem-check-time 0
autobauding no
answer-chat-timeout 180
Change the context of the /etc/mgetty+sendfax/login.config file as follows:
# Automatic PPP startup on reception of LCP configuration request (AutoPPP).
# mgetty has to be compiled with "-DAUTO_PPP" for this to work.
/AutoPPP/ - a_ppp /usr/sbin/pppd modem
#
# Disable login sessions
#
* - - /bin/false @
Add the following lines to the /etc/inittab file, one for every Diva TTY interface that you plan to use for your dial-in server.
SXX:2345:respawn:/usr/sbin/mgetty ttydsXX
"XX" is the Dialogic® Diva® TTY device number (01, 02, etc.). For example, if one Dialogic® Diva® BRI Media Board with 2 channels is installed in the system, you should add two entries:
S01:2345:respawn:/usr/sbin/mgetty ttyds01 S02:2345:respawn:/usr/sbin/mgetty ttyds02
Make sure that the ppp package is installed on your system.
Change the context of the /etc/ppp/options file as follows:
#
# Common options for TTY interfaces
#
lock
#
# Debug
#
#debug 9
#kdebug 9
#
modem
noipx
noccp
nodeflate
nobsdcomp
asyncmap 00000000
lcp-echo-interval 10
lcp-echo-failure 5
#
# Set the local system name
#
user roadrunner
#
# Provide address of your DNS server
#
ms-dns 192.168.212.130
nodefaultroute
proxyarp
netmask 255.255.255.255
auth
#
# Two following lines will disable CHAP and allow PAP
#
#require-pap
#refuse-chap
#
# The following option disables the identification via "clear text"
# user name and password transmission and
# enable CHAP and derivates
#
refuse-pap
+chap
+chapms
+chapms-v2
#
# Allows to set idle link timeout
#
#idle 900
In case you plan to use the PAP authentication protocol, create the file /etc/ppp/pap-secrets:
# Secrets for authentication using PAP
# client server secret IP addresses
test1 * pwdtest1 *
test2 * pwdtest2 *
In case you plan to use the CHAP authentication protocol, create the file /etc/ppp/chap-secrets:
# Secrets for authentication using CHAP
# client server secret IP addresses
test1 * pwdtest1 *
test2 * pwdtest2 *
Create for every ttydsxx interface that you use for the dial-in server (i.e. where mgetty was started) one /etc/ppp/options.ttydsxx file that contains the IP addresses for local and remote ends of the PPP link. In this example, the configuration file /etc/ppp/options.ttyds01 contains:
#
# Options that differ for every TTY interface (i.e. IP address)
#
# LOCAL IP:REMOTE_IP 192.168.212.240:192.168.212.241
Optionally, you can use dynamic IP address assignment. Please refer to "pppd" documentation for details.
If you plan to allow access from the router to your network, it is necessary to allow IP forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward
Execute "kill -HUP 1" to start mgetty processes (this command will inform "init" process about changes in the /etc/inittab file).
Now, the dial-in server is running. You can use name/password pairs "test1/pwdtest1" and "test2/pwdtest2" and CHAP/MS- CHAP protocol to gain access to the system.