UNIX System Administration Handbook - Evi Nemeth [191]
The output of ifconfig -a is different when it is run as root than when it is run as a regular user, for both versions of ifconfig. When run as root, it shows the link-level Ethernet addresses in addition to the IP addresses and parameters.
Solaris lets you change the link-level (MAC) address of an interface with the ifconfig command and the address family ether. We consider this a bug, not a feature.
13.13 HP-UX NETWORK CONFIGURATION
HP-UX gets a gold star for easy network configuration. All configuration parameters are set in the file /etc/rc.config.d/netconf. The values in this file (and all the other files in the rc.config.d directory) are read into the environment at boot time and used by the /sbin/rc script as the machine boots. netconf is liberally scattered with comments that tell you just which variables must be set and what they mean.
Basic network configuration for HP-UX
To assign a hostname to a machine and configure its first network interface, edit the netconf file and assign a value to the following variables:
HOSTNAME
INTERFACE_NAME[0]
IP_ADDRESS[0]
SUBNET_MASK[0]
For example:
HOSTNAME=disaster
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=192.108.21.99
SUBNET_MASK[0]=255.255.255.0
A second network interface would have subscript 1, and its existence would be indicated by the variable NET_CARDS being set to 2.
The netconf file also contains variables to configure static routes and start a routing daemon. To establish a default route, set the following variables:
ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=192.108.21.254
ROUTE_COUNT[0]=1
The ROUTE_MASK variable is needed for a network in which the netmask differed from the default for the class of addresses used. The ROUTE_COUNT variable should be 0 if the gateway is the local machine and 1 if it is remote. To add more static routes, just enter their parameters to a set of ROUTE_* variables with indexes [1], [2], etc. These arguments are passed directly to the route command. For example, the destination parameter can be the word default as above or net netaddr or host hostaddr.
HP-UX supplies gated but not routed; to use gated, set the variable GATED to 1 and GATED_ARGS to the arguments you want gated started with. See Chapter 14, Routing, for more details about gated configuration. The HP-UX man page on routing (man routing) contains a lot of good background information.
Many fields in the netconf file can contain either a hostname or an IP address. If a hostname is used, it must be defined in /etc/hosts. At boot time, HP-UX looks only at /etc/hosts and does not use any other name lookup mechanism. The machines in /etc/hosts should have their fully qualified domain names listed first, followed by their short names and any aliases.
HP uses the lanscan command to show information about the network interfaces on a machine. ifconfig -a does not work, but ifconfig interface does. Network interface names begin with either “lan” or “snap”: lan for Ethernet link-layer encapsulation and snap for IEEE 802.3 encapsulation. The first interface is lan0, the second is lan1, and so on.
HP-UX has the same sort of “plumbing” concept that Solaris does, but interfaces are automatically plumbed when they are assigned an IP address by ifconfig.
SAM is HP’s system administration tool, which is alleged to make UNIX system administration a breeze. It is a menu-based system and can be used to configure network interfaces, as well as to perform many other sysadmin chores.
Configuration examples for HP-UX
To bring up an HP-UX network interface and add a default route by hand, you’d use commands such as the following:
# ifconfig lan0 192.108.21.99 netmask 0xffffff00
# route add default 192.108.21.254 123
HP’s lanscan command lists the network interfaces in the system and the characteristics of the device driver that controls them. lanscan -v shows slightly more information. The examples below were munged to fit the page. The MAC entry with value ETHER implies that the network