
CN2510
Setting Up Multi-host TTY
9-7
Setting up Hosts
Installing and Compiling Moxatty
Installing and Compiling
1.
Create a directory for Moxatty (e.g. /user/etc/moxatty) as shown below:
#mkdir /usr/etc/moxatty
#cd /usr/etc/moxatty
2.
Extract code from the tar-formatted file
moxatty.tar
as follows:
#tar xvf moxatty.tar
3.
After the extraction is complete, locate the following files:
moxattyd.c
program source code
moxattyd.cf
configuration file
README
description file for moxatty
4.
Compile and link documents:
SCO UNIX :
cc -O -o moxattyd moxattyd.c –lsocket
LINUX
:
cc -O -o moxattyd moxattyd.c
AIX
:
cc -O -o -DAIX moxattyd moxattyd.c
Configuring tty Redirection
The following example illustrates how to map and redirect a tty device to a MOXA CN2510 serial port. Use
vi
or
any other text editor to add or modify entries in the file
moxattyd.cf
. There are three columns:
Device
Name
,
CN2510 IP address
, and
TCP port number
in the entry for the file
moxattyd.cf
.
Device Name
CN2510 IP address
TCP Port number
ttyp1
192.168.1.1
4001
ttyp2
192.168.1.1
4002
ttyp3
192.168.1.1
4003
ttyp4
192.168.1.1
4004
NOTE
1.
Device Names for SCO Unix are ttyp0, ttyp1, ttyp2.
2.
Device Names for Linux are tty[pqrs][0-9,a-f].
3.
Device Names for AIX are tty p[0-9,a-f].
4.
Default TCP port numbers are from 4001 to 4016 for the 16-port CN2510. If necessary, you can customize
the TCP port numbers. However, the numbers you use MUST be the same as those defined in MOXA
CN2510.