Comware

 View Only
last person joined: yesterday 

Expand all | Collapse all

[HPE 5945] - DHCP relay with several DHCP servers

This thread has been viewed 47 times
  • 1.  [HPE 5945] - DHCP relay with several DHCP servers

    Posted Apr 25, 2022 10:47 AM

    Switch : HPE FF 5945
    COMWARE : 7.1.070 Rel 6607

    Hello there,

    I'm trying to configure a DHCP relay on a switch with multiple DHCP servers. The previous commands I use to implement was :

    dhcp relay server-group 1 ip 12.34.56.78
    dhcp relay server-group 1 ip 98.76.54.32

    Then, on the vlan interface :

    dhcp select relay
    dhcp relay server-select 1"

    However, this seems not to work anymore with the COMWARE 7. What is the new configuration to implement multiple dhcp server on a dhcp relay ?



    ------------------------------
    Jean-Baptiste PHILIPPIN
    ------------------------------


  • 2.  RE: [HPE 5945] - DHCP relay with several DHCP servers

    EMPLOYEE
    Posted Apr 25, 2022 11:14 AM
    Hello Jean-Baptise,

    Please check the example on the following page it is for comware 7 (5130) but it is the same for 5945:

    https://techhub.hpe.com/eginfolib/networking/docs/switches/5130ei/5200-3942_l3-ip-svcs_cg/content/483572375.htm

    1. Assign IP addresses to interfaces on the switches. (Details not shown.)

    2. Configure Switch B and Switch C as DHCP servers. (Details not shown.)

    3. Configure the DHCP relay agent on Switch A:

      # Enable DHCP.

      <SwitchA> system-view
      [SwitchA] dhcp enable
      

      # Enable the DHCP relay agent on VLAN-interface 2.

      [SwitchA] interface vlan-interface 2
      [SwitchA-Vlan-interface2] dhcp select relay
      

      # Specify the IP addresses of the DHCP servers.

      [SwitchA-Vlan-interface2] dhcp relay server-address 1.1.1.1
      [SwitchA-Vlan-interface2] dhcp relay server-address 2.2.2.2
      

      # Specify the DHCP server selecting algorithm as master-backup.

      [SwitchA-Vlan-interface2] dhcp relay server-address algorithm master-backup
      

      # Configure the DHCP relay agent to switch back to the master DHCP server 3 minutes after it switches to the backup DHCP server.

      [SwitchA-Vlan-interface2] dhcp relay master-server switch-delay 3
      

    Hope this helps!

    ------------------------------
    -Alex-
    ------------------------------



  • 3.  RE: [HPE 5945] - DHCP relay with several DHCP servers

    Posted Apr 25, 2022 11:47 AM
    Hello Alex,

    Thanks for our answer :)

    So the feature allowing to configure a "pool" of DHCP servers isn't available anymore ?
    For instance, i have 200 VLAN interfaces to configure with 10 DHCP relay servers each, and of course, not the same relay servers, depending on the VLAN purpose. Is there a simple way to do that ?

    Best regards,
    JB

    ------------------------------
    Jean-Baptiste PHILIPPIN
    ------------------------------



  • 4.  RE: [HPE 5945] - DHCP relay with several DHCP servers
    Best Answer

    EMPLOYEE
    Posted Apr 26, 2022 04:13 AM
    Hello Jean-Baptiste,

    Well, maybe another approach is to add the following command/feature to the aforementioned setup and check if this will suit your needs:

    remote-server

    Use remote-server to specify DHCP servers for a DHCP relay address pool.
    Use undo remote-server to remove DHCP servers from a DHCP relay address pool.

    Syntax
    remote-server ip-address&<1-8> [ public | vpn-instance
    vpn-instance-name ]
    undo remote-server [ ip-address&<1-8> ]

    Default
    No DHCP server is specified for the DHCP relay address pool.

    Views
    DHCP address pool view

    Predefined user roles
    network-admin

    Parameters
    ip-address&<1-8>: Specifies a space-separated list of up to eight DHCP server addresses.
    public: Specifies the DHCP servers on the public network.
    vpn-instance vpn-instance-name: Specifies the name of the MPLS L3VPN instance to
    which the DHCP servers belong. The instance name is a case-sensitive string of 1 to 31 characters.

    Usage guidelines
    If you execute this command multiple times, the most recent configuration takes effect.
    If you do not specify a DHCP server address, the undo remote-server command removes all
    DHCP servers in the DHCP address pool.
    If neither the public keyword nor the vpn-instance vpn-instance-name option is specified,
    DHCP servers on the same network as the DHCP client are selected.

    Examples
    # Specify DHCP server 10.1.1.1 for DHCP address pool 0.
    <Sysname> system-view
    [Sysname] dhcp server ip-pool 0
    [Sysname-dhcp-pool-0] remote-server 10.1.1.1

    Hope this helps!

    EDIT:
    You have to use the following command to apply pool under the interface:
    dhcp relay pool
    Use dhcp relay pool to specify a DHCP relay address pool for DHCP clients.
    Use undo dhcp relay pool to remove a DHCP relay address pool.

    Syntax
    dhcp relay pool pool-name [ option { 60 [ option-text ] | code } ]
    undo dhcp relay pool [ pool-name [ option { 60 [ option-text ] | code } ] ]

    Default
    No DHCP relay address pool is specified for DHCP clients.

    Views
    Layer 3 Ethernet interface view
    Layer 3 Ethernet subinterface view
    Layer 3 aggregate interface view
    Layer 3 aggregate subinterface view

    Predefined user roles
    network-admin


    Parameters
    pool-name: Specifies a DHCP relay address pool by its name, a case-insensitive string of 1 to 63
    characters.
    option { 60 [ option-text ] | code }: Specifies the option setting to match DHCP requests.
    If you do not specify this option, the DHCP relay address pool can match all DHCP requests.
    • The 60 keyword specifies Option 60. The option-text argument specifies Option 60 content, a
    case-sensitive string of 1 to 128 characters. This argument is used to match Option 60 content
    in DHCP requests and is configurable only when the 60 keyword is specified.
    • The code argument specifies an option value in the range of 1 to 59 or 61 to 254.
    Usage guidelines
    After you configure multiple DHCP relay address pools on a DHCP relay agent, you can specify
    these pools on an interface. To match DHCP clients based on options, you can define option settings
    when you specify the relay address pools.
    If you specify multiple DHCP relay address pools on an interface, the relay agent selects a DHCP
    relay address pool for a DHCP client as follows:
    1. Compares option values in the DHCP request in descending order against option values in
    DHCP relay address pools.
    􀁻 If a match (other than 60) is found, the matching process stops and the relay agent selects
    that matching relay address pool.
    􀁻 If the matching option value is 60, the relay agent continues to compare the Option 60
    content in the request and the Option 60 string in the relay address pool:
    − If the Option 60 content matches the string, the relay address pool is selected.
    − If the Option 60 content does not match the string, the relay address pool is not selected.
    If another relay address pool is specified to match a request carrying Option 60 but has
    no Option 60 string defined, the relay agent selects that relay address pool.
    2. If still no DHCP relay address pool is matched, the relay agent selects the DHCP relay address
    pool with no options specified.
    If you specify DHCP servers by configuring both the following methods on an interface, the DHCP
    relay address pool setting takes effect.
    • Specify DHCP relay address pools by using the dhcp relay pool command.
    • Specify DHCP servers directly on an interface by using the dhcp relay server-address
    command.
    When you specify a DHCP relay address pool on an interface to define the DHCP servers, make
    sure the remote-server command is configured in the DHCP relay address pool. Otherwise, the
    relay agent drops DHCP requests. The DHCP requests are not forwarded to any DHCP server even
    if the dhcp relay server-address command is configured.
    If you execute this command multiple times to specify different DHCP address pools for the same
    DHCP client, the most recent configuration takes effect.
    If you do not specify a DHCP address pool, the undo dhcp relay pool command removes all
    DHCP address pools specified on the interface.

    Examples
    # Specify DHCP relay address pool pool1 on VLAN-interface 2.
    <Sysname> system-view
    [Sysname] interface vlan-interface 2
    [Sysname-Vlan-interface2] dhcp relay pool pool1
    Related commands
    dhcp relay server-address
    ------------------------------
    -Alex-
    ------------------------------



  • 5.  RE: [HPE 5945] - DHCP relay with several DHCP servers

    Posted Apr 28, 2022 08:29 AM
    Awesome ! This is exactly what i needed :)
    Thanks for the answer.

    Have a good day and my best regards,

    JB

    ------------------------------
    Jean-Baptiste PHILIPPIN
    ------------------------------



  • 6.  RE: [HPE 5945] - DHCP relay with several DHCP servers

    Posted Apr 28, 2022 08:49 AM
    PS : is there some equivalent feature for ipv6 ?

    ------------------------------
    Jean-Baptiste PHILIPPIN
    ------------------------------



  • 7.  RE: [HPE 5945] - DHCP relay with several DHCP servers

    EMPLOYEE
    Posted Apr 29, 2022 03:10 AM
    Hello Jean-Baptiste,

    It should be the same procedure for ipv6:

    https://techhub.hpe.com/eginfolib/networking/docs/switches/5130hi/5998-8413b_l3-ip-svcs_cg/content/496704357.htm

    DHCPv6 address pool

    The DHCP server selects IPv6 addresses, IPv6 prefixes, and other parameters from an address pool, and assigns them to the DHCP clients.

    Address allocation mechanisms

    DHCPv6 supports the following address allocation mechanisms:

    • Static address allocation-To implement static address allocation for a client, create a DHCPv6 address pool, and manually bind the DUID and IAID of the client to an IPv6 address in the DHCPv6 address pool. When the client requests an IPv6 address, the DHCPv6 server assigns the IPv6 address in the static binding to the client.

    • Dynamic address allocation-To implement dynamic address allocation for clients, create a DHCPv6 address pool, specify a subnet for the pool, and divide the subnet into temporary and non-temporary IPv6 address ranges. Upon receiving a DHCP request, the DHCPv6 server selects an IPv6 address from the temporary or non-temporary IPv6 address range based on the address type in the client request.

    Prefix allocation mechanisms

    DHCPv6 supports the following prefix allocation mechanisms:

    • Static prefix allocation-To implement static prefix allocation for a client, create a DHCPv6 address pool, and manually bind the DUID and IAID of the client to an IPv6 prefix in the DHCPv6 address pool. When the client requests an IPv6 prefix, the DHCPv6 server assigns the IPv6 prefix in the static binding to the client.

    • Dynamic prefix allocation-To implement dynamic prefix allocation for clients, create a DHCPv6 address pool and a prefix pool, specify a subnet for the address pool, and apply the prefix pool to the address pool. Upon receiving a DHCP request, the DHCPv6 server dynamically selects an IPv6 prefix from the prefix pool in the address pool.

    Address pool selection

    The DHCPv6 server observes the following principles when selecting an IPv6 address or prefix for a client:

    1. If there is an address pool where an IPv6 address is statically bound to the DUID or IAID of the client, the DHCPv6 server selects this address pool. It assigns the statically bound IPv6 address or prefix and other configuration parameters to the client.

    2. If the receiving interface has an address pool applied, the DHCP server selects an IPv6 address or prefix and other configuration parameters from this address pool.

    3. If no static address pool is configured and no address pool is applied to the receiving interface, the DHCPv6 server selects an address pool depending on the client location.

      • Client on the same subnet as the server-The DHCPv6 server compares the IPv6 address of the receiving interface with the subnets of all address pools. It selects the address pool with the longest-matching subnet.

      • Client on a different subnet than the server-The DHCPv6 server compares the IPv6 address of the DHCPv6 relay agent interface closest to the client with the subnets of all address pools. It also selects the address pool with the longest-matching subnet.

      To make sure address allocation functions correctly, keep the subnet used for dynamic assignment consistent with the subnet where the interface of the DHCPv6 server or DHCPv6 relay agent resides.

      https://techhub.hpe.com/eginfolib/networking/docs/switches/5130ei/5200-3942_l3-ip-svcs_cg/content/483572604.htm

      Specifying DHCPv6 servers for a DHCPv6 address pool on the DHCPv6 relay agent

      About specifying DHCPv6 servers for a DHCPv6 address pool on the DHCPv6 relay agent

      This feature allows DHCPv6 clients of the same type to obtain IPv6 addresses, IPv6 prefixes, and other configuration parameters from the DHCPv6 servers in the matching DHCPv6 address pool.

      It applies to scenarios where the DHCPv6 relay agent connects to clients of the same access type but classified into different types by their locations. In this case, the relay interface typically has no IPv6 address configured. You can use the gateway-list command to specify the gateway addresses for clients matching the same DHCPv6 address pool.

      Upon receiving a DHCPv6 Solicit or Request from a client that matches a DHCPv6 address pool, the relay agent processes the packet as follows:

      • Fills the link-address field of the packet with a specified gateway address.

      • Forwards the packet to all DHCPv6 servers in the matching DHCPv6 address pool.

      The DHCPv6 servers select a DHCPv6 address pool according to the gateway address.

      Restrictions and guidelines

      • You can specify a maximum of eight DHCPv6 servers for one DHCPv6 address pool for high availability. The relay agent forwards DHCPv6 Solicit and Request packets to all DHCPv6 servers in the DHCPv6 address pool.

      • If this feature is used in the PPPoE scenario, execute the ipv6 dhcp relay client-information record command to enable the DHCPv6 relay agent to record relay entries. When a PPPoE user gets offline, the DHCPv6 relay agent locates the matching relay entry and sends a Release message to the DHCPv6 server.

      • If this feature is used in the PPPoE scenario, you do not need to execute the ipv6 dhcp select relay command. This is because the remote-server command is a must in this configuration task and it implies that this device is a relay device.

      Procedure

      1. Enter system view.

        system-view

      2. Create a DHCPv6 address pool and enter its view.

        ipv6 dhcp pool pool-name

      3. Specify gateway addresses for the clients matching the DHCPv6 address pool.

        gateway-list ipv6-address&<1-8>

        By default, no gateway address is specified.

      4. Specify DHCPv6 servers for the DHCPv6 address pool.

        remote-server ipv6-address [ interface interface-type interface-number ]

        By default, no DHCPv6 server is specified for the DHCPv6 address pool.



      Hope this helps!



    ------------------------------
    -Alex-
    ------------------------------



  • 8.  RE: [HPE 5945] - DHCP relay with several DHCP servers

    Posted May 06, 2022 11:30 AM
    Yes, thanks a lot, it fits my requirements :)

    Have a good day !

    JB​

    ------------------------------
    Jean-Baptiste PHILIPPIN
    ------------------------------