Technical article 107695

OpenServer 5, How do I automate netconfig(ADM) to add an ethernet card on a TCP chain?

OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6

Written · Last revised

Problem

How do I automate netconfig(ADM) to add an ethernet card on a tcp chain?

Solution

This article is intended for replicated sites where there is a fixed number of network cards to be added on a single type system.

First, system requirements before invoking netconfig are:

1. Create a standard configuration for your network card. Each network card has different configuration settings, such as for the base IO address, IRQ, and so on.

Our intent is to build a standard configuration file using the same network card for many systems. Use the first system to run through the netconfig command, and select the appropriate choices for the settings of the network card.

Based on these settings, you can now use the file:

/var/opt/K/SCO/lli/5.0.4d/sysdb/net0

as your template for this particular card. You need to go through netconfig(ADM) for each different network card. For example, PCI, EISA, and ISA cards all have different types of selections in the configuration file.

Note: For PCI and EISA cards, the template only works if the network card is put in the same slot number for each system.

Once the template is created, you can copy the template to each system as /var/opt/K/SCO/lli/5.0.4d/sysdb/net0 for the first network card.

2. The next step is to provide the TCP setting for the system.  The
   following shell variables need to be set to a value.

These two variables must be set to "true" and "fresh":

IQM_FILE=/bin/true
IQM_INSTALL_TYPE="fresh"

The value for the following variables will be different for each system:

IQM_DOMAIN_NAME=SCO.COM
IQM_TCP_IPADDR=122.150.64.2
IQM_TCP_NETMASK=255.255.255.0
IQM_TCP_BROADCAST=122.150.64.255
export IQM_FILE IQM_INSTALL_TYPE IQM_DOMAIN_NAME
export IQM_TCP_IPADDR IQM_TCP_NETMASK IQM_TCP_BROADCAST

3. netconfig(ADM) now has enough information to run:

netconfig -a sco_tcp#net0

Here is a checklist before you relink the kernel:

# grep ifconfig /etc/tcp

Note: Make sure the ifconfig line contains the correct value for IP, netmask, and broadcast.

# more /etc/hosts

Note: It will add the IP and host's name in this file.

# cd /etc/conf/sdevice.d
# lf <nic_driver> net0

Note: It should have the network driver file and net0.

# netconfig -s

Note: It should contain sco_tcp#net0 as the last item.

4. Finally, relink the kernel and reboot the system.

# cd /etc/conf/cf.d
# ./link_unix -y
# init 6

The following shell script will provide a sample of adding sco_tcp chain with netX, where "X" is the number of the network cards on your system.

--------------- cut here for sample script ----------------------
:
# Filename : netcfg
# To add the network card manually using this script.
# This will only add sco_tcp chain to netX.
#
# Usage:
#    netcfg <network card> <bd#>
#    Ex: netcfg e3G 0
#
#  Location for sysdb is different between systems OSR 5.0.0 to 5.0.4
#  Also, check the correct version number
#
NIC=$1
BRD=$2
VER="5.0.4d"
SYSDB="/var/opt/K/SCO/lli/$VER/sysdb"           # For OSR 5.0.4 only
IQM_FILE=/bin/true
IQM_INSTALL_TYPE="fresh"
IQM_DOMAIN_NAME=SCO.COM
IQM_TCP_IPADDR=122.150.64.2
IQM_TCP_NETMASK=255.255.255.0
IQM_TCP_BROADCAST=122.150.64.255
export IQM_FILE IQM_INSTALL_TYPE IQM_DOMAIN_NAME
export IQM_TCP_IPADDR IQM_TCP_NETMASK IQM_TCP_BROADCAST
#----------------------------------------------------------------------------
#       Standard configuration of e3G network card.
# PCI_BUS, PCI_DEV are different depending on what slot you put in on your
# system.
#----------------------------------------------------------------------------
e3G_cfg () {
      echo "
PCI_BUS:
        SELECT=1
PCI_DEV:
        SELECT=2
PCI_FUNC:
        SELECT=0
ADAPTER:
        DESCRIPTION=3Com 3C595 Fast EtherLink PCI
        BUS=PCI
        AOF=e3G/AOF/e3G-pci
" > ${SYSDB}/net0
}
#----------------------------------------------------------------------------
#       Standard configuration of e3H network card.
# PCI_BUS, PCI_DEV are different depending on what slot you put in on your
# system.
#----------------------------------------------------------------------------
e3H_cfg () {
      echo "
PCI_BUS:
        SELECT=1
PCI_DEV:
        SELECT=2
PCI_FUNC:
        SELECT=0
ADAPTER:
        DESCRIPTION=3Com Fast EtherLink XL PCI (3C905)
        BUS=PCI
        AOF=e3H/AOF/e3H-pci
" > ${SYSDB}/net0
}
Add_card()
{
# Create a Standard Configured File for the NIC CARD
case "${NIC}" in
e3G) e3G_cfg ;;
e3H) e3H_cfg ;;
esac
# running netconfig with the appropriate netX value.
netconfig -a sco_tcp#net$BRD
# Must relink kernel and reboot system in order to take effect.
Relink
} # Add_card()
Remove_chain ()
{
netconfig -r sco_tcp#net0
}
Relink ()
{
cd /etc/conf/cf.d
./link_unix -y
}
# MAIN Main main
if [ "netconfig -s  | grep "sco_tcp#net${BRD}" ]
then
   echo "net${BRD} already exist in the system."
   echo "Do you wish to process? Proceed will remove your existing network"
   echo "and add the new one in."
   echo "Enter y/yes or n/no : (default: no) > "
   read yn
   case ${yn} in
   y|Y|yes|Yes|YES) Remove_chain ;;
   *) echo "Network card has not been add"
      exit 0 ;;
   esac
fi
Add_card
NOTE:    The above procedure fails under OpenServer 5.0.6a. The failure you
         will see is the ifconfig line /etc/tcp is not written correctly for
         the interface you have just added. The following modifications are
         required before this will work under OpenServer 5.0.6a. Please note
         that this problem has been corrected in releases after 5.0.6a.

To fix this problem two files must be modified:

/usr/lib/tcprt/sco_tcp/Init and /usr/lib/netconfig/init/sco_tcp

These files are identical and require the same modification.

On line 1450, there is an "if" statement that looks like this:

if [ "$DHCP" = "No" ]; then
Change it to this:

if [ "$DHCP" = "No" -o -z "$DHCP" ]; then

After making these modifications, you should experience the same behavior as in previous releases of OpenServer.

From the Xinuos technical article database, record 107695. Reproduced with permission. The original is at www.sco.com/ta/107695, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.