Sie sind auf Seite 1von 2

huawei AR19/29/49 router DHCP configuration

Posted on January 4, 2012

Lets assume that we have a topology like in the picture:

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 17 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-69020800 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 ess 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 rnet 0/1 [RouterA-Ethernet0/1] Ethernet0/1] ip address 172.16.1.128 25 [RouterA-Ethernet0/1]quit Ethernet0/1]quit [RouterA] interface ethernet 0/2 [RouterA-Ethernet0/2] 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] 1] static-bind static 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] [RouterA] [RouterA] [RouterA] dhcp dhcp dhcp dhcp server server server server forbidden-ip forbidden-ip forbidden-ip forbidden-ip 172.16.1.10 172.16.1.200 172.16.1.126 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 [RouterA-dhcp-pool-3] [RouterA-dhcp-pool-3] [RouterA-dhcp-pool-3] ip-pool 3 network 172.16.1.1 mask 255.255.255.128 expired day 10 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 [RouterA-dhcp-pool-4] [RouterA-dhcp-pool-4] [RouterA-dhcp-pool-4] [RouterA-dhcp-pool-4] ip-pool 4 network 172.16.1.128 mask 255.255.255.128 expired day 6 hour 6 gateway-list 172.16.1.254 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 clients 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

Das könnte Ihnen auch gefallen