Вы находитесь на странице: 1из 8

Module 3.

Configuring IP Connectivity UNIX Network Administration

Module 3.

Configuring IP Connectivity

Objectives:

After the completion of this module, the student is expected to:


Have an overview of TCP/IP Configuration
Verify LAN Card Configuration
Describe the Network Startup Files
Configure IP Connectivity
Configure IP Multiplexing
Configure the /etc/hosts file

3-1
Module 3. Configuring IP Connectivity UNIX Network Administration

Module 3-1. TCP/IP Configuration Overview

These are the steps that you should take to set up a system for communication with a network:

Obtain an IP address and hostname from the IT department or ISP


Physically install the LAN card
Install the appropriate LAN software
Verify if the new card was successfully configured
Configure Link Layer connectivity
Configure IP connectivity
Configure IP multiplexing (optional)

Your organization must maintain an up-to-date network map and Information table to record which IP
address and hostname was used by which host. This method simplifies the troubleshooting of your
network. The Information table should contain the following about each host:

Manufacturer
Model number
OS type and version
LAN card type
IP address and Hostname
MAC address
Administrator name

3-2
Module 3. Configuring IP Connectivity UNIX Network Administration

Module 3-2. Installing LAN Software

The first step in configuring a network connection is to physically install a LAN card to your
system. Check your UNIX manual if your LAN card is supported.

In order to use your LAN card properly, you need to install the proper Networking software on
your system. The networking software is bundled with every UNIX OS and is probably already installed
on your system since the default installation. To verify if the software is installed, use:

# swlist l product Networking

If the software is not yet installed, then use the following command to install the product:

# swinstall (follow the menu that follows)

3-3
Module 3. Configuring IP Connectivity UNIX Network Administration

Module 3-3. Verifying LAN Card Configuration

Assuming that the LAN card and the networking software was properly installed on the system,
the UNIX system should now be able to recognize the LAN card once the machine is booted up. To verify
if the LAN card was properly configured, use the following command:

# ioscan funC lan

Check the ioscan output and verify the following:

If the card appears in the output


If the cards S/W state is CLAIMED
If it has the proper device files

Diagnostic Device Files

Diagnostic device files are required by the LAN diagnostic tools linkloop and lanadmin. These
are called DLPIs or Data Link Provider Interface. These are used for network troubleshooting. To verify
for the diagnostic device files, use the ls l or ll command:

# ls l /dev/dlpi/*

If your diagnostic device files for the LAN card are missing, then you should recreate them using
the command:

# cd /dev
# insf d dlpi -e

3-4
Module 3. Configuring IP Connectivity UNIX Network Administration

Module 3-4. Network Startup Files

During the system startup process, the /sbin/rc program starts up several scripts in the
/sbin/init.d directory. These scripts read configuration parameters from the configuration files found in the
/etc/rc.config.d directory, and initialize the network connection.

Note that you should never modify the scripts in /sbin/init.d. Startup script configurable
parameters should only be modified via the configuration file in the /etc/rc.config.d.

3-5
Module 3. Configuring IP Connectivity UNIX Network Administration

Module 3-5. Configuring IP Connectivity

The /etc/rc.config.d/netconf file is the primary TCP/IP configuration file for the HP-UX system.
This is read by several startup scripts that configure everything from the system host name to the
dynamic routing protocol.

The first lines of the netconf file would look like the following:

HOSTNAME=mailsrvr
OPERATING_SYSTEM=HP-UX
The HOSTNAME parameter must be changed to change your systems hostname. Never modify
LOOPBACK_ADDRESS=127.0.0.1
the other two parameters.

The following blocks of lines found in the netconf file are:

INTERFACE_NAME[0]=lan0
# Use the name shown in lanscan

IP_ADDRESS[0]=192.168.250.1
# Set the IP address using this parameter

SUBNET_MASK[0]=255.255.255.0
# The IPs Netmask in decimal format

BROADCAST_ADDRESS[0]=192.168.250.255
# The IPs broadcast address

INTERFACE_STATE[0]=up
# Bring card up at boot time

DHCP_ENABLEP[0]=0
# If 1, the IP address would be assigned by a DHCP Server

The ifconfig command is used to configure, or to check the configuration values of the
network interface card. You can use ifconfig to assign the network interface an IP address, netmask,
broadcast address, or change some of its parameters. To set the IP address form the command line, use
the following command:

# ifconfig lan0 192.168.250.1 netmask 255.255.255.0 up

If you are using Linux, we need to use the eth# lan card device file. The command that you need
to use is:

# ifconfig eth0 192.168.250.1 netmask 255.255.255.0 up

Note that when you configure the IP address from the command line, the IP address will be reset
once you reboot the computer. If you want the IP address to be set every time the system boots, then you
should edit the /etc/rc.config.d/netconf file and add the lines above.

3-6
Module 3. Configuring IP Connectivity UNIX Network Administration

Module 3-6. Configuring IP Multiplexing

IP Multiplexing makes it possible to assign multiple IP addresses to a single physical interface


card. To do this, we modify the /etc/rc.config.d/netconf file. Note that we only need to add some lines in
the file. The following are modifications that you should make.

INTERFACE_NAME[0]=lan0:0
IP_ADDRESS[0]=192.168.150.1
SUBNET_MASK[0]=255.255.255.0

INTERFACE_NAME[1]=lan0:1
IP_ADDRESS[1]=192.168.200.1
SUBNET_MASK[1]=255.255.255.0

INTERFACE_NAME[2]=lan0:2
IP_ADDRESS[2]=192.168.250.1
SUBNET_MASK[2]=255.255.255.0

After creating such modification, activate the other IP addresses by rebooting the system or by
using the following commands:

# /sbin/init.d/net start
# ifconfig lan0:0 192.168.150.1 netmask 255.255.255.0 up
# ifconfig lan0:1 192.168.200.1 netmask 255.255.255.0 up
# ifconfig lan0:2 192.168.250.1 netmask 255.255.255.0 up

For Linux users, be sure to use the following commands:

# /sbin/init.d/net start
# ifconfig eth0:0 192.168.150.1 netmask 255.255.255.0 up
# ifconfig eth0:1 192.168.200.1 netmask 255.255.255.0 up
# ifconfig eth0:2 192.168.250.1 netmask 255.255.255.0 up

3-7
Module 3. Configuring IP Connectivity UNIX Network Administration

Module 3-7. Configuring the /etc/hosts File

The /etc/hosts file is one of the mechanisms used by hosts to resolve hostnames to IP
addresses. Each /etc/hosts file entry should have an IP address and an associated hostname. Each entry
must also contain one or more aliases, and an optional comment preceded by a # sign.

At a minimum, the /etc/hosts file should contain entries for:

Each IP address listed in the /etc/rc.config.d/netconf


The 127.0.0.1 loopback address

Additional entries may be added using the vi, or any other text editor.

Fields can have any number of blanks or tabs separating them


There should only be one host entry per line
Do not include leading zeroes in IP addresses
Do not delete the localhost/loopback line

3-8

Вам также может понравиться