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

Latest reply: Jan 14, 2017 16:08:11 1017 1 0 0


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


  1. Configure RouterA.

     vlan batch 100
     dhcp enable    //Enable DHCP globally.
    dhcp server group dhcpgroup1    //Create a DHCP server group.
     dhcp-server    //Add a DHCP server to the DHCP server group.
    interface Vlanif100
     ip address
     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
     ip route-static    //Configure a default route and set the next-hop address to

  2. Configure RouterB.

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

  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] :

    # PCs can obtain IP addresses from RouterB through RouterA.

    [RouterB] display ip pool
      Pool-name      : pool1
      Pool-No        : 0
                 Status           : Unlocked
      Gateway-0      :
      Mask           :
      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:

Created Jan 14, 2017 16:08:11 Helpful(0) Helpful(0)

thank you
  • x
  • convention:


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

Notice 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!
Login and enjoy all the member benefits

Login and enjoy all the member benefits