Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Download PNETLab Platform

PNETLAB Store
PNETLab.com

DHCP Relay

Lab Topology:
Please use the following topology to complete this lab exercise:

https://user.pnetlab.com/store/labs/detail?id=16059478386279

Lab Objective:
The objective of this lab exercise is for you to learn and understand how can you configure
DHCP Relay

Task list:
Task 1: Configure the hostname and IP address for Routers as topo.
Task 2: Configure OSPF Area 1 routing in R2,R3,R4
Task 3: Configure DHCP client on R1 and DHCP Server on R4.
Task 4: Configure DHCP Relay and turn on debug dhcp packet on R2 to understand DHCP Relay
function.

SOLUTION:
Task 1: Configure the hostname and IP address for Routers as topo.
On R2
!
interface Ethernet0/0
ip address 192.168.1.1 255.255.255.0
!
interface Ethernet0/1
ip address 10.1.23.2 255.255.255.0
!
1
Download PNETLab Platform
PNETLAB Store
PNETLab.com

On R3
!
interface Ethernet0/0
ip address 10.1.34.3 255.255.255.0
!
interface Ethernet0/1
ip address 10.1.23.3 255.255.255.0
!
On R4
!
interface Loopback0
ip address 4.4.4.4 255.255.255.0
!
interface Ethernet0/0
ip address 10.1.34.4 255.255.255.0
!
Task 2: Configure OSPF Area 1 routing in R2,R3,R4
On R2
!
router ospf 1
network 10.1.23.0 0.0.0.255 area 0
network 192.168.1.0 0.0.0.255 area 0
!
On R3
!
router ospf 1
network 10.1.23.0 0.0.0.255 area 0
network 10.1.34.0 0.0.0.255 area 0
!
On R4
!
router ospf 1
network 4.4.4.4 0.0.0.0 area 0
network 10.1.34.0 0.0.0.255 area 0
!
//So, R2 could reach to interface loopback 0 of R4 via OSPF.
Task 3: Configure DHCP client on R1 and DHCP Server on R4.
On R1
!
interface Ethernet0/0
ip address dhcp
!
On R4
!

2
Download PNETLab Platform
PNETLAB Store
PNETLab.com

ip dhcp excluded-address 192.168.1.1


!
ip dhcp pool DHCP
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
!
//We could recognize that DHCP Client and DHCP Server do not connect to each other directly.
In some case, we could not deploy the DHCP Server connect directly to DHCP Client and need to
move DHCP Server to other place. We need to remember, DHCP Client send broadcast DHCP
Discovery to find DHCP Server. But broadcast could not forward between Router. So what is the
solution ? DHCP Relay will help us. On other hand, after R2 receive DHCP Discovery from R1. It
will generate a unicast DHCP Discovery to DHCP Server. After DHCP Server assign the IP Address
for R2. R2 will pass this IP address for R1.

Task 4: Configure DHCP Relay and turn on debug dhcp packet on R2 to understand DHCP Relay
function.
On R2
!
interface Ethernet0/0
ip helper-address 4.4.4.4
!
//R2 will pass the DHCP packet from R1 to DHCP Server in 4.4.4.4

*Nov 15 11:38:15.891: DHCPD: Reload workspace interface Ethernet0/0


tableid 0.
*Nov 15 11:38:15.891: DHCPD: tableid for 192.168.1.1 on Ethernet0/0 is
0
*Nov 15 11:38:15.891: DHCPD: client's VPN is .
*Nov 15 11:38:15.891: DHCPD: Finding a relay for client
0063.6973.636f.2d61.6162.622e.6363.3030.2e32.3330.302d.4574.302f.30 on
interface Ethernet0/0.
*Nov 15 11:38:15.891: DHCPD: Looking up binding using address
192.168.1.1
*Nov 15 11:38:15.891: DHCPD: setting giaddr to 192.168.1.1.
*Nov 15 11:38:15.891: DHCPD: BOOTREQUEST from
0063.6973.636f.2d61.6162.622e.6363.3030.2e32.3330.302d.4574.302f.30
forwarded to 4.4.4.4.
*Nov 15 11:38:15.892: DHCPD: Reload workspace interface Ethernet0/1
tableid 0.
*Nov 15 11:38:15.892: DHCPD: tableid for 10.1.23.2 on Ethernet0/1 is 0
*Nov 15 11:38:15.892: DHCPD: client's VPN is .
R2#
*Nov 15 11:38:15.892: DHCPD: forwarding BOOTREPLY to client
0063.6973.636f.2d61.6162.622e.6363.3030.2e32.3330.302d.4574.302f.30.
3
Download PNETLab Platform
PNETLAB Store
PNETLab.com

*Nov 15 11:38:15.892: DHCPD: broadcasting BOOTREPLY to client


aabb.cc00.2300.

R4#show ip dhcp binding


Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
State Interface
Hardware address/
User name
192.168.1.2 0063.6973.636f.2d61. Nov 22 2020 09:59 AM
Automatic Active Unknown
6162.622e.6363.3030.
2e32.3330.302d.4574.
302f.30

R1#show ip int br | include up


Ethernet0/0 192.168.1.2 YES DHCP up
up

//Following the log and IP address on R1. We could understand the DHCP Relay function.

You might also like