huawei AR19/29/49 router DHCP configuration

Download as PDF

Let’s assume that we have a topology like in the picture:

huawei AR DHCP topology

    1. IP addresses of ETH 0/1 and ETH 0/2 on Router A are 172.16.1.128/25 and 172.16.1.1/25 respectively.
    2. Router B (dhcp client) obtains static IP address, gateway address and DNS server address from DHCP server (router A). A MAC address of interface ETH 0/0 of router B is 0800-6902-01FC.
    3. DHCP server assigns IP addresses to clients in subnet 172.16.1.0/24 subnetted to 172.16.1.1/25 and 172.16.1.128/25.
    4. DNS server address and WINS server address are 172.16.1.10/25 and 172.16.1.200/25 respectively.
    5. For subnet 172.16.1.128/25 configure DNS server address, WINS server address, gateway address and address lease duration for 6 days and 6 hours.
    6. For subnet 172.16.1.1/25 configure DNS server address, gateway address and address lease duration for 10 days.

dhcp configuration

Assign IP addresses to interfaces of router A:

[RouterA] interface ethernet 0/1
[RouterA-Ethernet0/1] ip address 172.16.1.128 25
[RouterA-Ethernet0/1]quit
[RouterA] interface ethernet 0/2
[RouterA-Ethernet0/2] ip address 172.16.1.1 25

Configure DHCP server:

[RouterA] dhcp enable

Create DHCP address pool 1 with configured static binding, DNS and gateway addresses:

[RouterA] dhcp server ip-pool 1
[RouterA-dhcp-pool-1] static-bind ip-address 172.16.1.150
[RouterA-dhcp-pool-1] static-bind mac-address 0800-6902-01FC
[RouterA-dhcp-pool-1] dns-list 172.16.1.10
[RouterA-dhcp-pool-1] gateway-list 172.16.1.254

Exclude IP addresses of gateways, DNS and WINS servers from dynamic allocation:

[RouterA] dhcp server forbidden-ip 172.16.1.10
[RouterA] dhcp server forbidden-ip 172.16.1.200
[RouterA] dhcp server forbidden-ip 172.16.1.126
[RouterA] dhcp server forbidden-ip 172.16.1.254

Configure DHCP address pool 2 with address range and DNS server address:

[RouterA] dhcp server ip-pool 2
[RouterA-dhcp-pool-2] network 172.16.1.0 mask 255.255.255.0
[RouterA-dhcp-pool-2] dns-list 172.16.1.10

Configure DHCP address pool 3 with address range, gateway and lease duration (DNS address is inherited from ip-pool 2):

[RouterA] dhcp server ip-pool 3
[RouterA-dhcp-pool-3] network 172.16.1.1 mask 255.255.255.128
[RouterA-dhcp-pool-3] expired day 10
[RouterA-dhcp-pool-3] gateway-list 172.16.1.126

Configure DHCP address pool 4 with address range, WINS server address, gateway and lease duration (DNS address is inherited from ip-pool 2):

[RouterA] dhcp server ip-pool 4
[RouterA-dhcp-pool-4] network 172.16.1.128 mask 255.255.255.128
[RouterA-dhcp-pool-4] expired day 6 hour 6
[RouterA-dhcp-pool-4] gateway-list 172.16.1.254
[RouterA-dhcp-pool-4] nbns-list 172.16.1.200

After the whole configuration is completed Router B gets 172.16.1.150 IP address from DHCP server. All remaining DHCP clients obtain IP addresses and other network parameters from either 172.16.1.1/25 or 172.16.1.128/25 networks (depends on subnet which they reside in).
display dhcp server ip-in-use command shows IP addresses assigned to DHCP clients.

IP address allocation sequence:

  • The IP address manually bound to the client’s MAC address or ID
  • The IP address that was ever assigned to the client
  • The IP address designated by the Option 50 field in a DHCP-DISCOVER message
  • The first assignable IP address found in an extended or a common address pool
  • The IP address that was a conflict or passed its lease duration

Download as PDF

Advertisements

6 thoughts on “huawei AR19/29/49 router DHCP configuration

  1. Fabio Leandro

    Nice work!!
    Do you know how to do DHCP Relay in a interface on Huawei AR29-01? What´s commands was needs to do this?
    Thanks!

    Reply
  2. labnario Post author

    Fabio,
    Thanks for your feedback. I do not have AR29 router now to test it, but based on AR documentation, to configure DHCP relay, you should:
    1. Enable DHCP:
    dhcp enable
    2. Add DHCP server into DHCP server group:
    dhcp relay server-group 1 ip 10.10.10.10
    3. Enable DHCP relay agent on interface and bind this interface with DHCP server group:
    dhcp select relay
    dhcp relay server-select 1

    Reply
  3. Fabio Leandro

    Perfect!
    *** That’s right, it works perfectly! My router is…

    Huawei Versatile Routing Platform Software
    VRP Software, Version 5.20, Release 2104P02
    Copyright (c) 1998-2010 Huawei Tech. Co., Ltd. All rights reserved.
    Quidway AR29-01 …

    *** Below the complete configuration where the DHCP server is on another subnet with the IP 172.16.2.100.

    [GATEWAY1] dhcp enable
    [GATEWAY1] dhcp relay server-group 1 ip 172.16.2.100

    [GATEWAY1] interface Ethernet0/1
    [GATEWAY1-Ethernet0/1] description ***CONEXAO COM LAN***
    [GATEWAY1-Ethernet0/1] ip address 172.16.1.126 255.255.255.128
    [GATEWAY1-Ethernet0/1] dhcp select relay
    [GATEWAY1-Ethernet0/1] dhcp relay server-select 1

    *** And this can be checked using the following command “display dhcp relay statistic” …

    [GATEWAY1] display dhcp relay statistics
    Bad packets received: 0
    DHCP packets received from clients: 40
    DHCPDISCOVER packets received: 3
    DHCPREQUEST packets received: 13
    DHCPINFORM packets received: 24
    DHCPRELEASE packets received: 0
    DHCPDECLINE packets received: 0
    BOOTPREQUEST packets received: 0
    DHCP packets received from servers: 32
    DHCPOFFER packets received: 3
    DHCPACK packets received: 29
    DHCPNAK packets received: 0
    BOOTPREPLY packets received: 0
    DHCP packets relayed to servers: 40
    DHCPDISCOVER packets relayed: 3
    DHCPREQUEST packets relayed: 13
    DHCPINFORM packets relayed: 24
    DHCPRELEASE packets relayed: 0
    DHCPDECLINE packets relayed: 0
    BOOTPREQUEST packets relayed: 0
    DHCP packets relayed to clients: 32
    DHCPOFFER packets relayed: 3
    DHCPACK packets relayed: 29
    ….

    *** Thank you for your help and support and congratulations again for the articles.

    Regards,

    Fabio Leandro

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s