VIDEO CHAPTERS:
0:00 Introduction
1:41 Prerequisites
6:10 Configuration
7:54 Testing and Verification
11:59 Conclusion
How to Configure DHCP Relay Agent on Cisco IOS
DHCP Relay Agent Overview
A DHCP relay agent is any host that forwards DHCP packets between clients and servers.
Relay agents are used to forward requests and replies between clients and servers when they are not on the same physical subnet.
Relay agent forwarding is distinct from the normal forwarding of an IP device, where IP datagrams are switched between networks somewhat transparently.
By contrast, relay agents receive DHCP messages and then generate a new DHCP message to send out on another interface.
The relay agent sets the gateway IP address (giaddr field of the DHCP packet) and, if configured, adds the relay agent information option (option82) in the packet and forwards it to the DHCP server.
The reply from the server is forwarded back to the client after removing option 82.
Prerequisites
1. The Cisco IOS DHCP server and relay agent are enabled by default. If it's disable, use command service dhcp to enable it.
2. The Cisco IOS DHCP relay agent will be enabled on an interface only when the ip helper-address command is configured.
This command enables the DHCP broadcast to be forwarded to the configured DHCP server.
Configuration:
DHCP_Server:
conf t
int GigabitEthernet0/1
ip address 192.168.2.1 255.255.255.0
!
ip route 192.168.1.0 255.255.255.0 192.168.2.2
!
ip dhcp excluded-address 192.168.1.250 192.168.1.254
ip dhcp pool 1
network 192.168.1.0 255.255.255.0
domain-name cisco.com
dns-server 8.8.8.8
default-router 192.168.1.254
end
wr
DHCP_Relay_Agent:
conf t
int GigabitEthernet0/0
ip address 192.168.1.254 255.255.255.0
ip helper-address 192.168.2.1
!
int GigabitEthernet0/1
ip address 192.168.2.2 255.255.255.0
end
wr
Client:
conf t
int GigabitEthernet0/0
ip address dhcp
end
wr
Verification:
1. show run int g0/0
2. show ip int g0/0 | inc Helper
3. debug ip dhcp server packet
4. Check if client has received a DHCP IP
4. show ip dhcp binding
Reference:
https://www.cisco.com/c/en/us/td/docs...
#cisco #ccna #ccnp #ccie