Using DHCP and IP Helper Addresses
Routers Used: 3640 w/ NM-4T and NM-1FE-TX modules
IOS: c3640-jk9s-mz.124-16a
Objective
- In this lab, configure a Cisco router to act as a DHCP server for clients on two separate subnets. The IP helper address feature will also be used to forward DHCP requests from a remote subnet.
- Clients on the 192.168.3.0/24 network and the 10.0.0.0/8 network require the services of DHCP for automatic IP configuration. Configure Aristo serve both subnets by creating two separate address pools. Finally, configure the FastEthernet interface of the Arief router to forward UDP broadcasts, including DHCP requests, to Aris.
- Build and configure the network according to the diagram. Connect HostA and HostB as shown, but configure these clients to obtain their IP addresses automatically. Because these hosts rely on DHCP, they cannot be tested using ping until Step 5.
- Configure RIP v2 on Aris and Arief. Be sure to enable updates on all active interfaces with the network command:
Aris(config)#router rip
Aris(config)#version 2
Aris(config-router)#network 192.168.1.0
Aris(config-router)#network 10.0.0.0
Aris(config)#router rip
Arief(config-router)#version 2
Arief(config-router)#network 192.168.1.0
Arief(config-router)#network 192.168.3.0 - Use ping and show ip route to verify the work and test connectivity between Aris and Arief.
- Configure Aris to act as a DHCP server for clients on the 10.0.0.0/8 network.
First, verify that Aris can use DHCP services and that it is enabled:Aris(config)#service dhcp
- Next, configure the DHCP address pool for the 10.0.0.0 network. Name the pool 10-net:
Aris(config)#ip dhcp pool 10-net
Aris(dhcp-config)#network 10.0.0.0 255.0.0.0
- International Travel Agency uses the first ten addresses in this address range to statically address servers and routers. From global configuration mode, exclude addresses from the DHCP pool so that the server does not attempt to assign them to clients. Configure Aris to dynamically assign addresses from the 10-net pool, starting with 10.0.0.11:
Aris(config)#ip dhcp excluded-address 10.0.0.1 10.0.0.10
- Return to DHCP configuration mode and assign the IP options of the default gateway address, DNS server address, WINS server address, and domain name:
Aris(dhcp-config)#default-router 10.0.0.1
Aris(dhcp-config)#dns-server 10.0.0.3
Aris(dhcp-config)#netbios-name-server 10.0.0.4
Aris(dhcp-config)#domain-name dion.co.id
- The DHCP server is now ready to be tested. Release and renew the IP configuration for HostA.
HostA should be dynamically assigned the first available address in the pool, which is 10.0.0.11. Check the configuration of HostA with dhcp to verify that it received the proper IP address, subnet mask, default gateway. But DNS server address and WINS server address is not shown because this Lab uses virtual pc. Check the configuration of HostA with dhcp and showVPCS 4 >dhcp
DDORA, IP 10.0.0.12/8 GW 10.0.0.1
VPCS 4 >show
NAME IP/CIDR GATEWAY MAC LPORT RPORT
PC1 192.168.1.66/27 192.168.1.65 00:50:79:66:68:00 20000 30000
PC2 192.168.1.35/27 192.168.1.34 00:50:79:66:68:01 20001 30001
PC3 192.168.3.2/24 192.168.3.1 00:50:79:66:68:02 20002 30002
2001:2::1/64
PC4 10.0.0.12/8 10.0.0.1 00:50:79:66:68:03 20003 30003
2001:2::2/64
- Because HostB also requires dynamic IP configuration, create a second DHCP pool with address and gateway options appropriate to its network, 192.168.3.0/24:
Aris(config)#ip dhcp pool 192.168.3-net
Aris(dhcp-config)#network 192.168.3.0 255.255.255.0
Aris(dhcp-config)#default-router 192.168.3.1
Aris(dhcp-config)#dns-server 10.0.0.3
Aris(dhcp-config)#netbios-name-server 10.0.0.4
Aris(dhcp-config)#domain-name dion.co.id
- The configuration of the DHCP server is now complete. However, HostB uses a UDP broadcast to find an IP address, and Arief is not configured to forward broadcasts. In order for DHCP to work, configure the FastEthernet interface of the Arief router to forward UDP broadcasts to Aris:
Arief(config)#interface fastethernet 1/0
Arief(config-if)#ip helper-address 192.168.1.2
- Verify virtual PC, using dhcp or show, that HostB received the correct IP configuration.
VPCS 3 >dhcp
DORA, IP 192.168.3.2/24 GW 192.168.3.1
VPCS 3 >show
NAME IP/CIDR GATEWAY MAC LPORT RPORT
PC1 192.168.1.66/27 192.168.1.65 00:50:79:66:68:00 20000 30000
PC2 192.168.1.35/27 192.168.1.34 00:50:79:66:68:01 20001 30001
PC3 192.168.3.2/24 192.168.3.1 00:50:79:66:68:02 20002 30002
2001:2::1/64 - An ip dhcp excluded-address command was not issued. The DHCP server did not
assign HostB 192.168.3.1. Why not? - Issue show ip dhcp ? and note the choices.
Aris#show ip dhcp ?
binding DHCP address bindings
conflict DHCP address conflicts
database DHCP database agents
import Show Imported Parameters
relay Miscellaneous DHCP relay information
server Miscellaneous DHCP server information - Try the conflict and binding options.
Aris#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
10.0.0.12 0050.7966.6803.ff Mar 02 2002 12:19 AM Automatic
192.168.3.2 0050.7966.6802.ff Mar 02 2002 12:02 AM Automatic
Aris#sh ip dhcp conflict
IP address Detection method Detection time VRF
192.168.3.1 Ping Mar 01 2002 12:02 AM - How did Aris know to assign HostB an address from the 3-net pool and not the 10-net pool?
Aris#show ip dhcp server statistics
Memory usage 26690
Address pools 2
Database agents 0
Automatic bindings 2
Manual bindings 0
Expired bindings 0
Malformed messages 0
Secure arp entries 0
Message Received
BOOTREQUEST 0
DHCPDISCOVER 6
DHCPREQUEST 3
DHCPDECLINE 0
DHCPRELEASE 0
DHCPINFORM 0
Message Sent
BOOTREPLY 0
DHCPOFFER 5
DHCPACK 3
DHCPNAK 0