Настройка маршрутизаторов cisco dhcp
Perform this task to configure a DHCP address pool. On a per-address pool basis, specify DHCP options for the client as necessary.
DHCP Address Pool Conventions
You can configure a DHCP address pool with a name that is a symbolic string (such as «engineering») or an integer (such as 0). Configuring a DHCP address pool also puts the router into DHCP pool configuration mode—identified by the (dhcp-config)# prompt—from which you can configure pool parameters (for example, the IP subnet number and default router list).
DHCP Address Pool Selection
DHCP defines a process by which the DHCP server knows the IP subnet in which the DHCP client resides, and it can assign an IP address from a pool of valid IP addresses in that subnet. The process by which the DHCP server identifies which DHCP address pool to use to service a client request is described in the «DHCP Address Pool Selection» section.
The DHCP server identifies which DHCP address pool to use to service a client request as follows:
•If the client is not directly connected (the giaddr field of the DHCPDISCOVER broadcast message is non-zero), the DHCP server matches the DHCPDISCOVER with a DHCP pool that has the subnet that contains the IP address in the giaddr field.
•If the client is directly connected (the giaddr field is zero), the DHCP server matches the DHCPDISCOVER with DHCP pool(s) that contain the subnet(s) configured on the receiving interface. If the interface has secondary IP addresses, the subnets associated with the secondary IP addresses are examined for possible allocation only after the subnet associated with the primary IP address (on the interface) is exhausted.
Cisco IOS DHCP server software supports advanced capabilities for IP address allocation. See the «Configuring DHCP Address Allocation Using Option 82» section for more information.
DHCP Server Address Pool with Multiple Disjoint Subnets
For any DHCP pool, you can configure a primary subnet and any number of secondary subnets. Each subnet is a range of IP addresses that the router uses to allocate an IP address to a DHCP client. The DHCP server multiple subnet functionality enables a Cisco IOS DHCP server address pool to manage additional IP addresses by adding the addresses to a secondary subnet of an existing DHCP address pool (instead of using a separate address pool).
Secondary Subnet Conventions
Configuring a secondary DHCP subnetwork places the router in DHCP pool secondary subnet configuration mode—identified by the (config-dhcp-subnet-secondary)# prompt — from which you can configure a default address list that is specific to the secondary subnet.
IP Address Allocation from a DHCP Server Address Pool with Secondary Subnets
If the DHCP server selects an address pool that contains multiple subnets, the DHCP server allocates an IP address from the subnets as follows:
•When the DHCP server receives an address assignment request, it looks for a free address in the primary subnet.
•When the primary subnet is exhausted, the DHCP server automatically looks for a free address in any secondary subnets maintained by the DHCP server (even though the giaddr does not necessarily match the secondary subnet). The server inspects the subnets for address availability in the order in which the subnets were added to the pool.
•If the giaddr matches a secondary subnet in the pool, the DHCP server allocates an IP address from that secondary subnet (even if IP addresses are available in the primary subnet and irrespective of the order in which secondary subnets where added).
Prerequisites
Before you configure the DHCP address pool, you need to:
•Identify DHCP options for devices where necessary, including the following:
–Default boot image name
–Default routers
–Domain Name System (DNS) servers
–NetBIOS name server
–Primary subnet
–Secondary subnets and subnet-specific default router lists
•Decide on a NetBIOS node type (b, p, m, or h).
•Decide on a DNS domain name.
Restrictions
You cannot configure manual bindings within the same pool that is configured with the network DHCP pool configuration command. To configure manual bindings, see the «Configuring Manual Bindings» section.
SUMMARY STEPS
1. enable
2. configure terminal
3. ip dhcp pool name
4. network network-number [mask | /prefix-length]
5. domain-name domain
6. dns-server address [address2 . address8]
7. bootfile filename
8. next-server address [ address2 . address8 ]
9. netbios-name-server address [address2 . address8]
10. netbios-node-type type
11. default-router address [address2 . address8]
12. option code [ instance number] ascii string | hex string | ip-address>
13. lease < days [ hours ] [ minutes ] | infinite >
14. network network-number [mask | /prefix-length> [secondary]]
15. override default-router address [address2 . address8]
16. end
17. show ip dhcp binding [address]
18. show ip dhcp conflict [address]
19. show ip dhcp database [url]
20. show ip dhcp server statistics