Using the reverse telnet function of the 7318, the 'cnsconnect' daemon can be used to provide a connection to a specific port on the 7318 and thereby access the device (printer or modem) attached to it. This document contains modules for the 7318 reverse telnet configuration and the 'cnsconnect' daemon configuration.
This document is designed to configure the 7318 and 'cnsconnect' only. This document does not cover the steps involved with adding a print queue or configuring modem applications like "ate" or "cu". Also, this document does not contain detailed explanations of the modules or steps used in the configuration methods.
Before using this document, it is assumed that:
To use this document effectively, you must:
In the 7318 configuration file, there are two sections that must be configured to enable reverse telnet (i.e. telnetting from the RS/6000 to a serial port on the 7318). The first is the "Port" stanza and its "Session" stanzas. The second section involves the "Telnetd" stanzas.
Where XX refers to the port number 00 through 15.
Sample Stanza looks like the following:
[Port00] mscreen=0 tprint=0
Remove the ; sign on the 'stty' line in the "Port" stanza and add "hupcl clocal" to this line.
Sample entry looks like the following:
stty=9600 hupcl clocal
Sample Session Stanza [Session0] looks like the following:
port=0 session=0 application=reserved device=LDTCOM[Session1] port=0 session=1 application=reserved device=LDTCOM
Sample Session Stanza [Session2] looks like the following:
port=0 session=2 application=reserved device=LDTCOM
Sample Session Stanza [Session3] looks like the following:
port=0 session=3 application=reserved device=LDTCOM
The 'stty' line should read "stty=opost onlcr tab3".
Sample Stanza [Session0] looks like the following:
port=0 session=0 application=reserved device=LDTCOM stty=opost onlcr tab3
Set the "ntelnetds" line to the total number of ports you are configuring for reverse telnet. Make sure that both the "[Telnetd]" and "ntelnetds" lines are uncommented.
Sample entry looks like the following:
For additional ports to be configured with reverse telnet, you will use additional [TelnetdXX] stanzas one for each physical port. (Where XX is incremented from 00 to 15 as more physical ports are configured for reverse telnet.)
This is the TCP port number to which this physical port will respond for telnet.
Sample Stanza [Telnetd00] looks like the following:
device=COM port=0 tcpPort=5101
The 'cnsconnect' configuration file is used to specify how the 'cnsconnect' daemon will connect with the physical port on the 7318, and whether it will be used for a printer or modem.
This is the TCP port number that was associated with the physical port number in the 7318 configuration file.
Sample entries look like the following:
/dev/printer1 184.108.40.206 5101 bin #For a printer /dev/modem1 220.127.116.11 5102 hupcl #For a modem
Now that we have made the necessary configuration changes, boot the 7318. The 7318 can be rebooted in two ways. Choose the most convenient method.
After approximately 20 seconds, the light sequence on the front of the 7318 should be either 1110 or 1101.If the sequence is (1 Flash 1 0) or (1 Flash 0 1), the 7318 has not completed the boot process successfully.
Once the 7318 has been rebooted, it should use the updated configuration file, and be ready for a reverse telnet to the configured port. To test the reverse telnet configuration follow the steps below.
Sample command and output look like the following:
$ tn 18.104.22.168 5101 Connected to 22.214.171.124
If the 7318 port is configured correctly, you should receive the "Connected" message from telnet, and the connection should NOT drop automatically. If the connection stays established, you can drop the connection yourself by pressing Ctrl-T (control-T).
If the connection is never established, or is dropped immediately, inspect the 7318s internal log by typing "show log" at an s20 command prompt. (from a terminal attached to one of the 7318s serial ports).
If the connection was successful, then proceed to the next section, Starting the 'cnsconnect' daemon.
The 'cnsconnect' daemon associates a special device file with a reverse telnet connection. Applications can then reference this device file and utilize the telnet connection to access the printer or modem on the 7318 serial port.
cnsconnect -c /usr/lib/cns/cnsconnect.cnf -l /tmp/cnsconn
netstat -an | grep 7318_ip_address
There should be a connection listed in the ESTABLISHED state. Once this is the case, you can begin using the special device file (i.e. /dev/printer1 or /dev/modem1) with your application.
cnsconnect:2:wait:/usr/lib/cns/cnsconnect -c \ /usr/lib/cns/cnsconnect.cnf > /dev/console 2>&1