Example for Configuring a BOOTP Client
Networking Requirements
As shown in Figure 3-18, RouterA functions as the BOOTP client to dynamically obtain information including the IP address, DNS server address, and gateway address from the DHCP server (RouterB).
Configuration Roadmap
The configuration roadmap is as follows:
- Configure RouterA as the BOOTP client to dynamically obtain the IP address from the DHCP server.
- Create a global address pool on RouterB and set corresponding attributes.
Procedure
- Configure the BOOTP client function on RouterA.
# Enable the BOOTP client function on GE0/0/1.
<Huawei> system-view [Huawei] sysname RouterA [RouterA] interface gigabitethernet 0/0/1 [RouterA-GigabitEthernet0/0/1] ip address bootp-alloc
- Create a global address pool on RouterB and set corresponding attributes.
# Enable DHCP.
<Huawei> system-view [Huawei] sysname RouterB [RouterB] dhcp enable [RouterB] dhcp server bootp [RouterB] dhcp server bootp automatic
# Configure GE0/0/1 to work in global address pool mode.
[RouterB] interface gigabitethernet 0/0/1 [RouterB-GigabitEthernet0/0/1] ip address 192.168.1.1 24 [RouterB-GigabitEthernet0/0/1] dhcp select global [RouterB-GigabitEthernet0/0/1] quit
# Create an address pool and set corresponding attributes.
[RouterB] ip pool pool1 [RouterB-ip-pool-pool1] network 192.168.1.0 mask 24 [RouterB-ip-pool-pool1] gateway-list 192.168.1.1 [RouterB-ip-pool-pool1] dns-list 192.168.2.2 [RouterB-ip-pool-pool1] quit
- Verify the configuration.
# On interface GE0/0/1, run the display this command to view the BOOTP client configuration.
[RouterA] interface gigabitethernet 0/0/1 [RouterA-GigabitEthernet0/0/1] display this # interface GigabitEthernet0/0/1 ip address bootp-alloc # return [RouterA-GigabitEthernet0/0/1] quit
# After GE0/0/1 obtains an IP address, run the display dhcp client command on RouterA to view the status of the BOOTP client on GE0/0/1.
[RouterA] display dhcp client BOOTP client lease information on interface GigabitEthernet0/0/1 : Current machine state : Bound Internet address assigned via : BOOTP Physical address : 00e0-fcf7-310f IP address : 192.168.1.254 Subnet mask : 255.255.255.0 Gateway ip address : 192.168.1.1 Lease obtained at : 2015-02-10 16:03:43 DNS : 192.168.2.2
# Run the display ip pool name pool1 command on RouterB to view the address pool configuration. The Used field displays the number of used IP addresses in an address pool.
[RouterB] display ip pool name pool1 Pool-name : pool1 Pool-No : 5 Lease : 1 Days 0 Hours 0 Minutes Domain-name : - DNS-server0 : 192.168.2.2 NBNS-server0 : - Netbios-type : - Position : Local Status : Unlocked Gateway-0 : 192.168.1.1 Network : 192.168.1.0 Mask : 255.255.255.0 VPN instance : -- Logging : Disable Conflicted address recycle interval: -- Address Statistic: Total :253 Used :1 Idle :252 Expired :0 Conflict :0 Disable :0 ------------------------------------------------------------------------------- Network section Start End Total Used Idle(Expired) Conflict Disabled ------------------------------------------------------------------------------- 192.168.1.1 192.168.1.254 253 1 252(0) 0 0 -------------------------------------------------------------------------------
Configuration Files
RouterA configuration file
# sysname RouterA # interface GigabitEthernet0/0/1 ip address bootp-alloc # return
RouterB configuration file
# sysname RouterB # dhcp enable # dhcp server bootp automatic # ip pool pool1 gateway-list 192.168.1.1 network 192.168.1.0 mask 255.255.255.0 dns-list 192.168.2.2 # interface GigabitEthernet0/0/1 ip address 192.168.1.1 255.255.255.0 dhcp select global # return