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

CX11x, CX31x, CX710 (Earlier Than V6.03), and CX91x Series Switch Modules V100R001C10 Configuration Guide 12

The documents describe the configuration of various services supported by the CX11x&CX31x&CX91x series switch modules The description covers configuration examples and function configurations.
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).
Configuration Examples

Configuration Examples

This section provides DHCP configuration examples including networking requirements and configuration roadmap.

Example for Configuring a DHCP Server Based on the Global Address Pool

Networking Requirements

As shown in Figure 6-34, an enterprise has two offices on the same network segment. To reduce network construction cost, the enterprise uses one DHCP server to assign IP addresses for hosts in the two offices.

All the hosts in Office1 are on the network segment 10.1.1.0/25 and added to VLAN 10. Hosts in Office1 only use the DNS service with a lease of ten days. All the hosts in Office2 are on the network segment 10.1.1.128/25 and added to VLAN 20. Hosts in Office2 use the DNS service and NetBIOS service with a lease of two days.

You can configure a global address pool on SwitchB and enable the server to dynamically assign IP addresses to hosts in the two offices.

Figure 6-34 Networking diagram for configuring a DHCP server based on the global address pool
Configuration Roadmap

The configuration roadmap is as follows:

  1. Create two global address pools on SwitchB and set attributes of the pools. Assign IP addresses to Office1 and Office2 as required.
  2. Configure VLANIF interfaces to use the global address pool to assign IP addresses to clients.

Procedure

  1. Enable DHCP.

    <Huawei> system-view
    [~Huawei] sysname SwitchB
    [*Huawei] commit
    [~SwitchB] dhcp enable
    [*SwitchB] commit

  2. Create address pools and set the attributes of the address pools.

    # Set the attributes of IP address pool 1, including the address pool range, DNS server address, gateway address, and address lease.

    [~SwitchB] ip pool pool1
    [*SwitchB-ip-pool-pool1] gateway-list 10.1.1.1
    [*SwitchB-ip-pool-pool1] network 10.1.1.0 mask 255.255.255.128
    [*SwitchB-ip-pool-pool1] dns-list 10.1.1.2
    [*SwitchB-ip-pool-pool1] excluded-ip-address 10.1.1.2
    [*SwitchB-ip-pool-pool1] excluded-ip-address 10.1.1.4
    [*SwitchB-ip-pool-pool1] lease day 10
    [*SwitchB-ip-pool-pool1] commit
    [~SwitchB-ip-pool-pool1] quit

    # Set the attributes of IP address pool 2, including the address pool range, DNS server address, egress gateway address, NetBIOS server address, and address lease.

    [~SwitchB] ip pool pool2
    [*SwitchB-ip-pool-pool2] gateway-list 10.1.1.129
    [*SwitchB-ip-pool-pool2] network 10.1.1.128 mask 255.255.255.128
    [*SwitchB-ip-pool-pool2] dns-list 10.1.1.2
    [*SwitchB-ip-pool-pool2] nbns-list 10.1.1.4
    [*SwitchB-ip-pool-pool2] lease day 2
    [*SwitchB-ip-pool-pool2] commit
    [~SwitchB-ip-pool-pool2] quit

  3. Set the address assignment mode on the VLANIF interfaces.

    # Add 10GE1/17/1 and 10GE1/17/2 to the corresponding VLANs.

    [~SwitchB] vlan batch 10 20
    [*SwitchB] interface 10ge 1/17/1 
    [*SwitchB-10GE1/17/1] port link-type trunk
    [*SwitchB-10GE1/17/1] port trunk allow-pass vlan 10
    [*SwitchB-10GE1/17/1] commit
    [~SwitchB-10GE1/17/1] quit
    [~SwitchB] interface 10ge 1/17/2 
    [~SwitchB-10GE1/17/2] port link-type trunk
    [*SwitchB-10GE1/17/2] port trunk allow-pass vlan 20
    [*SwitchB-10GE1/17/2] commit
    [~SwitchB-10GE1/17/2] quit
    

    # Configure an IP address for VLANIF10.

    [~SwitchB] interface vlanif 10
    [*SwitchB-Vlanif10] ip address 10.1.1.1 255.255.255.128
    [*SwitchB-Vlanif10] commit
    [~SwitchB-Vlanif10] quit

    # Configure an IP address for VLANIF20.

    [~SwitchB] interface vlanif 20
    [*SwitchB-Vlanif20] ip address 10.1.1.129 255.255.255.128
    [*SwitchB-Vlanif20] commit
    [~SwitchB-Vlanif20] quit

  4. Verify the configuration.

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

    [~SwitchB] display ip pool
     -----------------------------------------------------------------------------  
      Pool name      : pool1                                                        
      Pool number    : 0                                                           
      Position       : Local           Status           : Unlocked               
      Gateway        : 10.1.1.1                                                 
      Mask           : 255.255.255.128                                          
      VPN instance   : --                                                       
                                                                                
     ----------------------------------------------------------------------------- 
      Pool name      : pool2                                                      
      Pool number    : 1                                                           
      Position       : Local           Status           : Unlocked             
      Gateway        : 10.1.1.129                                              
      Mask           : 255.255.255.128                                     
      VPN instance   : --                                                
                                                                           
                                                                          
      IP address Statistic                                                
        Total       :250                                                  
        Used        :6          Idle        :242        Expired     :0     
        Conflict    :0          Disable   :2     
    

Configuration Files

Configuration file of SwitchB

#
sysname SwitchB
#
vlan batch 10 20
#
dhcp enable
#
ip pool pool1
 gateway-list 10.1.1.1
 network 10.1.1.0 mask 255.255.255.128
 lease day 10 hour 0 minute 0
 dns-list 10.1.1.2
 excluded-ip-address 10.1.1.2
 excluded-ip-address 10.1.1.4
#
ip pool pool2
 gateway-list 10.1.1.129
 network 10.1.1.128 mask 255.255.255.128
 lease day 2 hour 0 minute 0
 dns-list 10.1.1.2
 nbns-list 10.1.1.4
#
interface Vlanif10
 ip address 10.1.1.1 255.255.255.128
#
interface Vlanif20
 ip address 10.1.1.129 255.255.255.128
#
interface 10GE1/17/1
 port link-type trunk
 port trunk allow-pass vlan 10
#
interface 10GE1/17/2
 port link-type trunk
 port trunk allow-pass vlan 20
#
return

Example for Configuring a DHCP Relay Agent

Networking Requirements

As shown in Figure 6-35, an enterprise uses a DHCP server to assign IP addresses to servers in the data center. The server at 20.20.20.0/24 is used as an example to describe how to configure a DHCP relay agent.

The enterprise client is on the network segment 20.20.20.0/24, and the DHCP server is on the network segment 100.10.10.0/24. The DHCP clients can obtain IP addresses from the DHCP server through SwitchA enabled with DHCP relay.

The uplink interface of SwitchA is 10GE1/17/2, the public address of VLANIF 200 is 100.10.20.1/24, and the interface address of SwitchA connected to the carrier device is 100.10.20.2/24.

The public address of the DHCP server is 100.10.10.1/24 and the interface address of the DHCP server connected to the carrier device is 100.10.10.2/24.

Figure 6-35 DHCP relay agent

Configuration Roadmap

The configuration roadmap is as follows:

  1. Configure DHCP relay on SwitchA to enable SwitchA to forward DHCP messages from different network segments.

Procedure

  1. Add 10GE1/17/2 on SwitchA to VLAN 200.

    <Huawei> system-view
    [~Huawei] sysname SwitchA
    [*Huawei] commit
    [~SwitchA] vlan batch 200
    [*SwitchA] interface 10ge 1/17/2
    [*SwitchA-10GE1/17/2] port link-type trunk
    [*SwitchA-10GE1/17/2] port trunk allow-pass vlan 200
    [*SwitchA-10GE1/17/2] quit
    [*SwitchA] interface vlanif 200
    [*SwitchA-Vlanif200] ip address 100.10.20.1 24
    [*SwitchA-Vlanif200] quit
    [*SwitchA] commit

  2. Configure the DHCP relay function on SwitchA.
    1. Create a DHCP server group and add DHCP servers to the group.

      # Create a DHCP server group.

      [~SwitchA] dhcp relay server group dhcpgroup1

      # Add a DHCP server to the DHCP server group.

      [*SwitchA-dhcp-relay-server-group-dhcpgroup1] server 100.10.10.1
      [*SwitchA-dhcp-relay-server-group-dhcpgroup1] quit
      [*SwitchA] commit

    2. Enable DHCP relay on the interface.

      # Create a VLAN and add 10GE1/17/1 to the VLAN.

      [~SwitchA] vlan batch 100
      [*SwitchA] interface 10ge 1/17/1
      [*SwitchA-10GE1/17/1] port default vlan 100
      [*SwitchA-10GE1/17/1] quit
      [*SwitchA] commit

      # Enable DHCP globally and DHCP relay on the interface.

      [~SwitchA] dhcp enable
      [*SwitchA] interface vlanif 100
      [*SwitchA-Vlanif100] dhcp select relay 
      [*SwitchA-Vlanif100] quit
      [*SwitchA] commit

    3. Bind an interface to a DHCP server group.

      # Assign IP addresses to interfaces.

      [~SwitchA] interface vlanif 100
      [*SwitchA-Vlanif100] ip address 20.20.20.1 24

      Bind the interface to the DHCP server group.

      [*SwitchA-Vlanif100] dhcp relay binding server group dhcpgroup1
      [*SwitchA-Vlanif100] quit
      [*SwitchA] commit

  3. Configure a default route on SwitchA.

    [~SwitchA] ip route-static 0.0.0.0 0.0.0.0 100.10.20.2
    [*SwitchA] commit
    

  4. Verify the configuration.

    # Run the display dhcp relay command on SwitchA to view the DHCP relay configuration on the interface.

    [~SwitchA] display dhcp relay interface vlanif 100
     DHCP relay agent running information of interface Vlanif100 :                  
     Server group name          : dhcpgroup1                                        
     Gateway address in use     : 20.20.20.1                                        
                  
    

Configuration Files
Configuration file of SwitchA
#
sysname SwitchA
#
vlan batch 100 200
#
dhcp enable
#
dhcp relay server group dhcpgroup1
 server 100.10.10.1 0
#
interface Vlanif100
 ip address 20.20.20.1 255.255.255.0
 dhcp select relay
 dhcp relay binding server group dhcpgroup1
#
interface Vlanif200
 ip address 100.10.20.1 255.255.255.0
#
interface 10GE1/17/1
 port default vlan 100
#
interface 10GE1/17/2
 port link-type trunk
 port trunk allow-pass vlan 200
#
ip route-static 0.0.0.0 0.0.0.0 100.10.20.2
#                                                                               
return
Translation
Download
Updated: 2019-08-09

Document ID: EDOC1000041694

Views: 59650

Downloads: 3623

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