In DHCP settings, we usually work with routers. Here we will introduce the debugging and settings of Cisco routers and DHCP. A company uses Cisco 3620 as the ios dhcp Server. the IP address of the fastethernet0 port connected to the Intranet is 192.168.1.4. The L2 Switch uses two Cisco 2950 and the L3 switch uses a Cisco 3550.
There are two VLANs in the network. To simplify the description, assume that each VLAN uses a 24-bit network address. The IP address of VLAN1 is 192.168.1.254, And the IP address of VLAN2 is 192.168.2.254. Implement the ios dhcp Server function on a Cisco device to automatically obtain IP addresses from hosts in each VLAN, as shown in.
Configure the DHCP address pool, additional information, and Lease Term
The database of the DHCP server is organized into a tree structure. The root of the tree is the address pool of all network segments for dynamic allocation, the branches are the subnet address pool, and the leaves are the addresses manually bound to the nodes. The procedure is as follows:
First, log on to the Cisco 3640 vro:
- Ghq> enable
- Password (enter the vro's privileged Password)
- Ghq # config terminal (entering Configuration Mode)
- Enter configuration commands one per line. End with CNTL/Z.
- Ghqconfig # ip dhcp pool global configures a root address pool. global is the name of the address pool, which can be expressed by meaningful strings)
-
- Ghq dhcp-config # network 192.168.0.0 255.255.0.0 dynamically allocated address segment)
- Ghqdhcp-config # domain-name ghq.com configure the domain suffix for the client)
- Ghqdhcp-config # dns-server 192.168.1.1 configure the DNS server for the client)
-
- Ghqdhcp-config # netbios-name-server 192.168.1.1 configure the wins server for the client)
- Ghqdhcp-config # netbios-node-type h-node configures the h node mode for the client)
- Ghqdhcp-config # lease 30 address lease period: 30 days)
- Ghqdhcp-config # ip dhcp pool vlan1 is the address pool configured for VLAN1, which is a sub-pool of the global pool and inherits domain suffix, DNS server, wins server, and other parameters from global)
-
- Ghqdhcp-config # network 192.168.1.0 255.255.255.0 VLAN1 dynamically allocates IP addresses that can be allocated within the network segment 192.168.1, but no excluded addresses)
- Ghqdhcp-config # default-router 192.168.1.254: configure the default gateway for the client, that is, the IP address of VLAN1)
-
- Ghqdhcp-config # ip dhcp pool vlan2 configures the address pool for VLAN2, which is a sub-pool of the global pool, the domain suffix, DNS server, and wins server can be inherited from global)
- Ghqdhcp-config # network 192.168.2.0 255.255.255.0
- Ghqdhcp-config # default-router 192.168.2.254
Set IP addresses that cannot be dynamically allocated
In the entire network, some IP addresses need to be statically specified to some specific devices, such as the router port, DNS server, wins server, and VLAN address. Obviously, these static IP addresses cannot be dynamically allocated, so they need to be excluded. The procedure is as follows:
- Ghqconfig # ip dhcp excluded-address 192.168.1.1 192.168.1.5
- IP addresses 192.168.1.1 to 192.168.1.5 cannot be dynamically allocated)
-
- Ghqconfig # ip dhcp excluded-address 192.168.1.254
- The IP address 192.168.1.254 is fixed to VLAN1 and cannot be dynamically allocated)
-
- Ghqconfig # ip dhcp excluded-address 192.168.2.254
- The IP address 192.168.2.254 is fixed to VLAN2 and cannot be dynamically allocated)
Set DHCP database proxy
The DHCP database proxy is a host used to store DHCP binding information. It can be an FTP, TFTP, or RCP server. You can configure multiple DHCP database proxies if necessary. Likewise, it is allowed not to configure the DHCP database proxy, but this is at the cost of not storing address conflict logs on the DHCP database proxy. If you do not want to configure the database proxy, you only need to cancel the record function of the address conflict log. The operation command is as follows:
- Ghqconfig # no ip dhcp conflict logging cancels the address conflict log)
Configure the static route table of the router
To enable the client to automatically obtain the IP address from the router used as the DHCP Server, the first condition is that the client in each VLAN can communicate with the router, therefore, you must first set a route in the router to enable the router to communicate with each client. You can set it as follows:
- Ghqconfig # ip route 192.168.1.0 255.255.255.0 FastEthernet0
- FastEthernet0 is the Ethernet interface connected to the vro and the Intranet. This command is used to create a static route between the Ethernet interface and VLAN1 192.168.1.254 .)
- Ghqconfig # ip route 192.168.2.0 255.255.255.0 FastEthernet0
- This command establishes a static route between the Ethernet interface and VLAN2 192.168.2.254)
After the configuration is complete, type the EXIT command in the configuration mode to return to the privileged mode. Ping the IP addresses 192.168.1.254 and 192.168.2.254 of VLAN1 and VLAN2. If the Ping Rules are available, the configuration is correct, you can directly go to the next save process.