Configuring Networking and LAN Adapters


We'll cover several topics in this section. First we'll identify the LAN cards in our system. Next we'll use set_parms to configure the first LAN card and view all of the configuration files that were update. Then we'll manually configure the second LAN card.

Identify LAN Cards in System

The first step to take when configuring networking is to identify the networking cards in your HP 9000. You can have multiple LAN cards in a system and configure multiple IP addresses on the same LAN card if you wish. The following ioscan listing shows three LAN cards in a server:

[View full width]
 
[View full width]
# ioscan -funC lan Class I H/W Path Driver S/W State H/W Type Description ======================================================================== lan 0 0/0/0/0 btlan CLAIMED INTERFACE HP PCI 10/100Base-TX Core /dev/diag/lan0 /dev/ether0 /dev/lan0 lan 1 0/4/0/0/6/0 btlan CLAIMED INTERFACE HP A5838A PCI 100Base-TX/SCSI graphics/ccc.gif COMBO /dev/diag/lan1 /dev/ether1 /dev/lan1 lan 2 0/4/0/0/7/0 btlan CLAIMED INTERFACE HP A5838A PCI 100Base-TX/SCSI graphics/ccc.gif COMBO /dev/diag/lan2 /dev/ether2 /dev/lan2 #

This output shows a LAN interface on the Core I/O card at hardware path 0/0/0/0 , and two cards that are a combination SCSI and LAN card at hardware paths 0/4/0/0/6/0 and 0/4/0/0/7/0 . These three interfaces are lan0, lan1 , and lan3 . All of these cards use the btlan driver. We can confirm that the btlan driver and other LAN drivers have been configured into the kernel for LAN interfaces with the lsdev command as shown in the following listing:

 #  lsdev -C lan  Character     Block       Driver          Class        14          -1         btlan           lan        15          -1         maclan          lan        45          -1         fcT1_cntl       lan        50          -1         fddi4           lan # 

These drivers are listed by class ( -C ) option for the currently running kernel. Note that btlan is used for the driver of lan0-2 in the earlier ioscan listing.

Use set_parms to Configure First LAN Interface

In this section we'll configure the first LAN card, lan0 , immediately after HP-UX 11i has been loaded and the system reboots. The dialogue that takes place in the upcoming example is similar to what you'd see if you were to run set_parms initial to initially configure a LAN card. I'll skip over some of the dialogue such as setting the date and time and provide only the LAN- related information:

 _______________________________________________________________________________                        Welcome to HP-UX! Before using your system, you will need to answer a few questions. The first question is whether you plan to use this system on a network. Answer "yes" if you have connected the system to a network and are ready to link with a network. Answer "no" if you:      * Plan to set up this system as a standalone (no networking).      * Want to use the system now as a standalone and connect to a        network later. _______________________________________________________________________________ Are you ready to link this system to a network? Press [y] for yes or [n] for no, then press [Enter]  y  _______________________________________________________________________________ If your network contains a DHCP (Dynamic Host Configuration Protocol) server, you may want to use the DHCP server to supply your networking setup information. It is best to answer "Yes" to the following question only if you're sure that DHCP service is available. _______________________________________________________________________________ Do you wish to use DHCP to obtain networking information? Press [y] for yes or [n] for no, then press [Enter]  n  _______________________________________________________________________________    Before you begin using this system, you need to obtain the    following information from your local network administrator:       * Your system name (host name).       * Your Internet Protocol (IP) address.       * Your time zone.     If you do not have this information, you may stop now and restart     your system once you have it. _______________________________________________________________________________                    .                    .                    . Enter the system name, then press [Enter].  Just pressing [Enter] will keep the (not recommended) name "unknown":  asodevlab1  The hostname (or first component of the hostname) "asodevlab1" contains more than 8 characters.  This is valid, but the system name as reported by `uname' will be truncated to "asodevla". Press [Enter] to continue... You have chosen asodevlab1 as the name for this system. Is this correct? Press [y] for yes or [n] for no, then press [Enter]  y  _______________________________________________________________________________                    .                    .                    . _______________________________________________________________________________   Before setting an IP address or using DHCP, please choose which   network interface card to use from the list below.  The card should   now be physically connected to the network.  Other network interfaces   may be configured using SAM after the system has booted.  A * indicates   the lan that was used for installing HP-UX, if known.     Interface   Hardware     Name        Path             Type     ---------------------------------     lan0        0/0/0/0          HP PCI 10/100Base-TX Core     lan1        0/4/0/0/6/0      HP A5838A PCI 100Base-TX/SCSI COMBO     lan2        0/4/0/0/7/0      HP A5838A PCI 100Base-TX/SCSI COMBO _______________________________________________________________________________  Enter the name of the lan interface you would like to configure followed by    [Enter] or just press [Enter] to select the default interface (lan0):  lan0  You have chosen lan0 as the lan interface to configure. Is this correct? Press [y] for yes or [n] for no, then press [Enter]  y  _______________________________________________________________________________ Enter your IP address, then press [Enter] or just press [Enter] to select the default address (127.0.0.1):  15.32.162.130  You have chosen 15.32.162.130 as the IP address for this system. Is this correct? Press [y] for yes, [n] for no or [c] to cancel then press [Enter]  y  _______________________________________________________________________________                    .                    .                    . The subnetwork mask shown above is the system default value and possibly should be changed.  Enter the new subnetwork mask, then press [Enter] or just press [Enter] to use the default value above: 255.255.248.0                    .                    .                    . _______________________________________________________________________________ Enter the gateway address, then press [Enter] or just press [Enter] to select the current gateway address (15.32.162.130):  15.32.160.1  _______________________________________________________________________________   Additional Network Parameters: Subnetwork Mask and Default Gateway   Enter the subnetwork mask and default gateway information.   Example:       Subnetwork mask:    255.255.255.0       Gateway IP address: 15.32.162.1   Current Settings:       Subnetwork mask:    255.255.248.0       Gateway IP address: 15.32.160.1 _______________________________________________________________________________ Are the parameters above correct? Press [y] for yes, [n] for no or [c] to cancel then press [Enter]  y  _______________________________________________________________________________ Note: Your system appears to have 3 network interfaces installed. This procedure only configures the default network interface. Use SAM to configure additional network interface cards. _______________________________________________________________________________ Press [Enter] to continue...                    .                    .                    . # 

We entered a lot of information during this initial setup that is similar to using set_parms . We did not us DHCP but instead, entered hostname, IP address, subnet mask, default gateway , and others.

You can run set_parms_initial to modify this information at any time. Let's look at some of the files that were updated and run some commands to see that networking-related updates were made. The first file we'll view is /etc/rc.config.d/ netconf :

 # cat /etc/rc.config.d/netconf # netconf:  configuration values for core networking subsystems # # @(#)B.11.11_LR $Revision: 1.6.119.6 $ $Date: 97/09/10 15:56:01 $ # # HOSTNAME:           Name of your system for uname -S and hostname # # OPERATING_SYSTEM:   Name of operating system returned by uname -s #                     ---- DO NOT CHANGE THIS VALUE ---- # # LOOPBACK_ADDRESS:   Loopback address #                     ---- DO NOT CHANGE THIS VALUE ---- # # IMPORTANT:  for 9.x-to-10.0 transition, do not put blank lines between # the next set of statements HOSTNAME="asodevlab1" OPERATING_SYSTEM=HP-UX LOOPBACK_ADDRESS=127.0.0.1 # Internet configuration parameters.  See ifconfig(1m), autopush(1m) # # INTERFACE_NAME:     Network interface name (see lanscan(1m)) # # IP_ADDRESS:         Hostname (in /etc/hosts) or IP address in decimal-dot #                     notation (e.g., 192.1.2.3) # # SUBNET_MASK:        Subnetwork mask in decimal-dot notation, if different #                     from default # # BROADCAST_ADDRESS:  Broadcast address in decimal-dot notation, if #                     different from default # # INTERFACE_STATE:    Desired interface state at boot time. #                     either up or down, default is up. # # DHCP_ENABLE         Determines whether or not DHCP client functionality #                     will be enabled on the network interface (see #                     auto_parms(1M), dhcpclient(1M)). DHCP clients get #                     their IP address assignments from DHCP servers. #                     1 enables DHCP client functionality; 0 disables it. # # For each additional network interfaces, add a set of variable assignments # like the ones below, changing the index to "[1]", "[2]" et cetera. # # IMPORTANT:  for 9.x-to-10.0 transition, do not put blank lines between # the next set of statements INTERFACE_NAME[0]=lan0 IP_ADDRESS[0]=15.32.162.130 SUBNET_MASK[0]=255.255.248.0 BROADCAST_ADDRESS[0]="" INTERFACE_STATE[0]="" DHCP_ENABLE[0]=0 # Internet routing configuration.  See route(1m), routing(7) # # ROUTE_DESTINATION:  Destination hostname (in /etc/hosts) or host or network #                     IP address in decimal-dot notation, preceded by the word #                     "host" or "net"; or simply the word "default". # # ROUTE_MASK:         Subnetwork mask in decimal-dot notation, or C language #                     hexadecimal notation.  This is an optional field. #                     A IP address, subnet mask pair uniquely identifies #                     a subnet to be reached. If a subnet mask is not given, #                     then the system will assign the longest subnet mask #                     of the configured network interfaces to this route. #                     If there is no matching subnet mask, then the system #                     will assign the default network mask as the route's #                     subnet mask. # # ROUTE_GATEWAY:      Gateway hostname (in /etc/hosts) or IP address in #                     decimal-dot notation.  If local interface, must use the #                     same form as used for IP_ADDRESS above (hostname or #                     decimal-dot notation). If loopback interface, i.e., #             127.0.0.1, the ROUTE_COUNT must be set to zero. # # ROUTE_COUNT:        An integer that indicates whether the gateway is a #                     remote interface (one) or the local interface (zero) #             or loopback interface (e.g., 127.*). # # ROUTE_ARGS:         Route command arguments and options.  This variable #                     may contain a combination of the following arguments: #                     "-f", "-n" and "-p pmtu". # # For each additional route, add a set of variable assignments like the ones # below, changing the index to "[1]", "[2]" et cetera. # # IMPORTANT:  for 9.x-to-10.0 transition, do not put blank lines between # the next set of statements # ROUTE_DESTINATION[0]=default # ROUTE_MASK[0]="" # ROUTE_GATEWAY[0]="" # ROUTE_COUNT[0]="" # ROUTE_ARGS[0]="" # Dynamic routing daemon configuration.  See gated(1m) # # GATED:        Set to 1 to start gated daemon. # GATED_ARGS:   Arguments to the gated daemon. GATED=0 GATED_ARGS="" # # Router Discover Protocol daemon configuration.  See rdpd(1m) # # RDPD:         Set to 1 to start rdpd daemon # RDPD=0 # # Reverse ARP daemon configuration.  See rarpd(1m) # # RARP:         Set to 1 to start rarpd daemon # RARP=0 # The NODENAME variable (limited to 8 chars) will be used to set the # UUCP name (uname -S), since HOSTNAME is longer than 8 chars. NODENAME=asodevla ROUTE_GATEWAY[0]=15.32.160.1 ROUTE_COUNT[0]=1 ROUTE_DESTINATION[0]=default # 

All information related to lan0 that we entered initially is present in this file. Note that variables related to lan0 use a [0], which is significant in the next section when we manually add to this file information related to lan1 and use [1] .

The /etc/hosts file (see the /etc/hosts overview later in this chapter) was also automatically updated to include the hostname and address we entered earlier. This file should be updated to include systems to which you'll connect as you'll see in the next section. The following is the /etc/hosts file for our system:

 # cat /etc/hosts # @(#)B.11.11_LRhosts $Revision: 1.9.214.1 $ # The form for each entry is: # <internet address>    <official hostname> <aliases> # # For example: # 192.1.2.34    hpfcrm  loghost # # See the hosts(4) manual page for more information. # Note: The entries cannot be preceded by a space. #   The format described in this file is the correct format. #       The original Berkeley manual page contains an error in #   the format description. # 15.32.162.130   asodevlab1 127.0.0.1   localhost   loopback # 

The hostname of asodevlab1 appears in /etc/hosts .

Let's now run form 2 of the ifconfig command to view parameters related to lan0 :

 #  ifconfig lan0  lan0: flags=843<UP,BROADCAST,RUNNING,MULTICAST>     inet 15.32.162.130 netmask fffff800 broadcast 15.32.167.255 # 

This ifconfig output shows the IP address we entered for lan0 of 15.32.162.130 , and the subnet mask we entered, in hex form, of 255.255.248.0 . The interface is UP so it is operational.

We have not confirmed that the default gateway we specified. The following netstat -rn command is used to show r outing in n umber format for lan0 :

 #  netstat -rn  Routing tables Destination           Gateway            Flags   Refs Interface  Pmtu 15.32.162.130         15.32.162.130       UH       0  lan0       4136 127.0.0.1             127.0.0.1           UH       0  lo0        4136 15.32.160.0           15.32.162.130       U        2  lan0       1500 127.0.0.0             127.0.0.1           U        0  lo0           0 default               15.32.160.1         UG       0  lan0          0 # 

The default route we specified of 15.32.160.1 is shown in the last line of this output. Any IP addresses to which we connect that are not on our subnet will use this default route.

The gateway we had specified as the default route in the netconf file of 15.32.160.1 is shown as the default gateway in this netstat output. Routes can be added and deleted with the route command (see the route overview later in this chapter.)

Using set_parms , set up a lot of host and networking-related information for us. In the next section we'll manually expand these files to include information related to the second networking interface.

Manually Configure Second LAN Interface

In the previous section we used set_parms to setup the first LAN card in our system, as well has hostname and other parameters, and in this section we'll perform the same work manually for the second LAN card.

The information we added to netconf includes the IP address, subnet mask, broadcast address, gateway, and all information related to lan0. [0] identifies entries made in the file for lan0 .

The first step we'll take is to expand /etc/rc.config.d/netconf to include variable information for our second LAN card. We'll add the following block of information to netconf :

 INTERFACE_NAME[1]=lan1 IP_ADDRESS[1]=15.32.162.131 SUBNET_MASK[1]=255.255.248.0 BROADCAST_ADDRESS[1]="" INTERFACE_STATE[1]="" DHCP_ENABLE[1]=0 

The following is a full listing of netconf with our lan1 block of information included:

 # netconf:  configuration values for core networking subsystems # # @(#)B.11.11_LR $Revision: 1.6.119.6 $ $Date: 97/09/10 15:56:01 $ # # HOSTNAME:           Name of your system for uname -S and hostname # # OPERATING_SYSTEM:   Name of operating system returned by uname -s #                     ---- DO NOT CHANGE THIS VALUE ---- # # LOOPBACK_ADDRESS:   Loopback address #                     ---- DO NOT CHANGE THIS VALUE ---- # # IMPORTANT:  for 9.x-to-10.0 transition, do not put blank lines between # the next set of statements HOSTNAME="asodevlab1" OPERATING_SYSTEM=HP-UX LOOPBACK_ADDRESS=127.0.0.1 # Internet configuration parameters.  See ifconfig(1m), autopush(1m) # # INTERFACE_NAME:     Network interface name (see lanscan(1m)) # # IP_ADDRESS:         Hostname (in /etc/hosts) or IP address in decimal-dot #                     notation (e.g., 192.1.2.3) # # SUBNET_MASK:        Subnetwork mask in decimal-dot notation, if different #                     from default # # BROADCAST_ADDRESS:  Broadcast address in decimal-dot notation, if #                     different from default # # INTERFACE_STATE:    Desired interface state at boot time. #                     either up or down, default is up. # # DHCP_ENABLE         Determines whether or not DHCP client functionality #                     will be enabled on the network interface (see #                     auto_parms(1M), dhcpclient(1M)). DHCP clients get #                     their IP address assignments from DHCP servers. #                     1 enables DHCP client functionality; 0 disables it. # # For each additional network interfaces, add a set of variable assignments # like the ones below, changing the index to "[1]", "[2]" et cetera. # # IMPORTANT:  for 9.x-to-10.0 transition, do not put blank lines between # the next set of statements INTERFACE_NAME[0]=lan0 IP_ADDRESS[0]=15.32.162.130 SUBNET_MASK[0]=255.255.248.0 BROADCAST_ADDRESS[0]="" INTERFACE_STATE[0]="" DHCP_ENABLE[0]=0 INTERFACE_NAME[1]=lan1 IP_ADDRESS[1]=15.32.162.131 SUBNET_MASK[1]=255.255.248.0 BROADCAST_ADDRESS[1]="" INTERFACE_STATE[1]="" DHCP_ENABLE[1]=0 # Internet routing configuration.  See route(1m), routing(7) # # ROUTE_DESTINATION:  Destination hostname (in /etc/hosts) or host or network #                     IP address in decimal-dot notation, preceded by the word #                     "host" or "net"; or simply the word "default". # # ROUTE_MASK:         Subnetwork mask in decimal-dot notation, or C language #                     hexadecimal notation.  This is an optional field. #                     A IP address, subnet mask pair uniquely identifies #                     a subnet to be reached. If a subnet mask is not given, #                     then the system will assign the longest subnet mask #                     of the configured network interfaces to this route. #                     If there is no matching subnet mask, then the system #                     will assign the default network mask as the route's #                     subnet mask. # # ROUTE_GATEWAY:      Gateway hostname (in /etc/hosts) or IP address in #                     decimal-dot notation.  If local interface, must use the #                     same form as used for IP_ADDRESS above (hostname or #                     decimal-dot notation). If loopback interface, i.e., #                     127.0.0.1, the ROUTE_COUNT must be set to zero. # # ROUTE_COUNT:        An integer that indicates whether the gateway is a #                     remote interface (one) or the local interface (zero) #                     or loopback interface (e.g., 127.*). # # ROUTE_ARGS:         Route command arguments and options.  This variable #                     may contain a combination of the following arguments: #                     "-f", "-n" and "-p pmtu". # # For each additional route, add a set of variable assignments like the ones # below, changing the index to "[1]", "[2]" et cetera. # # IMPORTANT:  for 9.x-to-10.0 transition, do not put blank lines between # the next set of statements # ROUTE_DESTINATION[0]=default # ROUTE_MASK[0]="" # ROUTE_GATEWAY[0]="" # ROUTE_COUNT[0]="" # ROUTE_ARGS[0]="" # Dynamic routing daemon configuration.  See gated(1m) # # GATED:        Set to 1 to start gated daemon. # GATED_ARGS:   Arguments to the gated daemon. GATED=0 GATED_ARGS="" # # Router Discover Protocol daemon configuration.  See rdpd(1m) # # RDPD:         Set to 1 to start rdpd daemon # RDPD=0 # # Reverse ARP daemon configuration.  See rarpd(1m) # # RARP:         Set to 1 to start rarpd daemon # RARP=0 # The NODENAME variable (limited to 8 chars) will be used to set the # UUCP name (uname -S), since HOSTNAME is longer than 8 chars. NODENAME=asodevla ROUTE_GATEWAY[0]=15.32.160.1 ROUTE_COUNT[0]=1 ROUTE_DESTINATION[0]=default # 

This file has now been expanded to include information for lan1 in the lines shown with [1] .

Similarly, the /etc/hosts file was expanded to include the host name and IP address of the second LAN card as shown in the following listing:

 # cat /etc/hosts # @(#)B.11.11_LRhosts $Revision: 1.9.214.1 $ $Date: 96/10/08 13:20:01 $ # # The form for each entry is: # <internet address>    <official hostname> <aliases> # # For example: # 192.1.2.34    hpfcrm  loghost # # See the hosts(4) manual page for more information. # Note: The entries cannot be preceded by a space. #       The format described in this file is the correct format. #       The original Berkeley manual page contains an error in #       the format description. # 15.32.162.130   asodevlab1      lab1 15.32.162.131   asodevlab2      lab2 127.0.0.1       localhost       loopback # 

The second LAN card and its IP address were added to the file as well as aliases for the two systems of lab1 and lab2 .

We can make these entries take effect by running /sbin/init.d/net stop and then /sbin/init.d/net start to reread the networking files, and then run ifconfig and netstat -rn to see if our additions were made for lan1, as shown in the following output:

 #  /sbin/init.d/net stop  #  /sbin/init.d/net start  #  ifconfig lan0  lan0: flags=843<UP,BROADCAST,RUNNING,MULTICAST>         inet 15.32.162.130 netmask fffff800 broadcast 15.32.167.255 #  ifconfig lan1  lan1: flags=843<UP,BROADCAST,RUNNING,MULTICAST>         inet 15.32.162.131 netmask fffff800 broadcast 15.32.167.255 # # netstat -rn Routing tables Destination           Gateway            Flags   Refs Interface  Pmtu 15.32.162.130         15.32.162.130      UH        0  lan0       4136 127.0.0.1             127.0.0.1          UH        0  lo0        4136 15.32.162.131         15.32.162.131      UH        0  lan1       4136 15.32.160.0           15.32.162.131      U         2  lan1       1500 15.32.160.0           15.32.162.130      U         2  lan0       1500 127.0.0.0             127.0.0.1          U         0  lo0           0 default               15.32.160.1        UG        0  lan0          0 # 

The output of the two ifconfig commands shows that the two LAN cards have been configured. The gateway we had specified as the default route in the netconf file of 15.32.160.1 is shown as the default gateway in this netstat output. Routes can be added and deleted with the route command (see the route overview later in this chapter.) We'll use these interfaces for more advanced work in other chapters. As a test to ensure that these interfaces worked I was able to ping , as shown in the example below from another server to asodevlab2 , as well as to initiate a telnet session.

 #  ping 15.32.160.1 4096 10  PING 15.32.160.1: 4096 byte packets 4096 bytes from 15.32.160.1: icmp_seq=0. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=1. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=2. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=3. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=4. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=5. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=6. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=7. time=13. ms 4096 bytes from 15.32.160.1: icmp_seq=8. time=11. ms 4096 bytes from 15.32.160.1: icmp_seq=9. time=11. ms ----15.32.160.1 PING Statistics---- 10 packets transmitted, 10 packets received, 0% packet loss round-trip (ms)  min/avg/max = 11/11/13 # 

We were able to ping from another server to asodev lab2 in this example using a packet size of 4096 for 10 iterations.

We could also have configured lan1 at the command line with ifconfig (see the ifconfig overview later in this chapter). ifconfig can be used to configure a LAN interface or to display information related to a LAN interface configuration. The following example shows running ifconfig to configure lan1 :

 #  /etc/ifconfig lan1 inet 15.32.162.131 netmask 255.255.248.0  

This is the first form of the ifconfig command in which LAN card parameters are specified.

As an added piece of information, make sure that you do not have duplicate files in /etc/rc.config.d such as netconf and netconf.old . The system isn't smart enough and will read all files and get confused . The work around is to reverse naming convention. For example, netconf.old needs to be old.netconf . If you do have duplicate files in this directory, you will need to reboot after changing the naming convention.

We have covered manually configuring a LAN card and the files related to doing so in this section. We have a third LAN card in this system as well that we could configure with set_parms or manually by performing the steps in this section.

The next section covers some frequently used networking commands including many of those we used in this section.



HP-UX 11i Systems Administration Handbook and Toolkit
HP-UX 11i Systems Administration Handbook and Toolkit (2nd Edition)
ISBN: 0131018833
EAN: 2147483647
Year: 2003
Pages: 301

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net