Example for Configuring DHCP Servers Based on the Global Address Pool on the Same Network Segment in VRRP Networking DHCP Server Overview

Created Feb 28, 2019 17:19:21 50 0 0 0

DHCP Server Overview

Users require that all terminals on a network dynamically obtain network parameters such as IP addresses, DNS server IP address, routing information, and gateway information. The users do not need to manually configure the network parameters including terminal IP addresses. In addition, some mobile terminals (for example, mobile phones, tablets, and laptops) should support plug-and-play, without modification on network parameters each time. To meet these requirements, the DHCP server function can be configured on an aggregation-layer user gateway or a core-layer device to assign network parameters such as IP addresses to terminals.

The Dynamic Host Configuration Protocol (DHCP) uses the client/server mode to dynamically configure and uniformly manage network parameters for users. The DHCP server uses an address pool to assign network parameters such as IP addresses to the users. The global address pool or an interface address pool can be used.

The configuration of an interface address pool is simple, which can be used only when the users and DHCP server belong to the same network segment and the server can only assign network parameters to the users on the interface. It is applicable to small networks with a limited number of devices and controllable configuration and maintenance workload. After the DHCP server function based on the interface address pool is configured on the user gateway, the hosts and mobile terminals on the interface can automatically obtain network parameters such as IP addresses, without manual configuration and modification.

Compared with an interface address pool, the global address pool can be applied to large networks. The DHCP server function based on the global address pool should be configured on a core device, or an exclusive DHCP server be used to assign network parameters such as IP addresses. The user gateway only needs to be enabled with the DHCP relay function. For details, see Example for Configuring the Device as a DHCP Relay (on the Same Network).

Configuration Notes

For applicable product models and versions, see Applicable Product Models and Versions.

imgDownload?uuid=53b03dc6636d425d84d6e69 NOTE:
For details about software mappings, visit Hardware Query Tool and search for the desired product model.

Networking Requirements

As shown in Figure 7-9, a host in an enterprise is dual-homed to SwitchA and SwitchB through Switch. SwitchA functions as the master DHCP server to allocate IP addresses to the host. If the master DHCP server fails, a backup DHCP server must allocate an IP address to the host.

Figure 7-9  Networking diagram for configuring a device as the DHCP server 
imgDownload?uuid=088554a11aeb438da1ebc03

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure IP addresses for interfaces connecting SwitchA and SwitchB to implement network-layer connectivity. Configure Switch to transparently transmit Layer 2 packets.
  2. Configure a VRRP group on SwitchA and SwitchB. SwitchA has a higher priority and functions as the DHCP server to allocate IP addresses to clients. SwitchB has a lower priority and functions as a backup DHCP server.
  3. Create global address pools on SwitchA and SwitchB, and set corresponding attributes.
  4. Configure a loop prevention protocol on Switch, SwitchA, and SwitchB to prevent loops. In this example, STP is configured.

Procedure

  1. Configure network-layer connectivity among devices.

    # Configure IP addresses for interfaces connecting SwitchA and SwitchB. SwitchA is used as an example. The configuration on SwitchB is similar to that on SwitchA. For details, see the configuration file of SwitchB.

    <HUAWEI> system-view[HUAWEI] sysname SwitchA[SwitchA] vlan batch 100[SwitchA] interface gigabitethernet 0/0/2[SwitchA-GigabitEthernet0/0/2] port link-type hybrid[SwitchA-GigabitEthernet0/0/2] port hybrid pvid vlan 100[SwitchA-GigabitEthernet0/0/2] port hybrid untagged vlan 100[SwitchA-GigabitEthernet0/0/2] quit[SwitchA] interface gigabitethernet 0/0/5[SwitchA-GigabitEthernet0/0/5] port link-type hybrid[SwitchA-GigabitEthernet0/0/5] port hybrid pvid vlan 100[SwitchA-GigabitEthernet0/0/5] port hybrid untagged vlan 100[SwitchA-GigabitEthernet0/0/5] quit[SwitchA] interface vlanif 100[SwitchA-Vlanif100] ip address 10.1.1.1 24[SwitchA-Vlanif100] quit

    # Configure Layer 2 transparent transmission on Switch.

    <HUAWEI> system-view[HUAWEI] sysname Switch[Switch] vlan 100[Switch-vlan100] quit[Switch] interface gigabitethernet 0/0/1[Switch-GigabitEthernet0/0/1] port link-type hybrid[Switch-GigabitEthernet0/0/1] port hybrid pvid vlan 100[Switch-GigabitEthernet0/0/1] port hybrid untagged vlan 100[Switch-GigabitEthernet0/0/1] quit[Switch] interface gigabitethernet 0/0/2[Switch-GigabitEthernet0/0/2] port link-type hybrid[Switch-GigabitEthernet0/0/2] port hybrid pvid vlan 100[Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 100[Switch-GigabitEthernet0/0/2] quit[Switch] interface gigabitethernet 0/0/3[Switch-GigabitEthernet0/0/3] port link-type access[Switch-GigabitEthernet0/0/3] port default vlan 100[Switch-GigabitEthernet0/0/3] quit

  2. Create address pools and set corresponding attributes.

    # Enable DHCP on SwitchA.

    [SwitchA] dhcp enable

    # Create an address pool on SwitchA and specify an IP address range 10.1.1.2 to 10.1.1.128, which is exclusive from the IP address range of the address pool on SwitchB.

    imgDownload?uuid=53b03dc6636d425d84d6e69 NOTE:

    Information about the address pool on the master DHCP server cannot be backed up to a backup DHCP server in real time. To prevent IP address conflicts after a master/backup switchover, ensure that the address pool ranges on the master and backup DHCP servers are exclusive to one another.

    [SwitchA] ip pool 1[SwitchA-ip-pool-1] network 10.1.1.0 mask 255.255.255.0[SwitchA-ip-pool-1] gateway-list 10.1.1.111[SwitchA-ip-pool-1] excluded-ip-address 10.1.1.1[SwitchA-ip-pool-1] excluded-ip-address 10.1.1.129 10.1.1.254[SwitchA-ip-pool-1] lease day 10[SwitchA-ip-pool-1] quit

    # Create an address pool on SwitchB and specify an IP address range 10.1.1.130 to 10.1.1.254, which is exclusive from the IP address range of the address pool on SwitchA.

    [SwitchB] dhcp enable[SwitchB] ip pool 1[SwitchB-ip-pool-1] network 10.1.1.0 mask 255.255.255.0[SwitchB-ip-pool-1] gateway-list 10.1.1.111[SwitchB-ip-pool-1] excluded-ip-address 10.1.1.1 10.1.1.110[SwitchB-ip-pool-1] excluded-ip-address 10.1.1.112 10.1.1.129[SwitchB-ip-pool-1] lease day 10[SwitchB-ip-pool-1] quit

  3. Configure a VRRP group.

    # Create VRRP group 1 on SwitchA, set the priority of SwitchA in the VRRP group to 120, and configure clients to obtain IP addresses from a global address pool.

    [SwitchA] interface vlanif 100[SwitchA-Vlanif100] vrrp vrid 1 virtual-ip 10.1.1.111[SwitchA-Vlanif100] vrrp vrid 1 priority 120[SwitchA-Vlanif100] dhcp select global[SwitchA-Vlanif100] quit

    # Create VRRP group 1 on SwitchB, set the priority of SwitchB in the VRRP group to 100 (default), and configure clients to obtain IP addresses from a global address pool.

    [SwitchB] interface vlanif 100[SwitchB-Vlanif100] vrrp vrid 1 virtual-ip 10.1.1.111[SwitchB-Vlanif100] dhcp select global[SwitchB-Vlanif100] quit

  4. Configure STP to prevent loops.

    # Enable STP globally on Switch. The configurations on SwitchA and SwitchB are similar to that on Switch. For details, see the configuration files of SwitchA and SwitchB.

    [Switch] stp enable

    # Disable STP on GE0/0/3 of Switch, and set the path cost of GE0/0/1 to 20000.

    [Switch] interface gigabitethernet 0/0/3[Switch-GigabitEthernet0/0/3] stp disable[Switch-GigabitEthernet0/0/3] quit[Switch] interface gigabitethernet 0/0/1[Switch-GigabitEthernet0/0/1] stp cost 20000[Switch-GigabitEthernet0/0/1] quit

  5. Verify the configuration.

    # Run the display vrrp command on SwitchA and SwitchB. The command output shows that SwitchA is Master and SwitchB is Backup in the VRRP group.

    [SwitchA] display vrrp
      Vlanif100 | Virtual Router 1    State : Master
        Virtual IP : 10.1.1.111
        Master IP : 10.1.1.1
        PriorityRun : 120
        PriorityConfig : 120                                                        
        MasterPriority : 120                                                        
        Preempt : YES   Delay Time : 0 s
        TimerRun : 1 s
        TimerConfig : 1 s
        Auth type : NONE                                                            
        Virtual MAC : 0000-5e00-0101                                                
        Check TTL : YES                                                             
        Config type : normal-vrrp                                                   
        Backup-forward : disabled
        Create time : 2017-01-12 20:15:46
        Last change time : 2017-01-12 20:15:46
    [SwitchB] display vrrp
      Vlanif100 | Virtual Router 1    State : Backup
        Virtual IP : 10.1.1.111
        Master IP : 10.1.1.1
        PriorityRun : 100
        PriorityConfig : 100                                                        
        MasterPriority : 120                                                        
        Preempt : YES   Delay Time : 0 s
        TimerRun : 1 s
        TimerConfig : 1 s
        Auth type : NONE                                                            
        Virtual MAC : 0000-5e00-0101                                                
        Check TTL : YES                                                             
        Config type : normal-vrrp                                                   
        Backup-forward : disabled
        Create time : 2017-01-12 20:15:46
        Last change time : 2017-01-12 20:15:46

    # Run the display ip pool command on SwitchA and SwitchB. The command output shows that SwitchA, but not SwitchB, successfully allocated an IP address to the client. The following uses the command output in V200R011C10 as an example.

    [SwitchA] display ip pool
     -------------------------------------------------------------------------------
      Pool-name        : 1
      Pool-No          : 0
      Lease            : 10 Days 0 Hours 0 Minutes
      Position         : Local
      Status           : Unlocked
      Gateway-0        : 10.1.1.111
      Network          : 10.1.1.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :1
                         Idle        :125       Expired     :0
                         Conflict    :0         Disable     :127
    
    
      IP address Statistic
        Total       :253
        Used        :1          Idle        :125
        Expired     :0          Conflict    :0          Disable   :127
    [SwitchB] display ip pool
     -------------------------------------------------------------------------------
      Pool-name        : 1
      Pool-No          : 0
      Lease            : 10 Days 0 Hours 0 Minutes
      Position         : Local
      Status           : Unlocked
      Gateway-0        : 10.1.1.111
      Network          : 10.1.1.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :0
                         Idle        :125       Expired     :0
                         Conflict    :0         Disable     :128
    
    
      IP address Statistic
        Total       :253
        Used        :0          Idle        :125
        Expired     :0          Conflict    :0          Disable   :128

    # Run the shutdown command on GE0/0/2 and GE0/0/5 of SwitchA to simulate a fault.

    [SwitchA] interface gigabitethernet 0/0/2[SwitchA-GigabitEthernet0/0/2] shutdown[SwitchA-GigabitEthernet0/0/2] quit[SwitchA] interface gigabitethernet 0/0/5[SwitchA-GigabitEthernet0/0/5] shutdown[SwitchA-GigabitEthernet0/0/5] quit

    # Run the display vrrp command on SwitchA and SwitchB. The command output shows that SwitchA is Initialize and SwitchB is Master in the VRRP group.

    [SwitchA] display vrrp
      Vlanif100 | Virtual Router 1    State : Initialize
        Virtual IP : 10.1.1.111
        Master IP : 0.0.0.0
        PriorityRun : 120
        PriorityConfig : 120
        MasterPriority : 0
        Preempt : YES   Delay Time : 0 s
        TimerRun : 1 s
        TimerConfig : 1 s
        Auth type : NONE
        Virtual MAC : 0000-5e00-0101
        Check TTL : YES
        Config type : normal-vrrp
        Backup-forward : disabled
        Create time : 2017-01-12 20:15:46
        Last change time : 2017-01-12 20:15:46
    [SwitchB] display vrrp
      Vlanif100 | Virtual Router 1    State : Master
        Virtual IP : 10.1.1.111
        Master IP : 10.1.1.129
        PriorityRun : 100
        PriorityConfig : 100                                                        
        MasterPriority : 100                                                        
        Preempt : YES   Delay Time : 0 s
        TimerRun : 1 s
        TimerConfig : 1 s
        Auth type : NONE                                                            
        Virtual MAC : 0000-5e00-0101                                                
        Check TTL : YES                                                             
        Config type : normal-vrrp                                                   
        Backup-forward : disabled
        Create time : 2017-01-12 20:15:46
        Last change time : 2017-01-12 20:15:46

    # Run the display ip pool command on SwitchB to view the address pool configuration.

    [SwitchB] display ip pool
      Pool-name        : 1
      Pool-No          : 0
      Lease            : 10 Days 0 Hours 0 Minutes
      Position         : Local
      Status           : Unlocked
      Gateway-0        : 10.1.1.111
      Network          : 10.1.1.0
      Mask             : 255.255.255.0
      VPN instance     : --
      Conflicted address recycle interval: -
      Address Statistic: Total       :253       Used        :1
                         Idle        :124       Expired     :0
                         Conflict    :0         Disabled    :128
    
    
      IP address Statistic
        Total       :253
        Used        :1          Idle        :124
        Expired     :0          Conflict    :0          Disabled  :128

Configuration Files

  • Configuration file of SwitchA

    #
    sysname SwitchA
    #
    vlan batch 100
    #
    dhcp enable
    #
    ip pool 1
     gateway-list 10.1.1.111
     network 10.1.1.0 mask 255.255.255.0
     excluded-ip-address 10.1.1.1
     excluded-ip-address 10.1.1.129 10.1.1.254
     lease day 10 hour 0 minute 0
    #
    interface Vlanif100
     ip address 10.1.1.1 255.255.255.0
     vrrp vrid 1 virtual-ip 10.1.1.111
     vrrp vrid 1 priority 120
     dhcp select global
    #
    interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    interface GigabitEthernet0/0/5 port link-type hybrid port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    return
  • Configuration file of SwitchB

    #
    sysname SwitchB
    #
    vlan batch 100
    #
    dhcp enable
    #
    ip pool 1
     gateway-list 10.1.1.111
     network 10.1.1.0 mask 255.255.255.0
     excluded-ip-address 10.1.1.1 10.1.1.110
     excluded-ip-address 10.1.1.112 10.1.1.129
     lease day 10 hour 0 minute 0
    #
    interface Vlanif100
     ip address 10.1.1.129 255.255.255.0
     vrrp vrid 1 virtual-ip 10.1.1.111
     dhcp select global
    #
    interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    interface GigabitEthernet0/0/5 port link-type hybrid port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    return
  • Configuration file of Switch

    #
    sysname Switch
    #
    vlan batch 100
    #
    interface GigabitEthernet0/0/1 port link-type hybrid port hybrid pvid vlan 100
     port hybrid untagged vlan 100
     stp instance 0 cost 20000
    #
    interface GigabitEthernet0/0/2 port link-type hybrid port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    interface GigabitEthernet0/0/3
     port link-type access
     port default vlan 100
     stp disable
    #
    return

Applicable Product Models and Versions

Table 7-7  Applicable product models and versions

Series

Product Model

Software Version

S2700

S2720EI

V200R011C10, V200R012C00, V200R013C00

S3700

S3700EI

V100R006C05

S3700HI

V200R001C00

S5700

S5700EI

V200R001(C00&C01), V200R002C00, V200R003C00, V200R005(C00&C01&C02&C03)

S5700HI

V200R001(C00&C01), V200R002C00, V200R003C00, V200R005(C00SPC500&C01&C02)

S5710EI

V200R001C00, V200R002C00, V200R003C00, V200R005(C00&C02)

S5710HI

V200R003C00, V200R005(C00&C02&C03)

S5720LI, S5720S-LI

V200R010C00, V200R011C00, V200R011C10, V200R012(C00&C20), V200R013C00

S5720SI, S5720S-SI

V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00

S5720I-SI

V200R012C00, V200R013C00

S5720EI

V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00

S5720HI

V200R006C00, V200R007(C00&C10), V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00

S5730HI

V200R012C00, V200R013C00

S5730SI

V200R011C10, V200R012C00, V200R013C00

S5730S-EI

V200R011C10, V200R012C00, V200R013C00

S6700

S6700EI

V200R001(C00&C01), V200R002C00, V200R003C00, V200R005(C00&C01&C02)

S6720LI, S6720S-LI

V200R011C00, V200R011C10, V200R012C00, V200R013C00

S6720SI, S6720S-SI

V200R011C00, V200R011C10, V200R012C00, V200R013C00

S6720EI

V200R008C00, V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00

S6720S-EI

V200R009C00, V200R010C00, V200R011C00, V200R011C10, V200R012C00, V200R013C00

S6720HI

V200R012C00, V200R013C00

S7700

S7703, S7706, S7712

V200R001(C00&C01), V200R002C00, V200R003C00, V200R005C00, V200R006C00, V200R007C00, V200R008C00, V200R009C00, V200R010C00, V200R011C10, V200R012C00, V200R013C00

S7703 PoE

V200R013C00

S7706 PoE

V200R013C00

S9700

S9703, S9706, S9712

V200R001(C00&C01), V200R002C00, V200R003C00, V200R005C00, V200R006C00, V200R007(C00&C10), V200R008C00, V200R009C00, V200R010C00, V200R011C10, V200R012C00, V200R013C00

See more please click 

https://support.huawei.com/enterprise/en/doc/EDOC1000069520/9aadccc0/comprehensive-configuration-examples


  • x
  • convention:

Responses

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

Notice:To ensure 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 not limited to politically sensitive content, content concerning pornography, gambling, drug abuse and trafficking, content that may disclose or infringe upon others' intellectual properties, including commercial secrets, 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 Policy.”
If the attachment button is not available, update the Adobe Flash Player to the latest version!
Fast reply Scroll to top