Basic network configration

  1. sandipm14
    Basic network configration

    Networking software is a standard part of the Unix kernel. Although configuration specifics vary from vendor to vendor there is a level of continuity across platforms. In addition many vendors provide graphic tools for configuring most network software. On HP systems SAM can be used. The Solaris 2.5 CDE (Common Desktop Environment) provides a tool that looks very much like SAM. SGI provides network setup tools under the System Manager menu. Even with these tools it is important to understand which files are involved so they may be edited by hand if the need arises.

    In order to configure network software the system administrator must have the following information:

    The full name of the machine
    The IP address of the machine
    The subnet mask if the network uses subnets
    The broadcast address
    The default router for the machine
    The loopback port address
    The IP address of at least one name server if BIND is used
    The machine name is a matter of choice. The only real stipulation is that it be unique on whatever subnet and/or network it is on. At IU, IP addresses are distributed by the Network Operations Center (NOC). The NOC can be contacted at 855-3699, An IP address consists of four octets separated by periods, such as Each octete designates either a network address or a host address on that network. Which octets are used to designate the network and host address depends on the network class. There are three network classes; A, B, and C. IU is a class C network that uses class B type addresses. The first two octets, 129.79, designate the IU network. They are common to almost all machines on the IU campus. At IU third octet is used to designate the subnet. The fourth octet is the host number and it is unique to each machine. The subnetmask defines which bytes of the IP address represent the subnet and the host. If no number is specified a default value is set according to the class of network that the machine is on. The subnetmask is conventionally given in hexadecimal. The IU subnetmask is 0xffffff00, or The first two characters are not part of the number. They indicate that what follows is a hexadecimal number.

    For further recommended information on network addressing see Article No. 001.

    An Ethernet network is type of broadcast network. In a broadcast network any system can send information and all systems receive every message, although they discard messages that are not addressed to them. Broadcasting is accomplished via the broadcast address. This is the address to use for reaching all other addresses on a network. Any address with the host octet set to all 1's, or 255, is by default interpreted as a broadcast address. So the broadcast address is the address of the subnet, plus 255. If a hosts IP address is, it's subnet address is 129.79.149 and it's broadcast address would be

    A router is a dedicated computer with at least two Ethernet interfaces. It decodes and passes network layer packets between different networks. Routing can be done statically, dynamically or with a combination of the two. Generally only very small networks use completely static routing. Dynamic routing is done via the routed daemon which communicates with other routed programs to learn how to reach another machines on the network. The default router IP address at IU is the address of the subnet plus 254, or occasionally 174. If a machines IP address is then the default router is

    Frequently the terms 'router' and 'gateway' are used interchangeably. This can be deceiving as they are not necessarily the same thing. In a broad sense, both have to do with how packets of data find their way between networks, or between a subnet and a larger network. A gateway is a computer with at least two Ethernet interfaces, each on a different network. The gateway acts as a bridge between the two networks. Incoming data packets are simply passed on to the next network. A router also has multiple Ethernet interfaces. It looks at incoming data a packets and forwards them to the appropriate places.

    The loopback port is a reserved network interface that a machines uses to facilitate interprocess communication. It allows the machine to send packet to itself for testing purposes. The ifconfig command uses this address for configuration and testing. Every machine that uses TCP/IP has as it's loopback address.

    BIND, the Berkeley Internet Name Domain, is a method of implementing Domain Name Service (DNS). DNS maps host names to IP addresses. Without it any command which uses the network and all host table lookup routines must get this mapping information from a local /etc/hosts file. This requires maintaining a master file that includes every machine on the network. While this is a functional solution for small networks it doesn't work well for large ones. The use of name servers and BIND eliminates the need for a single master file.

    IU has several name severs. The current IP addresses for these machines are,, and This information changes frequently so it is best to check the UCS Knowledge Base for the most up to date information. When BIND is used the /etc/hosts file is used to list the loopback address as well as the name and IP address of the machine. The contents of /etc/hosts look like: localhost

    This file should be owned by root and have permissions set to 0444 or -r--r--r--.

    If a workstation is going to be a client of BIND an /etc/resolv.conf file must be created. This file defines the default domain search list used by gethostbyname and gethostbyaddr library routines. Please note, these man pages came from a Sun machine and may differ slightly from those found on other workstations.

    An /etc/resolv.conf file is set up as follows:

    search .
    nameserver #iugate.ucs.indiana.edU

    The search line is used to tell gethostbyname and gethostbyaddr what order host resolution services are to be used in. Host resolution should begin in whatever subnet the machine is on and move outward to the domain as a whole. This line is not needed for SunOS machines. The '.' at the end of the search line is optional and pertains only to machines at IU. It allows non-fully qualified domain names to be resolved and is leftover from an older DNS system.

    By default gethostbyname and gethostbyaddr are configured to access name information in the following order; NIS, BIND, local. local refers to the local /etc/hosts file.

    On SGIs an additional line is added to /etc/resolv.conf between the domain and search lines:

    hostresorder local bind
    This line is used to change the order in which name information is accessed. There are three possible options; local for local files, bind,and dns.

    On HP and SunOS 5.0 (Solaris) information on name service switch is also kept in another file, /etc/nsswitch.conf . This file is used to specify which name service to use and in what order. More than one option can be listed. Examples of /etc/nsswitch.conf files can be found below.

    For an HP using DNS:

    hosts: dns

    For Solaris 2.5 using primarily local files:

    passwd: files
    group: files
    hosts: files dns
    networks: files
    protocols: files
    rpc: files
    ethers: files
    netmasks: files
    bootparams: files
    publickey: files

    A default /etc/nsswitch file is created during the installation of the operating system. On HPs the default name service order is dns, nis, local. SunOS 5.0 creates a default nsswitch.conf as well as nsswitch.files, nsswitch.nis and nsswitch.nisplus. The idea is that the contents of nsswitch.files, nsswitch.nis or nsswitch.nisplus can be copied into nsswitch.conf according to what the primary name service is.

    The nameserver lines are used to specify the IP address of the local DNS name servers. Up to three may be listed. Listing more than one can be helpful if the primary name server goes down.

    Unix workstations have at least one Ethernet device, also referred to as an interface device or just an interface. In terms of networking the IP address is actually the address of the interface. If a single machine uses more than one interface each interface is given its own IP address and name. Workstations all come with pre designated primary Ethernet interface. On SGI this interface is ec0, on HP it is lan0 and on Suns it is le0. Unless the workstation is intended for some special purpose, such as routing, only the primary interface will need to be accounted for when configuring network software.

    On an SGI, HP or Sun system running Solaris most of the network configuration is done during the installation of the operating system. Linux varies from distribution to distribution in terms of when networking is configured. Even if an initial configuration is set up during the installation the /etc/resolv.conf file needs to be created if using name servers or BIND. On HP and Solaris systems the /etc/nsswitch.conf file also needs to be edited. Both these task must be done manually.

    Unix uses the ifconfig command to configure network interfaces. ifconfig is used to disable or enable network interfaces, as well as setting the IP address, subnet mask. and broadcast address. It is conventionally run at boot time, but can be run from the command line to make changes. The syntax for ifconfig is as follows:
    ifconfig interface [family] address up options

Results 1 to 1 of 1