DHCP server construction for Routing

Source: Internet
Author: User
Tags cisco 2950

DHCP server applications are embodied in many vswitches and routers. 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.  
  3. Password
  4. (Enter the vro's privileged password)
  5.  
  6. Ghq # config terminal
  7. (Enter Configuration Mode)
  8.  
  9. Enter configuration commands one per line. End with CNTL/Z.
  10.  
  11. Ghq config # ip dhcp pool global
  12. Configure a root address pool. global is the name of the address pool, which can be expressed using meaningful strings)
  13.  
  14. Ghq dhcp-config # network 192.168.0.0 255.255.0.0
  15. Dynamically assigned CIDR blocks)
  16.  
  17. Ghq dhcp-config # domain-name ghq.com
  18. Configure the domain suffix for the client)
  19.  
  20. Ghq dhcp-config # dns-server 192.168.1.1
  21. Configure the DNS server for the client)
  22.  
  23. Ghq dhcp-config # netbios-name-server 192.168.1.1
  24. Configure the wins server for the client)
  25.  
  26. Ghq dhcp-config # netbios-node-type h-node
  27. Configure the h node mode for the client)
  28.  
  29. Ghq dhcp-config # lease 30
  30. Address lease period: 30 days)
  31.  
  32. Ghq dhcp-config # ip dhcp pool vlan1
  33. Configure an address pool for VLAN1. This pool is a sub-pool of the global pool and inherits the domain suffix, DNS server, wins server, and other parameters from global)
  34.  
  35. Ghq dhcp-config # network 192.168.1.0 255.255.255.0
  36. VLAN1 dynamically allocates IP addresses that can be allocated in the network segment 192.168.1, which are not excluded)
  37.  
  38. Ghq dhcp-config # default-router 192.168.1.254
  39. Configure the default gateway for the client, that is, the IP address of VLAN1)
  40.  
  41. Ghq dhcp-config # ip dhcp pool vlan2
  42. Configure an address pool for VLAN2. This pool is a sub-pool of the global pool and inherits the domain suffix, DNS server, wins server, and other parameters from global)
  43.  
  44. Ghq dhcp-config # network 192.168.2.0 255.255.255.0
  45. Ghq dhcp-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. Ghq config # 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. Ghq config # ip dhcp excluded-address 192.168.1.254

The IP address 192.168.1.254 is fixed to VLAN1 and cannot be dynamically allocated)

 
 
  1. ghq config # 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:

 
 
  1. Ghq config # 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. ghq config #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 .)

 
 
  1. ghq config #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.

Specify the DHCP server address for different VLANs on the vswitch.

This step can only be done by setting ip helper-ADDRESS in different VLANs. The command is as follows:

 
 
  1. Switch> enable to enter the privileged mode of the switch)
  2. Password
  3. Switch # config t enters the configuration mode)
  4. Enter configuration commands one per line. End with CNTL/Z.
  5. Switch config # interface vlan1 configure VLAN1)
  6. Switch config-if # ip helper-address 192.168.1.4 specifies the ip address of the DHCP server, that is, the ip address of the router)
  7. Ghq config-if # interface vlan2 configure VLAN2)
  8. Ghq config-if # ip helper-address 192.168.1.4

Enable Portfast for all L2 access ports directly connected to the client

To make the client obtain the correct IP address, you need to enable the Portfast function of the switch port connected to the client to Cisco 2950 ). Note that this function can only be enabled on the Layer 2 port connecting to a single client, enabling this function on a port connected to a vswitch or hub may cause a broadcast storm or address learning problem. To enable the Portfast function, follow these steps:

 
 
  1. Switch # configure terminal
  2. Switch config # interface-id
  3. Switch config-if # enable portfast for spanning-tree portfast)
  4. Switch config-if # end

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.