UNIX System Administration Handbook - Evi Nemeth [188]
mtu 1500 inet 192.108.21.48 netmask ffffff00 broadcast 192.108.21.255
% sudo ifconfig hme0
hme0:flags=863 mtu 1500 inet 192.108.21.48 netmask ffffff00 broadcast 192.108.21.255 ether 8:0:20:79:4f:49 Notice that when run as root, ifconfig shows the hardware address, but when run as a user, it does not. % netstat -nr Destination Gateway Flags Ref Use Interface ------------- --------------- ----- ---- --- --------- 192.108.21.0 192.108.21.48 U 3 244 hme0 224.0.0.0 192.108.21.48 U 3 0 hme0 default 192.108.21.254 UG 0 459 127.0.0.1 127.0.0.1 UH 0 296 lo0 % sudo route get anchor.cs.colorado.edu route to: anchor.cs.Colorado.EDU destination: default mask: default gateway: xor-gw2 interface: hme0 flags: recvpipe sendpipe ssthr rtt,msec rttvar hopct mtu expire 0 0 0 0 0 0 1500 0 DHCP configuration for Solaris ifconfig interface dhcp It just works! It calls the dhcpagent program to get the parameters for the interface from DHCP and to configure the interface with them. You can include several options on the ifconfig command line to specify the interface as the primary one, set timeouts, increase lease times, or display the status of the interface. To manually unconfigure DHCP, just run ifconfig interface drop This is all very nice, but you probably want DHCP to be automatically consulted at boot time. This behavior must be requested separately for each interface. To do so, create an /etc/dhcp.interface file to go with /etc/hostname.interface. If you like, the dhcp.interface file can contain additional command-line parameters to be passed to the ifconfig command. The hostname.interface file must still exist in order for the interface to be plumbed; however, it can be left empty if you are using DHCP. If the hostname.interface file is not empty, the startup scripts will first statically configure the interface by using its contents and then later reconfigure the interface by using DHCP. You can use the dhcpinfo command to see the parameters that have been supplied by the DHCP server. You can also look in the file /etc/dhcp/interface.dhc, which stores the current configuration for the specified interface. dhcpagent manages the interface from DHCP’s point of view. Among other tasks, it negotiates extensions to leases and cancels leases when they are no longer needed. If an interface that has been configured with DHCP is later reconfigured by hand, dhcpagent will discontinue management of that interface. dhcpagent collects the leased values from the DHCP server (default route, domain, name servers, etc.), but it does not act on most of them directly. Instead, it writes the parameters out to the appropriate interface files in /etc/dhcp. From there, the various pieces of information are read in by the /etc/rc.* scripts and used as arguments to route, put into the resolv.conf file, etc., as appropriate for each. dhcpagent transmits errors to syslog with facility “daemon” and priority “error”; it also writes them to the file /dev/console. It discards lesser errors (warnings, informational messages, and so on) by default, unless you explicitly turn them on with the command-line flag -lN. If N is 1, warnings are logged; if N is higher, less important priorities are also logged. If you send dhcpagent a USR1 signal (with kill), it dumps the state of its leases. See Chapter 11 for more information about syslog. You can check the files in /etc/dhcp to view the configuration of a particular interface. However, the mere fact that there is an interface.dhc file for an interface does not mean that dhcpagent is managing the interface—the lease may have expired. Dynamic reconfiguration and tuning for Solaris
Solaris includes a DHCP client and wins the prize for the easiest and most sensible DHCP client configuration:
Solaris’s ndd command lets you reconfigure the device drivers on a running system. Perhaps “reconfigure” is too strong a word; each driver provides access to several parameters that can be examined and