About dhcp relay Configuration

Source: Internet
Author: User

During the learning process of network construction, we will encounter such a situation that DHCP servers are configured using routers or switches. Here we will explain the dhcp relay configuration. We can use routers or switches as DHCP servers to allocate IP addresses to machines in the LAN. Generally, DHCP servers are in the LAN, but sometimes DHCP servers may not be in the local LAN, then we need to configure DHCP relay.

As shown in the above topology, R3 is a DHCP server. To obtain an IP address through DHCP, the PC needs to configure DHCP relay on the R1PC and R1 directly connected ports, the DHCP broadcast is converted to unicast and sent to the DHCP server. When DHCP returns an IP address, the unicast is converted to broadcast on R1 and sent to the PC.

Dhcp relay configuration 1. Configuration on PC1:

 
 
  1. PC(config)#int f0/0  
  2. PC(config-if)#ip add dhcp   
  3. PC(config-if)#no shut  
  4. PC(config-if)#end 

Dhcp relay configuration 2. Configuration on R1:

 
 
  1. R1 (config) # int f0/0
  2. R1 (config-if) # ip helper-address 34.34.34.4 // 34.34.34.34.4 is the ip address of the DHCP server.
  3. R1 (config-if) # end

Dhcp relay configuration 3. Configuration on R3:

 
 
  1. R3(config)#ip dhcp pool mypool  
  2. R3(dhcp-config)#network 12.12.12.0 255.255.255.0  
  3. R3(dhcp-config)#exi  
  4. R3(config)#ip dhcp excluded-address 12.12.12.1  
  5. R3(config)#ip dhcp excluded-address 12.12.12.2  
  6. R3(config)#exi 

Of course, you only need to configure the route on R2 so that R1 can communicate with R3. After the configuration is complete, we can see the sh ip int bri on PC1:

 
 
  1. PC#sh ip int bri  
  2. InterfaceIP-AddressOK? Method Status    Protocol  
  3. FastEthernet0/012.12.12.3YES DHCP   up  up 

When the port is down and re-enabled, the IP address is changed.

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.