Analysis on DHCP configuration of Cisco routers (1)

Source: Internet
Author: User
Tags cisco 2950

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:

 
 
  1. Ghq> enable
  2. Password (enter the vro's privileged Password)
  3. Ghq # config terminal (entering Configuration Mode)
  4. Enter configuration commands one per line. End with CNTL/Z.
  5. 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)
  6.  
  7. Ghq dhcp-config # network 192.168.0.0 255.255.0.0 dynamically allocated address segment)
  8. Ghqdhcp-config # domain-name ghq.com configure the domain suffix for the client)
  9. Ghqdhcp-config # dns-server 192.168.1.1 configure the DNS server for the client)
  10.  
  11. Ghqdhcp-config # netbios-name-server 192.168.1.1 configure the wins server for the client)
  12. Ghqdhcp-config # netbios-node-type h-node configures the h node mode for the client)
  13. Ghqdhcp-config # lease 30 address lease period: 30 days)
  14. 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)
  15.  
  16. 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)
  17. Ghqdhcp-config # default-router 192.168.1.254: configure the default gateway for the client, that is, the IP address of VLAN1)
  18.  
  19. 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)
  20. Ghqdhcp-config # network 192.168.2.0 255.255.255.0
  21. 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:

 
 
  1. Ghqconfig # ip dhcp excluded-address 192.168.1.1 192.168.1.5
  2. IP addresses 192.168.1.1 to 192.168.1.5 cannot be dynamically allocated)
  3.  
  4. Ghqconfig # ip dhcp excluded-address 192.168.1.254
  5. The IP address 192.168.1.254 is fixed to VLAN1 and cannot be dynamically allocated)
  6.  
  7. Ghqconfig # ip dhcp excluded-address 192.168.2.254
  8. 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:

 
 
  1. 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:

 
 
  1. Ghqconfig # ip route 192.168.1.0 255.255.255.0 FastEthernet0
  2. 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 .)
 
 
  1. Ghqconfig # ip route 192.168.2.0 255.255.255.0 FastEthernet0
  2. 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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.