6-4 Dynamic Host Configuration Protocol (DHCP)

  • Cisco routers provide DHCP services for IP hosts .

  • DHCP, defined by RFC 2131, provides dynamic allocation of host IP addressing and configuration parameters for network devices.

  • DHCP is a client/server model in which the server allocates and delivers addresses to DHCP clients .

  • DHCP can be configured to assign default gateway and DNS information.

  • DHCP can be configured to assign NetBIOS mode and WINS server information.

  • There are three mechanisms for DHCP address delivery: automatic allocation (permanent assignment by the server to a client), dynamic allocation (assigns the address for a limited time), and manual allocation (the administrator manually assigns the address, and the DHCP server conveys the assignment).

  • Pool assignments are inherited by host addresses that fall within a network or subnet pool. Any direct assignments to a pool override the assignments made at a higher level.

NOTE

DHCP uses UDP ports 67 and 68 to convey IP assignment and parameter information.


Configuration

You must first either configure the DHCP database or disable DHCP conflict logging in order to have the router provide the DHCP addressing request.

  1. Configure the DHCP database.

    1. Configure a DHCP database agent:

       (global)  ip dhcp database   url  [  timeout   seconds   write-delay   seconds  ] 

      The DHCP database agent is a host running FTP, TFTP, or RCP that stores the DHCP bindings database. You can configure multiple DHCP database agents , and you can configure the interval between database updates and transfers for each agent.

      -OR-

    2. Disable DHCP conflict logging:

       (global)  no ip dhcp conflict logging  

      If you do not configure a DHCP database agent, you must disable the recording of DHCP address conflicts on the DHCP server. This allows the router to assign addresses without having a database agent.

    3. (Optional) Exclude IP addresses from all pools:

       (global)  ip dhcp excluded-address   low-address  [  high-address  ] 

      The DHCP server can exclude an address (low-address) or a range of addresses (low-address to high-address) when assigning addresses to clients.

    4. Create a DHCP pool, and enter DHCP configuration mode:

       (global)  ip dhcp pool   name  

      You must create and configure a DHCP pool. The ip dhcp pool command with the name option creates the list and then configures that pool in DHCP configuration mode. Pools can be created and attributes assigned for an entire network. Subnet-specific options can then be assigned in respective subnet pools.

    5. Configure the DHCP address pool subnet and mask:

       (dhcp)  network   network-number  [  mask  /  prefix-length  ] 

      Set up the address pool. The network-number specifies the range of IP addresses that are offered for the pool, in the form of a network address. The range of pool addresses is from network-number plus 1 through the broadcast address minus 1. The mask can be specified in either dotted -decimal form or by the / prefix-length (also known as CIDR or bitwise) notation. Assigning the network 172.16.18.8 with a mask of 255.255.255.248 would provide addressing from 172.16.18.9 through 172.16.18.14.

    6. (Optional) Configure the domain name for the client:

       (dhcp)  domain-name   domain  

      This command specifies the domain name for clients. This option places the hosts in this pool in a common domain. The domain is part of the IP configuration parameters.

    7. (Optional) Specify the DNS server:

       (dhcp)  dns-server   address  [  address2...   address8  ] 

      This command specifies which DNS server or servers will be used by the clients.

    8. (Optional) Configure the WINS server:

       (dhcp)  netbios-name-server   address  [  address2...   address8  ] 

      Microsoft clients use Windows Internet Naming Service (WINS) to resolve NetBIOS names to IP addresses. Configuring a WINS server is an extension of DHCP. This command specifies the IP address of the WINS server or servers that the client is configured to use.

    9. (Optional) Specify the NetBIOS node type for the client:

       (dhcp)  netbios-node-type   type  

      These node types can be used to specify what order or option the client is to use when resolving NetBIOS names to IP addresses: b-node (broadcast), p-node (peer-to-peer), m-node (mixed), or h-node (hybrid; recommended).

    10. (Optional but recommended) Set up the default gateway:

       (dhcp)  default-router   address  [  address2...   address3  ] 

      This command specifies the gateway or router to be used by the IP client when it sends packets off-net.

    11. (Optional) Configure the address lease time:

       (dhcp)  lease  [  days  [  hours  ] [  minutes  ]  infinite  ] 

      Use this command to specify in days, hours, and/or minutes how long the client can keep an address before renewing it. If you select the infinite option, the address will not expire, but it must be released by the client. The default lease time is one day.

  2. (Optional) Configure manual bindings.

    Manual bindings are used to give a specific client a particular IP address. Manual binding is typically done by the MAC address. In other words, given a specific MAC address, the client chooses the host address that was assigned in the database. The following commands show how the router can be configured to provide manual bindings.

    1. Configure the server pool, and enter DHCP pool configuration mode:

       (global)  ip dhcp pool   name  

      Enter DHCP configuration mode, and create a host-specific pool. Each host-specific assignment must have a unique pool name. Because the options assigned for a major network or subnet are cumulative, the host inherits any attributes assigned to its subnet.

    2. Specify the host address and mask to be used by the client:

       (dhcp)  host   address  [  mask   /prefix-length  ] 

      This command specifies the IP address that the client will use. The mask is also specified in this command.

    3. Identify the host:

       (dhcp)  hardware-address   hardware-address type  

      -OR-

       (dhcp)  client-identifier   unique-identifier  

      Both commands specify the client's hardware identifier. The hardware-address command specifies the MAC address and type. The client-identifier command identifies the client and media type using dotted-hexadecimal notification.

    4. (Optional) Define the client name for DNS:

       (dhcp)  client-name   name  
  3. (Optional) Configure DHCP operational parameters.

    1. (Optional) Control the DHCP server process:

       (global) [  no  ]  service dhcp  

      By default, the DHCP service is configured to be on. If it has been disabled, use the command service dhcp to re-enable the service. If you need to stop or disable the service, use the no keyword.

    2. (Optional) Configure the number of ping packets:

       (global)  ip dhcp ping packets   number  

      This command specifies the number of ping packets the DHCP server sends to a pool address before assigning that address to a requesting client. The default is two packets.

    3. (Optional) Specify the timeout value for DHCP ping packets:

       (global)  ip dhcp ping timeout   milliseconds  

      Before a DHCP server sends an address to a client, it pings that address the number of times specified by the ip dhcp ping packet command. If a response is received, the pinged address is not used. If the ping times out, the server assumes it is safe to assign that address to a client. This command defines how long the server waits before a ping is considered unsuccessful . The default is 500 milliseconds.

Example

In this example, the DHCP service is configured to use three address pools. Pool 0 sets configuration parameters that will be inherited by any device that gets an address from the 172.16.0.0 network, unless those parameters are overridden by another pool with a more specific network address. Pools 1 and 2 define the DHCP parameters for devices on networks 172.16.18.0 and 172.16.22.0, respectively. The addresses from 172.16.18.250 through 172.16.18.254 are reserved and are excluded from the DHCP pools.

All devices within 172.16.0.0 are offered the domain name example.com, DNS servers 172.16.1.250 and 172.16.2.251, a WINS address of 172.16.1.18, and p-mode NetBIOS. DHCP offers for the 172.16.18.0 network have a default gateway of 172.16.18.252 and 172.16.18.253 and a DHCP lease time of 30 days. DHCP offers for the 172.16.22.0 network also receive the DNS addresses 172.16.22.250 and 172.16.22.251values that override the defaults configured in pool 0.

  no ip dhcp conflict logging   ip dhcp excluded-address 172.16.18.250 172.16.18.254   ip dhcp pool 0   network 172.16.0.0 /16   domain-name example.com   dns-server 172.16.1.250 172.16.2.251   netbios-name-server 172.16.1.18   netbios-node-type p-node   ip dhcp pool 1   network 172.16.18.0 /24   default-router 172.16.18.252 172.16.18.253   lease 30   ip dhcp pool 2   network 172.16.22.0 /24   default-router 172.16.22.1   netbios-name-server 172.16.22.100   dns-server 172.16.22.250 172.16.22.251   lease 10  


Cisco Field Manual[c] Router Configuration
Cisco Field Manual[c] Router Configuration
ISBN: 1587050242
EAN: N/A
Year: 2005
Pages: 185

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