Configuring a DHCP Server11-20 Network Administration for the Solaris™ 9 Operating Environment Copyright 2002 Sun Microsystems, Inc.. Configuring a DHCP Server11-22 Network Administratio
Trang 1Configuring a DHCP Server
The DHCP Configuration Wizard – Step 2 window appears
Figure 11-8 shows you where to enter a path for the data store Thisexample uses the default directory
Figure 11-8 DHCP Configuration Wizard – Step 2 Window
4 Accept the default path name, and click >
Trang 2Configuring a DHCP Server
11-20 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Wizard – Step 3 window appears
Figure 11-9 allows you to specify the name service in which to storehost records
Figure 11-9 DHCP Configuration Wizard – Step 3 Window
5 Select/etc/hosts, and click >
Trang 3Configuring a DHCP Server
The DHCP Configuration Wizard – Step 4 window appears
Figure 11-10 shows you where to specify the length of the lease Thisexample uses the defaults 1 and days
Figure 11-10 DHCP Configuration Wizard – Step 4 Window
6 Accept the defaults of 1 and days, and click >
Trang 4Configuring a DHCP Server
11-22 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Wizard – Step 5 window appears
Figure 11-11 shows you where to specify the DNS domain and DNSservers This example uses the default of no DNS
Figure 11-11 DHCP Configuration Wizard – Step 5 Window
7 Do not accept a DNS domain or DNS server, and click >
Trang 5Configuring a DHCP Server
The DHCP Configuration Wizard – Step 6 window appears
Figure 11-12 shows you where to specify the network address and asubnet mask This example uses the192.168.1.0network
Figure 11-12 DHCP Configuration Wizard – Step 6 Window
8 Specify a network address by either selecting one or typing one, type
a subnet mask, and click >
Trang 6Configuring a DHCP Server
11-24 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Wizard – Step 7 window appears
Figure 11-13 shows you where to specify information about thenetwork This example uses the defaults Local-Area (LAN) and Userouter discovery protocol
Figure 11-13 DHCP Configuration Wizard – Step 7 Window
9 Select either Local-Area (LAN) or Point-to-Point
10 Select either Use router discovery protocol or type the routerinformation in the Use router field
11 Click >
Trang 7Configuring a DHCP Server
The DHCP Configuration Wizard – Step 8 window appears
Figure 11-14 shows you where to specify the NIS domain and
servers This example uses the defaults of no NIS domain and noNIS server
Figure 11-14 DHCP Configuration Wizard – Step 8 Window
12 If appropriate, type the NIS domain configuration in the NIS Domainfield
13 If appropriate, type the NIS server IP address in the NIS Serversfield, and click Add for each NIS server that you are specifying
14 Click >
Trang 8Configuring a DHCP Server
11-26 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Wizard – Step 9 window appears
Figure 11-15 shows you where to specify the NIS+ domain andservers This example uses the defaults of no NIS+ domain and noNIS+ server
Figure 11-15 DHCP Configuration Wizard – Step 9 Window
15 If appropriate, type the NIS+ domain configuration in the NIS+Domain field
16 If appropriate, type the NIS+ server IP address in the NIS+ Serversfield, and click Add for each NIS+ server that you are specifying
17 Click >
Trang 9Configuring a DHCP Server
The DHCP Configuration Wizard – Step 10 window appears
Figure 11-16 shows you a summary of the information you enteredpreviously This example uses the sample information indicatedpreviously
Figure 11-16 DHCP Configuration Wizard – Step 10 Window
18 Review the information and, if the information is correct, clickFinish
Trang 10Configuring a DHCP Server
11-28 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Manager Window closes, the main DHCPManager Window appears, and the window in Figure 11-17 appears.Figure 11-17 shows you where to indicate that you want to configureaddresses for the server
Figure 11-17 Start Address Wizard Window
19 Click Yes to proceed with address configuration
The dhcp_networkfile is now populated
Trang 11Configuring a DHCP Server
Adding Addresses by Using the dhcpmgr Utility
Note – The following steps are a continuation of initial server
configuration
The DHCP Address Configuration Wizard – Step 1 window appears.Figure 11-18 shows you where to specify the number of IP addresses toconfigure This example uses five addresses and a comment of net1
Figure 11-18 DHCP Address Configuration Wizard – Step 1
Window
1 Modify the number of IP addresses to use
2 Add a comment if necessary
3 Click >
Trang 12Configuring a DHCP Server
11-30 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Address Configuration Wizard – Step 2 window appears.Figure 11-19 shows you where to specify the DHCP server andstarting IP address In this example, the Managed by Server field isset at the default, and the starting IP address changes to
192.168.1.10 This example uses sys11-dhcpfor the root name
Figure 11-19 DHCP Address Configuration Wizard – Step 2
Trang 13Configuring a DHCP Server
The DHCP Address Configuration Wizard – Step 3 window appears.Figure 11-20 shows you the IP addresses that you specified in theprevious step
Figure 11-20 DHCP Address Configuration Wizard – Step 3
Window
7 Verify that the address information is correct, and click >
Trang 14Configuring a DHCP Server
11-32 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Address Configuration Wizard – Step 4 window appears.Figure 11-21 shows you the name of the macro to be associated withthe DHCP interface
Figure 11-21 DHCP Address Configuration Wizard – Step 4
Window
8 Select Configuration Macro from the drop-down list box
If you want to view the contents of the selected macro, click View Toexit the contents window, click OK
9 Click >
Trang 15Configuring a DHCP Server
The DHCP Address Configuration Wizard – Step 5 window appears.Figure 11-22 shows you where to specify the type of lease Thisexample uses the default of Dynamic
Figure 11-22 DHCP Address Configuration Wizard – Step 5
Window
Note – Routers, mail servers, and systems that provide services normally
use permanent lease types
10 Select either Dynamic or Permanent, and click >
Trang 16Configuring a DHCP Server
11-34 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Address Configuration Wizard – Step 6 window appears.Figure 11-23 shows the information that you entered in previoussteps
Figure 11-23 DHCP Address Configuration Wizard – Step 6
Window
11 Review the information, and click Finish
Trang 17Configuring a DHCP Server
The DHCP Manager Window appears Figure 11-24 shows theinformation that you have provided
Figure 11-24 DHCP Manager Window
12 Choose Exit from the File menu to close the DHCP Managerwindow
13 To view the information that dhcpmgradded to the/etc/inet/hostsfile, use the grepcommand:
sys11# grep dhcp /etc/inet/hosts
192.168.1.10 sys11-dhcp-10 #net1 example
192.168.1.11 sys11-dhcp-11 #net1 example
192.168.1.12 sys11-dhcp-12 #net1 example
192.168.1.13 sys11-dhcp-13 #net1 example
192.168.1.14 sys11-dhcp-14 #net1 example
sys11#
Table 11-1 shows the items that are created during DHCP configuration
Table 11-1 Items Created During DHCP Server Configuration
The service configuration
file,
/etc/inet/dhcpsvc.conf
Records keywords andvalues for serverconfiguration options
Data store type andlocation Options used withthein.dhcpd process tostart the DHCP daemonwhen the system boots.Thedhcptab table Creates adhcptabtable if it
does not already exist
Macros and options withassigned values
TheLocale macro
(optional)
Contains the local timezone’s offset in secondsfrom Universal TimeCoordinated (UTC)
TheUTCoffst option
Trang 18Configuring a DHCP Server
11-36 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The server macro, named to
match the server’s node
name
Contains options withvalues determined by inputfrom the administrator whoconfigured the DHCPserver The options apply toall clients that use addressesowned by the server
TheLocale macro Theoptions:Timeserv, which isset to point to the server’sprimary IP address;
LeaseTimandLeaseNeg,ifyou select negotiable leases;andDNSdmainandDNSserv,
if DNS is configured
The network address macro,
whose name is the same as
the network address of the
client’s network
Contains options withvalues determined by inputfrom the administrator whoconfigured the DHCPserver The options apply toall clients that are located onthe network specified by themacro name
The options:SubnetRouter orRDiscvyFBroadcst, if the network is
a LAN, maximum transferunit (MTU);NISdmain andNISservs, if NIS is
configured; andNIS+dom andNIS+serv, ifNIS+ is configured
The network table for the
network
Creates an empty table untilyou create the IP addressesfor the network
None, until you add the IPaddresses
Table 11-1 Items Created During DHCP Server Configuration (Continued)
Trang 19Configuring and Managing DHCP ClientsConfiguring and Managing DHCP Clients
Configuring DHCP clients is an easy process Most management isperformed on the DHCP server side
Configuring the DHCP Client
When you install the Solaris 9 OE from the installation CD-ROM, you areprompted to use DHCP to configure network interfaces If you selectyes
in the installation script, the DHCP client software is enabled on yoursystem during Solaris 9 OE installation You do not need to do anythingelse on the Solaris 9 OE client to use DHCP
If your client is not a Solaris 9 OE client, consult the client’sdocumentation for configuration instructions
Configuring the DHCP Client to Request Dynamic Host Names
If a client system is already running the Solaris 9 OE and is not usingDHCP, complete the following steps to configure the DHCP client torequest dynamic host names:
1 Log in asroot on the DHCP client system
2 Enable DHCP on the client by creating the appropriate file for theexternal interface, which ishme0in this example
# touch /etc/dhcp.hme0
Note – You do not need to remove the/etc/hostname.interfacefile
3 Configure the /etc/default/dhcpagentfile on the DHCP client sothat it releases its IP address if it is rebooted or shut down
4 Edit the/etc/default/dhcpagentfile, and remove the#in front oftheRELEASE_ON_SIGTERM=yesparameter This causes the DHCPclient to relinquish its address when it reboots or is shut downproperly
5 Reboot the client, and watch the system console for DHCP messages
as the system boots
Trang 20Configuring and Managing DHCP Clients
11-38 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
6 Observe DHCP messages when the Ethernet interface is beingconfigured, for example:
configuring IPv4 interfaces: hme0
starting DHCP on primary interface hme0
Hostname: sys11-dhcp-14
Trang 21Exercise: Configuring a DHCP Server and ClientExercise: Configuring a DHCP Server and Client
In this exercise, you configure a basic DHCP server and clientconfiguration
Preparation
Before performing this exercise, you should:
● Refer to your network diagram to determine the function of eachsystem on your subnet
● Refer to the lecture notes as necessary to perform the tasks listed
Note – Use the default configuration parameters in these exercises unless
otherwise specified
Task Summary
In this exercise, you accomplish the following tasks:
● Configure the DHCP server
● Configure the DHCP client
● Use the snooputility to view DHCP client server interaction
Tasks
Perform the following tasks
Task 1 – Configuring the DHCP Server
In this part of the exercise, use the DHCP Manager graphical userinterface (GUI) utility (dhcpmgrutility) to configure a DHCP server onyour subnet Allow the network wizard to start and configure at least fivehosts with the address range starting at 192.168.xxx.xxx, where
xxx.xxxis provided by the instructor depending on the classroom setup
Trang 22Exercise: Configuring a DHCP Server and Client
11-40 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
Note – Use the default configuration parameters in this task unless
otherwise specified
This example uses thesys11system to demonstrate configuring a basicDHCP server with thedhcpmgrGUI utility
To configure the DHCP server, complete the following steps:
1 Start thedhcpmgrutility
2 Initially configure the DHCP server
3 Add at least five addresses
4 To view the information that the dhcpmgrutility added to the/etc/inet/hostsfile, use thegrepcommand
Task 2 – Configuring the DHCP Client
To configure the DHCP client, complete the following steps:
1 Log in asrooton the DHCP client
2 Enable DHCP on the client
3 Configure the /etc/default/dhcpagentfile on the DHCP client sothat it releases its IP address if it is rebooted or is shut down
4 Reboot the client, and watch the system console for DHCP messages
as the system boots
5 Observe the DHCP messages when the Ethernet interface is beingconfigured
Task 3 – Using the snoop Utility to View DHCP Client-Server Interaction
An important part of troubleshooting DHCP issues is using the snooputility to observe the network interaction between the server and theclient
To view DHCP client-server interaction, complete the following steps:
1 Start thesnooputility on any system on the subnet other than theDHCP client Be sure to use the snooputility on an interface that is
on the same subnet as the DHCP client, which ishme0in thisexample Have thesnooputility write to the/tmp/dhcp-snoop.snpfile
Trang 23Exercise: Configuring a DHCP Server and Client
2 Reboot the DHCP client system
3 After the DHCP client is booted, stop the snooputility by pressingControl-C
4 View the summary of the captured information
5 Use the snooputility to convert the trace data to ASCII text, andoutput that text to the/tmp/dhcp-snoop1.txtfile for viewing withany text editor that allows for easy navigation and searching of thedata
6 Use the viewutility to view the trace data in the
/tmp/dhcp-snoop.txtfile Look out for messages, such as
DHCPDISCOVER,DHCPOFFER,DHCPREQUEST, andDHCPACK, in the trace.Observe the ETHER destination addresses, the source and
destination IP addresses, and the DHCP messages
Trang 24Exercise Summary
11-42 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
Exercise Summary
?
!
Discussion – Take a few minutes to discuss what experiences, issues, or
discoveries you had during the lab exercise
● Experiences
● Interpretations
● Conclusions
● Applications
Trang 25Exercise SolutionsExercise Solutions
Perform the following tasks
Task 1 – Configuring the DHCP Server
1 Start thedhcpmgrutility
sys11# /usr/sadm/admin/bin/dhcpmgr &
2 Initially configure the DHCP server
If the system is not configured as a DHCP server or BOOTP relay, Figure 11-25 appears.
Figure 11-25 Choose Server Configuration Window
a Click OK.
Trang 26Exercise Solutions
11-44 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Wizard – Step 1 window in Figure 11-26 appears.
Figure 11-26 DHCP Configuration Wizard – Step 1 Window
b Select Text files, and click >.
Trang 27Exercise Solutions
The DHCP Configuration Wizard – Step 2 window in Figure 11-27 appears This example uses the default directory.
Figure 11-27 DHCP Configuration Wizard – Step 2 Window
c Accept the default path name, and click >.
Trang 28Exercise Solutions
11-46 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Wizard – Step 3 window in Figure 11-28 appears.
Figure 11-28 DHCP Configuration Wizard – Step 3 Window
d Select/etc/hosts, and click >.
Trang 29Exercise Solutions
The DHCP Configuration Wizard – Step 4 window in Figure 11-29 appears This example uses the defaults 1 and days.
Figure 11-29 DHCP Configuration Wizard – Step 4 Window
e Accept the defaults of 1 and days, and click >.
Trang 30Exercise Solutions
11-48 Network Administration for the Solaris™ 9 Operating Environment
Copyright 2002 Sun Microsystems, Inc All Rights Reserved Enterprise Services, Revision A
The DHCP Configuration Wizard – Step 5 window in Figure 11-30 appears This example uses the default DNS information.
Figure 11-30 DHCP Configuration Wizard – Step 5 Window
f Accept the default DNS domain and DNS server, and click OK.