No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

CLI-based Configuration Guide - IP Service

AR100, AR120, AR160, AR1200, AR2200, AR3200, and AR3600 V300R003

This document describes the concepts and configuration procedures of IP Service features on the device, and provides the configuration examples.
Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Example for Configuring a DHCP Server Based on the Global Address Pool on the Same Network Segment in HSB Networking

Example for Configuring a DHCP Server Based on the Global Address Pool on the Same Network Segment in HSB Networking

Networking Requirements

As shown in Figure 3-15, the hosts in a department of an enterprise are dual-homed to RouterA (active device) and RouterB (standby device) through the switch. RouterA functions as the DHCP server to allocate IP addresses to the hosts. The enterprise requires that the hosts obtain IP addresses from the standby device when the active device is faulty.

Figure 3-15  Networking diagram of configuring a DHCP server based on the global address pool on the same network segment in HSB networking

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure interface IP addresses on RouterA and RouterB to implement network communication between devices. In addition, configure the Layer 2 transparent transmission function on the switch.
  2. Configure a VRRP group on RouterA and RouterB. RouterA is configured with a higher priority and functions as the active device to allocate IP addresses for clients. RouterB is configured with a lower priority and functions as the standby device.
  3. Configure the hot standby (HSB) function on RouterA and RouterB so that service information on RouterA is backed up to RouterB in real time or in batches, ensuring seamless service switchover from the active device to the standby device.
  4. Configure the DHCP server function on RouterA and RouterB to allocate IP addresses to the DHCP clients.
NOTE:

Configure the interface link type and VLANs on the interface connecting the switch to the hosts to implement Layer 2 communication.

Procedure

  1. Configure devices to ensure network connectivity.

    # Assign an IP address to each interface on RouterA. The configuration on RouterB is similar. For details, see the configuration file.

    <Huawei> system-view
    [Huawei] sysname RouterA
    [RouterA] interface gigabitethernet 2/0/0
    [RouterA-GigabitEthernet2/0/0] ip address 10.1.1.1 24
    [RouterA-GigabitEthernet2/0/0] quit
    [RouterA] interface gigabitethernet 1/0/0
    [RouterA-GigabitEthernet1/0/0] ip address 192.168.1.1 24
    [RouterA-GigabitEthernet1/0/0] quit

    # Configure Layer 2 transparent transmission on the switch.

    <Huawei> system-view
    [Huawei] sysname Switch
    [Switch] vlan 100
    [Switch-vlan100] quit
    [Switch] interface gigabitethernet 0/0/1
    [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 hybrid pvid vlan 100
    [Switch-GigabitEthernet0/0/2] port hybrid untagged vlan 100
    [Switch-GigabitEthernet0/0/2] quit
    

  2. Create VRRP groups.

    # Create VRRP group 1 on RouterA and set the VRRP priority to 120.

    [RouterA] interface gigabitethernet 2/0/0
    [RouterA-GigabitEthernet2/0/0] vrrp vrid 1 virtual-ip 10.1.1.111
    [RouterA-GigabitEthernet2/0/0] vrrp vrid 1 priority 120
    [RouterA-GigabitEthernet2/0/0] quit

    # Create VRRP group 1 on RouterB and set the VRRP priority to 100.

    [RouterB] interface gigabitethernet 2/0/0
    [RouterB-GigabitEthernet2/0/0] vrrp vrid 1 virtual-ip 10.1.1.111
    [RouterB-GigabitEthernet2/0/0] quit

  3. Configure the HSB function.

    # Create HSB service 0 on RouterA and configure the IP addresses and port numbers for the active and standby channels.

    [RouterA] hsb-service 0
    [RouterA-hsb-service-0] service-ip-port local-ip 192.168.1.1 peer-ip 192.168.1.2 local-data-port 10241 peer-data-port 10241
    [RouterA-hsb-service-0] quit

    # Create HSB service 0 on RouterB and configure the IP addresses and port numbers for the local and peer devices.

    [RouterB] hsb-service 0
    [RouterB-hsb-service-0] service-ip-port local-ip 192.168.1.2 peer-ip 192.168.1.1 local-data-port 10241 peer-data-port 10241
    [RouterB-hsb-service-0] quit

    # Create HSB group 0 on RouterA, and bind it to HSB service 0 and VRRP group 1. The configuration on RouterB is similar. For details, see the configuration file.

    [RouterA] hsb-group 0
    [RouterA-hsb-group-0] bind-service 0
    [RouterA-hsb-group-0] track vrrp vrid 1 interface gigabitethernet 2/0/0

    # Enable HSB group 0 on RouterA to make it take effect. The configuration on RouterB is similar. For details, see the configuration file.

    [RouterA-hsb-group-0] hsb enable
    [RouterA-hsb-group-0] quit

  4. Configure the DHCP server function.

    NOTE:

    In HSB scenarios, the address allocation information of the active and standby DHCP servers can be backed up in real time so that an IP address allocation conflict does not occur during the switchover between the active and standby DHCP servers. If the DHCP server function is configured in VRRP scenarios and the address allocation information of the active and standby DHCP servers can be backed up in real time, the address pools configured on the active and standby devices must be different to prevent an IP address allocation conflict after the active/standby switchover.

    # Configure the DHCP server function on RouterA.

    [RouterA] dhcp enable
    [RouterA] ip pool p1
    [RouterA-ip-pool-p1] network 10.1.1.0 mask 255.255.255.0
    [RouterA-ip-pool-p1] gateway-list 10.1.1.111
    [RouterA-ip-pool-p1] excluded-ip-address 10.1.1.2
    [RouterA-ip-pool-p1] quit
    [RouterA] interface gigabitethernet 2/0/0
    [RouterA-GigabitEthernet2/0/0] dhcp select global
    [RouterA-GigabitEthernet2/0/0] quit

    # Configure the DHCP server function on RouterB.

    [RouterB] dhcp enable
    [RouterB] ip pool p1
    [RouterB-ip-pool-p1] network 10.1.1.0 mask 255.255.255.0
    [RouterB-ip-pool-p1] gateway-list 10.1.1.111
    [RouterB-ip-pool-p1] excluded-ip-address 10.1.1.1
    [RouterB-ip-pool-p1] quit
    [RouterB] interface gigabitethernet 2/0/0
    [RouterB-GigabitEthernet2/0/0] dhcp select global
    [RouterB-GigabitEthernet2/0/0] quit

  5. Verify the configuration.

    # After the configuration is complete, run the display vrrp command on RouterA and RouterB. The command output shows that the status of RouterA is Master and that of RouterB is Backup.

    [RouterA] display vrrp
      GigabitEthernet2/0/0 | 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 : 2015-01-22 19:00:51                                                                                               
        Last change time : 2015-01-22 19:00:55 
    [RouterB] display vrrp
      GigabitEthernet2/0/0 | 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 : 2015-01-22 19:12:23                                                                                               
        Last change time : 2015-01-22 19:12:23 

    # Run the display ip pool command on RouterA and SwitchB to view IP address allocation of the address pools. The command output shows that RouterA functioning as the active device has allocated IP addresses for the DHCP clients, and SwitchB functioning as the standby device does not allocate IP addresses for the DHCP clients.

    [RouterA] display ip pool name p1
      Pool-name        : p1                                                                                                               
      Pool-No        : 0                                                                                                                
      Lease            : 1 Days 0 Hours 0 Minutes                                                                                         
      Domain-name      : -                                                                                                                
      DNS-server0      : -                                                                                                                
      NBNS-server0     : -                                                                                                                
      Netbios-type     : -                                                                                                                
      Position         : Local           Status           : Unlocked                                                                      
      Gateway-0        : 10.1.1.111                                                                                                       
      Network          : 10.1.1.0                                                                                                         
      Mask             : 255.255.255.0                                                                                                    
      VPN instance     : --                                                                                                               
      Logging          : Disable                                                    
      Conflicted address recycle interval: --                 
      Address Statistic: Total       :253       Used        :10                     
                         Idle        :242       Disable     :1                      
                                                                                    
     -------------------------------------------------------------------------------
      Network section                                                               
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
            10.1.1.1      10.1.1.254     253      10        242(0)       0     1    
     -------------------------------------------------------------------------------
    [RouterB] display ip pool name p1
      Pool-name        : p1                                                                                                               
      Pool-No          : 0                                                                                                                
      Lease            : 1 Days 0 Hours 0 Minutes                                                                                         
      Domain-name      : -                                                                                                                
      DNS-server0      : -                                                                                                                
      NBNS-server0     : -                                                                                                                
      Netbios-type     : -                                                                                                                
      Position         : Local           Status           : Unlocked                                                                      
      Gateway-0        : 10.1.1.111                                                                                                       
      Network          : 10.1.1.0                                                                                                         
      Mask             : 255.255.255.0                                                                                                    
      VPN instance     : --                                                                                                               
      Logging          : Disable                                                                                                          
      Conflicted address recycle interval: --                 
      Address Statistic: Total       :253       Used        :10                     
                         Idle        :242       Disable     :1                      
                                                                                    
     -------------------------------------------------------------------------------
      Network section                                                               
             Start           End       Total    Used Idle(Expired) Conflict Disabled
     -------------------------------------------------------------------------------
            10.1.1.1      10.1.1.254     253      10        242(0)       0     1    
     -------------------------------------------------------------------------------

    # Run the undo shutdown command on GE2/0/0 of RouterA to simulate a fault of RouterA. After 20 seconds, run the display vrrp command on RouterA and RouterB to view the VRRP status. The command output shows that the status of RouterA changes to Initialize and that of RouterB to Master. Then the new hosts or hosts with lease renewal obtain IP addresses from RouterB.

Configuration Files

  • RouterA configuration file

    #
     sysname RouterA
    #
    dhcp enable                                                                                                                         
    #
    ip pool p1                                                                                                                          
     gateway-list 10.1.1.111                                                                                                            
     network 10.1.1.0 mask 255.255.255.0                                                                                                
     excluded-ip-address 10.1.1.2                                                                                                       
    # 
    interface GigabitEthernet1/0/0
     ip address 192.168.1.1 255.255.255.0
    #
    interface GigabitEthernet2/0/0
     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
    #
    hsb-service 0
     service-ip-port local-ip 192.168.1.1 peer-ip 192.168.1.2 local-data-port 10241 peer-data-port 10241
    #
    hsb-group 0
     track vrrp vrid 1 interface GigabitEthernet2/0/0
     bind-service 0
     hsb enable
    #
    return
  • RouterB configuration file

    #
     sysname RouterB
    #
    dhcp enable                                                                                                                         
    #
    ip pool p1                                                                                                                          
     gateway-list 10.1.1.111                                                                                                            
     network 10.1.1.0 mask 255.255.255.0                                                                                                
     excluded-ip-address 10.1.1.1 
    #
    interface GigabitEthernet1/0/0
     ip address 192.168.2.1 255.255.255.0
    #
    interface GigabitEthernet2/0/0
     ip address 10.1.1.2 255.255.255.0
     vrrp vrid 1 virtual-ip 10.1.1.111
     dhcp select global
    #
    hsb-service 0
     service-ip-port local-ip 192.168.1.2 peer-ip 192.168.1.1 local-data-port 10241 peer-data-port 10241
    #
    hsb-group 0
     track vrrp vrid 1 interface GigabitEthernet2/0/0
     bind-service 0
     hsb enable
    #
    return
  • Switch configuration file

    #
    sysname Switch
    #
    vlan batch 100
    #
    interface GigabitEthernet0/0/1
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    interface GigabitEthernet0/0/2
     port hybrid pvid vlan 100
     port hybrid untagged vlan 100
    #
    return
Translation
Download
Updated: 2019-03-06

Document ID: EDOC1100069333

Views: 32350

Downloads: 157

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next