7.4.1 Packet Tracer – Implement DHCPv4 – Instructions Answer

Packet Tracer Packet Tracer Labs Original source

7.4.1 Packet Tracer - Implement DHCPv4 Answers

Topology

7.4.1 Packet Tracer – Implement DHCPv4

Addressing Table

Device Interface IPv4 Address Subnet Mask Default Gateway
R1 G0/0 192.168.10.1 255.255.255.0 N/A
S0/0/0 10.1.1.1 255.255.255.252
R2 G0/0 192.168.20.1 255.255.255.0 N/A
G0/1 DHCP Assigned DHCP Assigned
S0/0/0 10.1.1.2 255.255.255.252
S0/0/1 10.2.2.2 255.255.255.252
R3 G0/0 192.168.30.1 255.255.255.0 N/A
S0/0/1 10.2.2.1 255.255.255.252
PC1 NIC DHCP Assigned DHCP Assigned DHCP Assigned
PC2 NIC DHCP Assigned DHCP Assigned DHCP Assigned
DNS Server NIC 192.168.20.254 255.255.255.0 192.168.20.1

Objectives

Scenario

As the network technician for your company, you are tasked with configuring a Cisco router as a DHCP server to provide dynamic allocation of addresses to clients on the network. You are also required to configure the edge router as a DHCP client so that it receives an IP address from the ISP network. Since the server is centralized, you will need to configure the two LAN routers to relay DHCP traffic between the LANs and the router that is serving as the DHCP server.

Instructions

Part 1: Configure a Router as a DHCP Server

Step 1: Configure the excluded IPv4 addresses.

Configure R2 to exclude the first 10 addresses from the R1 and R3 LANs. All other addresses should be available in the DHCP address pool.

Copy

R2(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10

R2(config)# ip dhcp excluded-address 192.168.30.1 192.168.30.10
Step 2: Create a DHCP pool on R2 for the R1 LAN.

a. Create a DHCP pool named R1-LAN. The pool name must match this value in order for you to get credit for your configuration.

Copy

R2(config)# ip dhcp pool R1-LAN

b. Configure the DHCP pool to include the network address, the default gateway, and the IP address of the DNS server.

Copy

R2(dhcp-config)# network 192.168.10.0 255.255.255.0

R2(dhcp-config)# default-router 192.168.10.1

R2(dhcp-config)# dns-server 192.168.20.254
Step 3: Create a DHCP pool on R2 for the R3 LAN.

a. Create a DHCP pool named R3-LAN (case-sensitive).

Copy

R2(config)# ip dhcp pool R3-LAN

b. Configure the DHCP pool to include the network address, the default gateway, and the IP address of the DNS server.

Copy

R2(dhcp-config)# network 192.168.30.0 255.255.255.0

R2(dhcp-config)# default-router 192.168.30.1

R2(dhcp-config)# dns-server 192.168.20.254

Part 2: Configure DHCP Relay

Step 1: Configure R1 and R3 as a DHCP relay agent.

R1:

Copy

R1(config)# interface gigabitethernet 0/0

R1(config-if)# ip helper-address 10.1.1.2

R3:

Copy

R3(config)# interface gigabitethernet 0/0

R3(config-if)# ip helper-address 10.2.2.2
Step 2: Set PC1 and PC2 to receive IP addressing information from DHCP.

Part 3: Configure R2 as a DHCP Client

Step 1: Configure the Gigabit Ethernet 0/1 interface on R2 to receive IP addressing from DHCP.

Copy

R2(config)# interface gigabitethernet 0/1

R2(config-if)# ip address dhcp
Step 2: Activate the interface.

Copy

R2(config-if)# no shutdown

Device Configs - Final

ROUTER R1

Copy

! ==============================================================

!--- 7.4.1 Packet Tracer - Implement DHCPv4

!--- ANSWER SCRIPT FOR ROUTER R1

!--- Usage: copy this whole file and paste it into the R1 terminal (start at the R1> prompt). Every line beginning with "!" is a comment; IOS ignores it, so pasting a comment by accident is harmless.

! ==============================================================



enable

configure terminal



! --------------------------------------------------------------

!--- Part 2: Configure DHCP Relay.

! --------------------------------------------------------------



!--- Step 1. Helper address on the LAN interface: R2 S0/0/0 (10.1.1.2), so PC1 DHCP requests reach the R1-LAN pool on R2.

interface gigabitethernet 0/0

 ip helper-address 10.1.1.2

 exit



end



! --------------------------------------------------------------

!--- Save the configuration to NVRAM. (Press Enter when prompted for the destination filename.)

! --------------------------------------------------------------

copy running-config startup-config





! ==============================================================

!--- Verification:

!---   show running-config interface gigabitethernet 0/0 -> ip helper-address 10.1.1.2

!---   PC1 (DHCP)                    -> 192.168.10.11 or higher, gateway 192.168.10.1, DNS 192.168.20.254

! ==============================================================

ROUTER R2

Copy

! ==============================================================

!--- 7.4.1 Packet Tracer - Implement DHCPv4

!--- ANSWER SCRIPT FOR ROUTER R2

!--- Usage: copy this whole file and paste it into the R2 terminal (start at the R2> prompt). Every line beginning with "!" is a comment; IOS ignores it, so pasting a comment by accident is harmless.

! ==============================================================



enable

configure terminal



! --------------------------------------------------------------

!--- Part 1: Configure a Router as a DHCP Server.

! --------------------------------------------------------------



!--- Step 1. Exclude the first 10 addresses of the R1 and R3 LANs.

ip dhcp excluded-address 192.168.10.1 192.168.10.10

ip dhcp excluded-address 192.168.30.1 192.168.30.10



!--- Step 2. DHCP pool R1-LAN (exact name): network, default gateway and DNS server.

ip dhcp pool R1-LAN

 network 192.168.10.0 255.255.255.0

 default-router 192.168.10.1

 dns-server 192.168.20.254

 exit



!--- Step 3. DHCP pool R3-LAN (case-sensitive): network, default gateway and DNS server.

ip dhcp pool R3-LAN

 network 192.168.30.0 255.255.255.0

 default-router 192.168.30.1

 dns-server 192.168.20.254

 exit



! --------------------------------------------------------------

!--- Part 3: Configure R2 as a DHCP Client.

! --------------------------------------------------------------



!--- Step 1. G0/1 receives its IP addressing from the ISP by DHCP; Step 2. activate the interface.

interface gigabitethernet 0/1

 ip address dhcp

 no shutdown

 exit



end



! --------------------------------------------------------------

!--- Save the configuration to NVRAM. (Press Enter when prompted for the destination filename.)

! --------------------------------------------------------------

copy running-config startup-config





! ==============================================================

!--- Verification:

!---   show ip interface brief       -> GigabitEthernet0/1 has a 209.165.200.x address, Method DHCP, up/up (use Fast Forward Time)

!---   show ip dhcp binding          -> one lease in 192.168.10.0/24 (PC1) and one in 192.168.30.0/24 (PC2)

! ==============================================================

ROUTER R3

Copy

! ==============================================================

!--- 7.4.1 Packet Tracer - Implement DHCPv4

!--- ANSWER SCRIPT FOR ROUTER R3

!--- Usage: copy this whole file and paste it into the R3 terminal (start at the R3> prompt). Every line beginning with "!" is a comment; IOS ignores it, so pasting a comment by accident is harmless.

! ==============================================================



enable

configure terminal



! --------------------------------------------------------------

!--- Part 2: Configure DHCP Relay.

! --------------------------------------------------------------



!--- Step 1. Helper address on the LAN interface: R2 S0/0/1 (10.2.2.2), so PC2 DHCP requests reach the R3-LAN pool on R2.

interface gigabitethernet 0/0

 ip helper-address 10.2.2.2

 exit



end



! --------------------------------------------------------------

!--- Save the configuration to NVRAM. (Press Enter when prompted for the destination filename.)

! --------------------------------------------------------------

copy running-config startup-config





! ==============================================================

!--- Verification:

!---   show running-config interface gigabitethernet 0/0 -> ip helper-address 10.2.2.2

!---   PC2 (DHCP)                    -> 192.168.30.11 or higher, gateway 192.168.30.1, DNS 192.168.20.254

! ==============================================================

Download Packet Tracer (.pka) file:

Icon

7.4.1 Packet Tracer - Implement DHCPv4.pka 888.89 KB 14010 downloads

...

Download

Previous Lab
7.2.10 Packet Tracer – Configure DHCPv4

Next Lab
9.3.3 Packet Tracer – HSRP Configuration Guide

← All Packet Tracer articles Home