< Home

Specifying the DHCP Server IP Address

Context

You must specify the IP address of the DHCP server so that the DHCP relay agent can forward DHCP messages between the server and clients. Two methods are available for you to specify the DHCP server IP address: in the interface view and in the DHCP server group view. The former method is recommended if you configure the DHCP relay function on individual interfaces connected to DHCP servers that have different IP addresses. The latter method is recommended if you configure the DHCP relay function on multiple interfaces that connect to one DHCP server.

A maximum of 16 DHCP relay agents are allowed between a DHCP server and a DHCP client. If there are more than 16 DHCP relay agents, DHCP messages are discarded.

Procedure

  • Specify the DHCP server IP address in the interface view.
    1. Enter the system view.

      system-view

    2. (Optional) Configure the DHCP server polling function on the DHCP relay agent.

      ip relay address cycle

      By default, DHCP server polling is disabled on a DHCP relay agent.

    3. (Optional) Set the TTL value for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

      dhcp set ttl { unvaried | ttl-value }

      By default, the TTL value of DHCP Discovery messages decreases by 1 after they are forwarded by the DHCP relay agent at Layer 3.

      If the DHCP relay agent connects to a special client whose TTL value of DHCP Discovery messages is 1, and if there are routing devices between the DHCP relay agent and DHCP server, run the dhcp set ttl ttl-value command to specify a fixed TTL value (16 is recommended) for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

    4. Enter the interface or sub-interface view.

      interface interface-type interface-number[.subinterface-number ]

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731S-H, S5731-S, S5731S-S, S6720-HI, S5732-H, S6730-H, S6730S-H, S6730-S, S6730S-S, S6720-EI, and S6720S-EI support sub-interfaces.

    5. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.

    6. Specify the IP address of a DHCP server.

      dhcp relay server-ip ip-address

      By default, no DHCP server IP address is specified.

      You can specify up to 20 DHCP server IP addresses for each interface.

    7. (Optional) Enable DHCP relay gateway switching.

      dhcp relay gateway-switch enable

      By default, DHCP relay gateway switching is disabled.

      After primary and secondary IP addresses are configured on an interface, the primary IP address functions as the gateway address in most cases. If clients cannot use the primary IP address to apply for IP addresses, configure DHCP relay gateway switching to allow the clients to use secondary IP addresses to apply for IP addresses. After DHCP relay gateway switching is enabled, configure address pools on the same network segment as the secondary IP addresses on the connected DHCP server.

      • The gateway address switches from the primary IP address to a secondary IP address only when a user fails at least three times to obtain an IP address using the primary IP address and the interval between the last failure and first failure exceeds 24 seconds.
      • If a primary IP address and multiple secondary IP addresses are configured on an interface, the system tries the secondary IP addresses one by one based on the IP address configuration sequence until users successfully obtain IP addresses.

  • Specify the DHCP server IP address in the DHCP server group view.
    1. Enter the system view.

      system-view

    2. (Optional) Configure the DHCP server polling function on the DHCP relay agent.

      ip relay address cycle

      By default, DHCP server polling is disabled on a DHCP relay agent.

    3. (Optional) Set the TTL value for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

      dhcp set ttl { unvaried | ttl-value }

      By default, the TTL value of DHCP Discovery messages decreases by 1 after they are forwarded by the DHCP relay agent at Layer 3.

      If the DHCP relay agent connects to a special client whose TTL value of DHCP Discovery messages is 1, and if there are routing devices between the DHCP relay agent and DHCP server, run the dhcp set ttl ttl-value command to specify a fixed TTL value (16 is recommended) for DHCP Discovery messages after they are forwarded by the DHCP relay agent at Layer 3.

    4. Create a DHCP server group and enter its view.

      dhcp server group group-name

      By default, no DHCP server group is configured.

      A maximum of 32 DHCP server groups can be configured on a device.

    5. Configure the DHCP server members in the DHCP server group.

      dhcp-server ip-address [ ip-address-index ]

      By default, no DHCP server member is configured in a DHCP server group.

      A maximum of 20 DHCP servers can be added to a DHCP server group.

    6. (Optional) Specify the gateway address for clients.

      gateway ip-address

      A gateway address is specified for clients.

      Skip this step if the interface connecting the DHCP relay agent to clients functions as the gateway.

      The gateway address specified in this step must be the same as the egress gateway address of clients specified on the DHCP server. If the device functions as the DHCP server, refer to (Optional) Configuring a Gateway Address for Clients for details about how to specify the egress gateway address for clients.

    7. (Optional) Bind the DHCP server group to a VPN instance.

      vpn-instance vpn-instance-name

      By default, the DHCP server group is not bound to a VPN instance.

      To ensure clients can obtain IP parameters if the DHCP relay agent is deployed on a VPN network, bind the DHCP server group to a VPN instance that is also bound to the address pool of the DHCP server.

    8. Return to the system view.

      quit

    9. Enter the interface or sub-interface view.

      interface interface-type interface-number[.subinterface-number ]

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731S-H, S5731-S, S5731S-S, S6720-HI, S5732-H, S6730-H, S6730S-H, S6730-S, S6730S-S, S6720-EI, and S6720S-EI support sub-interfaces.

    10. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.

    11. Create a DHCP server group.

      dhcp relay server-select group-name

    12. (Optional) Enable DHCP relay gateway switching.

      dhcp relay gateway-switch enable

      By default, DHCP relay gateway switching is disabled.

      After primary and secondary IP addresses are configured on an interface, the primary IP address functions as the gateway address in most cases. If clients cannot use the primary IP address to apply for IP addresses, configure DHCP relay gateway switching to allow the clients to use secondary IP addresses to apply for IP addresses. After DHCP relay gateway switching is enabled, configure address pools on the same network segment as the secondary IP addresses on the connected DHCP server.

      • The gateway address switches from the primary IP address to a secondary IP address only when a user fails at least three times to obtain an IP address using the primary IP address and the interval between the last failure and first failure exceeds 24 seconds.
      • If a primary IP address and multiple secondary IP addresses are configured on an interface, the system tries the secondary IP addresses one by one based on the IP address configuration sequence until users successfully obtain IP addresses.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >