Using Increased Functionality

Setting up the turnkey system using either of the next two methods provides increased Telnet functionality, but does not maintain compatibility with other D3 platforms and releases. The following methods are the recommended methods for setting up a turnkey system.

Connecting to the Next Available D3 Port

Configuring Telnet in this manner sends the user directly to the D3 logon prompt. It does not display the Telnet login prompt.

  1. Create a copy of the /etc/xinetd.d/telnet file. For example:

cp /etc/xinetd.d/telnet /etc 

  1. Create an executable script to execute D3 and place the script in the /usr/bin directory.

This is a sample script. We will name it tnet for our example:

#!/bin/bash 

exec /usr/bin/d3 -dcdon

  1. Open the Telnet configuration file.

/etc/xinetd.d/telnet

  1. Add a reference to the script you created in the this configuration file.

NOTE

This instructs the Telnet configuration file to run the D3 program when connection is established and instructs the D3 logon to open immediately when a Telnet connection is requested.

For example, add this line under the server option line.

server_args = -L /usr/bin/tnet

Before the Telnet file is modified to add the script under the server_args option, the file looks like this:

{

flags           = REUSE

socket_type     = stream

wait            = no

user            = root

server          = /usr/sbin/in.telnetd

log_on_failure += USERID

disable         = no

}

After the Telnet file is modified to add the script under the server_args option, the file looks like this:

{

flags           = REUSE

socket_type     = stream

wait            = no

user            = root

server          = /usr/sbin/in.telnetd

server_args     = -L /usr/bin/tnet

log_on_failure += USERID

disable         = no

}

  1. Restart the xinetd daemon (so the modification you performed in step three will take effect) by typing this script:

/etc/rc.d/init.d/xinetd restart

Connecting to a Specific D3 PIB

Configuring Telnet in this manner bypasses a UNIX log in, providing a direct login to a D3 PIB.

  1. Create a permanent directory to hold both the following script and the symbolic links to that script.

This example creates the directory named d3net in the /usr/bin directory, and changes the permissions to read and execute for all users.

mkdir /usr/bin/d3net 

chmod a+rx /usr/bin/d3net

  1. Select a range of port numbers not currently in use on your system, and large enough for all your D3 PIBs.

This example uses PIBs 1 through 20. The port range is 16001 to 16020.

  1. Create a script to calculate the PIB from the port number and place it in the directory created in step 1.

The script executes d3 passing the result of the subtraction as the only argument on the command line. The following sample script does this.

For this example, assume the script name is netcon and the directory name is /usr/bin/d3net, the full path is /usr/bin/d3net/netcon. Enter:

#!/bin/bash 

PIB=$(basename $0) 

PIB=$(($PIB – 16000)) 

exec /usr/bin/d3 $PIB 

  1. Change the permissions to read and execute for all users.

chmod a+rx /usr/bin/d3net/netcon

  1. Create a symbolic link (ln –s) for each port in the range, using the port number as the name of the link, and the script you created as the source.

Remember, in our example the script name is netcon, and the port range is 16001 to 16020.

ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16001

ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16002

ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16003

ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16018

ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16019

ln –s /usr/bin/d3net/netcon /usr/bin/d3net/16020

When all the links are created, a long listing (ls –l) of the directory looks like:

total 50

lrwxrwxrwx 1 root root 6  Jan 14 18:47 16001 -> /usr/bin/d3net/netcon

lrwxrwxrwx 1 root root 6  Jan 14 18:47 16002 -> /usr/bin/d3net/netcon

lrwxrwxrwx 1 root root 6  Jan 14 18:47 16003 -> /usr/bin/d3net/netcon

lrwxrwxrwx 1 root root 6  Jan 14 18:47 16018 -> /usr/bin/d3net/netcon

lrwxrwxrwx 1 root root 6  Jan 14 18:47 16019 -> /usr/bin/d3net/netcon

lrwxrwxrwx 1 root root 6  Jan 14 18:47 16020 -> /usr/bin/d3net/netcon

-rwxr-xr-x 1 root root 72 Aug  7 14:03 netcon

To operate the nailed Telnet feature

For every file that is put into the /usr/bin/d3net directory, a corresponding file must be created in the /etc/xinetd.d directory. This assures proper operation of the Telnet feature.

Create a file in the /etc/xinetd.d directory, like the one shown below, for each of the ports that will be used for log in.

For Example:

service d316001

{

type            = UNLISTED

socket_type     = stream

protocol        = tcp

wait            = yes

server          = /usr/sbin/in.telnetd

server_args     = -L /usr/bin/d3net/16001

port            = 16001

}

In the example above, note that the:

After all of the files in your range of ports have been created, issue this command to restart the deamon.

/etc/rc.d/init.d/xinetd restart

See Also

Creating a Turnkey System

Turnkey Systems

Configuring Blocks of Telnet Ports on D3

Maintaining Compatibility

Changing inittab