Example for Configuring DHCP Relay to Enable Users to Obtain IP Addresses from a DHCP Server

Created: Jan 14, 2017 23:12:07Latest reply: Jan 15, 2017 00:08:11 963 1 0 0

Applicability

This example applies to all versions and AR routers.

Networking Requirements

As shown in Figure 6-3, RouterA functions as a DHCP relay agent, and RouterB functions as a DHCP server. DHCP packet needs to be relayed through RouterA so that PCs can obtain IP addresses from RouterB.

Figure 6-3  DHCP relay configuration
9c43b1761c6a4e938f7df7dd1e94c830

Procedure

  1. Configure RouterA.

    #
     vlan batch 100
    #
     dhcp enable    //Enable DHCP globally.
    #
    dhcp server group dhcpgroup1    //Create a DHCP server group.
     dhcp-server 10.10.10.1    //Add a DHCP server to the DHCP server group.
    #
    interface Vlanif100
     ip address 20.20.20.1 255.255.255.0
     dhcp select relay    //Enable DHCP relay on an interface.
     dhcp relay server-select dhcpgroup1    //Specify a DHCP server group for the interface.
    #
    interface Ethernet 2/0/0
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    interface GigabitEthernet3/0/0     
     ip address 10.10.20.1 255.255.255.0
    #
     ip route-static 0.0.0.0 0.0.0.0 10.10.20.2    //Configure a default route and set the next-hop address to 10.10.20.2.
    

  2. Configure RouterB.

    #
    dhcp enable    //Enable DHCP globally.
    #
    ip pool pool1    //Create a global IP address pool.
     network 20.20.20.0 mask 255.255.255.0    //Specify the range of IP addresses that can be dynamically allocated from the global IP address pool.
     gateway-list 20.20.20.1    //Configure the egress gateway address for the DHCP client.
    #
    interface GigabitEthernet1/0/0     
     ip address 10.10.10.1 255.255.255.0
     dhcp select global    //Configure the interface to use the global IP address pool.
    #
     ip route-static 0.0.0.0 0.0.0.0 10.10.10.2     //Configure a default route and set the next-hop address to 10.10.10.2.

  3. Verify the configuration.

    # Run the display dhcp relay command on RouterA to view the DHCP relay configuration on a specified interface.

    [RouterA] display dhcp relay interface vlanif 100
     **  Vlanif100 DHCP Relay Configuration  **
      DHCP server group name : dhcpgroup1
       DHCP server IP [0] :10.10.10.1
    

    # PCs can obtain IP addresses from RouterB through RouterA.

    [RouterB] display ip pool
       -----------------------------------------------------------------------
      Pool-name      : pool1
      Pool-No        : 0
                 Status           : Unlocked
      Gateway-0      : 20.20.20.1
      Mask           : 255.255.255.0
      Vpn instance   : --
    
    
     IP address Statistic
        Total       :250
        Used        :0          Idle        :248
        Expired     :0          Conflict    :0          Disable   :2
    

Configuration Notes

  • Ensure that the PC and DHCP relay both have a reachable route to the DHCP server.
  • Ensure that the DHCP relay and DHCP client are on the same subnet.

  • x
  • convention:

user_2790689     Created Jan 15, 2017 00:08:11 Helpful(0) Helpful(0)

thank you
  • x
  • convention:

Reply

Reply
You need to log in to reply to the post Login | Register

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " Privacy."
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Fast reply Scroll to top