UNIX System Administration Handbook - Evi Nemeth [192]
% lanscan
Hardware Station Crd Hdw Net-Int NM MAC HP-DLPI DLPI
Path Address In# State NamePPA ID Type Support Mjr#
8/0/20/0 0x001... 0 UP lan0 snap0 1 ETHER Yes 130
% ifconfig lan0
lan0: flags=843 netmask ffffff00 broadcast 192.108.21.255 % ifconfig snap0 ifconfig: no such interface netstat -i shows network interface names, and netstat -nr displays routing tables: % netstat -i Name Mtu Network Address Ipkts Opkts lan0 1500 192.108.21.0 disaster.xor.com 6047 3648 lo0 4136 127.0.0.0 localhost.xor.com 231 231 % netstat -nr Routing tables Dest/Netmask Gateway Flags Refs Use Int Pmtu 127.0.0.1 127.0.0.1 UH 0 231 lo0 4136 192.108.21.99 192.108.21.99 UH 8 lan0 4136 192.108.21.0 192.108.21.99 U 2 0 lan0 1500 127.0.0.0 127.0.0.1 U 0 0 lo0 4136 default 192.108.21.254 UG 0 0 lan0 1500 The lanadmin command displays a summary of the network traffic that each interface has seen. It can also manipulate and monitor interfaces. It’s a menu-based program with useful help lists to lead you to the information you want. Here is an example that displays the statistics for the lan0 interface: % lanadmin LOCAL AREA NETWORK ONLINE ADMINISTRATION, Version 1.0 Copyright 1994 Hewlett Packard Company. All rights are reserved. Test Selection mode. lan = LAN Interface Administration menu = Display this menu quit = Terminate the Administration terse = Do not display command menu verbose = Display command menu Enter command: lan LAN Interface test mode. LAN Interface PPA Number = 0 clear = Clear statistics registers display = Display LAN Interface status/statistics end = End LAN Interface Admin., go up 1 level menu = Display this menu ppa = PPA Number of the LAN Interface quit = Terminate the Admin, return to shell reset = Reset LAN Interface, execute selftest specific = Go to Driver specific menu Enter command: display LAN INTERFACE STATUS DISPLAY Thu, Mar 2,2000 00:41:24 PPA Number = 0 Description = lan0 HP 10/100 TX Half-Duplex Hw Rev 0. Type (value) = ethernet-csmacd(6) MTU Size = 1500 Speed = 10 Station Address = 0x108303e9e6 Administration Status (value) = up(1) Operation Status (value) = up(1) ... Inbound Unicast Packets = 4204 Inbound Non-Unicast Packets = 5594 ... Inbound Unknown Protocols = 501 Outbound Octets = 454903 Outbound Unicast Packets = 3603 ... Deferred Transmissions = 2 Late Collisions = 0 Excessive Collisions = 2 ... At the time this example was run, the box had been up for only 3 hours in the middle of the night (we were adding a disk and rebooting frequently), so the traffic loads are very low. In addition to the commands lan and display, for which the output is shown above, we also tried clear and reset, which clear the counters and reset the interface. But since we didn’t run lanadmin as root, we were rebuffed. DHCP configuration for HP-UX DHCP_ENABLE[0]=1 sets the first network interface to DHCP mode. It will get its IP address, netmask, and other networking parameters from the DHCP server on the local network. Setting the variable equal to 0 would disable DHCP; you’d have to assign a static address in the netconf file. If no DHCP_ENABLE clause is present, the variable defaults to 1. The /sbin/auto_parms script does the real legwork of contacting the DHCP server. The program dhcpdb2conf enters the DHCP parameters secured by auto_parms into the netconf file, from which boot-time configuration information is taken. On the server side, HP-UX provides a DHCP server in the form of bootpd, which also handles BOOTP requests. The program dhcptools dumps the DHCP parameters in bootpd’s database, checks the configuration
As with other network configuration parameters, you turn on the use of DHCP at boot time by setting variables in the /etc/rc.config.d/netconf file. In this case, the variable names start with DHCP_ENABLE; the index [0] refers to the first interface, [1] to the second interface, and so on. For example,