About
DHCP Relay Agent
is the bridge between the client and the DHCP server. Through theDHCP Relay Agent
, clients’ broadcasts can be received across different network segments, allowing the DHCP server to successfully assign IP addresses to clients.
Infrastructure
Configure multiple
vlan
groups on a single router interface and assign IP addresses through the DHCP server across differentvlan
groups.
vLan | IP(Subnet) |
---|---|
vlan10 | 192.168.10.0/24 |
vlan20 | 192.168.20.0/24 |
vlan30 | 192.168.30.0/24 |
vlan40 | 192.168.40.0/24 |
PC1 in vlan10
PC2 in vlan20
PC3 in vlan30
PC0 in vlan40
DHCP Server (192.168.40.254) in vlan40, clients in all vlan (10, 20, 30, 40) can obtain IP addresses through the DHCP Server in vlan40.
DHCP Server Configuration
Set IP address to 192.168.40.254
Create 4 DHCP address pools corresponding to Vlan 10, Vlan 20, Vlan 30, and Vlan 40.
Router Configuration (Cisco 2911)
|
|
Enter
Global Configuration Mode
|
|
Select physical interface 0/0 and enable it
|
|
Configure sub-interface on physical interface 0/0
Configure 802.1Q protocol and assign
vlan10
Set interface IP address
ip address 192.168.10.1 255.255.255.0
|
|
Configure sub-interface on physical interface 0/0
Configure 802.1Q protocol and assign
vlan20
Set interface IP address
ip address 192.168.20.1 255.255.255.0
|
|
Configure sub-interface on physical interface 0/0
Configure 802.1Q protocol and assign
vlan30
Set interface IP address
ip address 192.168.30.1 255.255.255.0
|
|
Configure sub-interface on physical interface 0/0
Configure 802.1Q protocol and assign
vlan40
Set interface IP address
ip address 192.168.40.1 255.255.255.0
Configure IP Helper (DHCP Relay Agent)
|
|
Add the IP Helper (DHCP Relay Agent) to sub-interface 0/0.10, pointing to the DHCP Server at 192.168.40.254
|
|
Add the IP Helper (DHCP Relay Agent) to sub-interface 0/0.20, pointing to the DHCP Server at 192.168.40.254
|
|
Add the IP Helper (DHCP Relay Agent) to sub-interface 0/0.30, pointing to the DHCP Server at 192.168.40.254
|
|
Add the IP Helper (DHCP Relay Agent) to sub-interface 0/0.40, pointing to the DHCP Server at 192.168.40.254
|
|
Save
Switch Settings (Cisco 2960-24T)
Switch1
|
|
Enter
Global Configuration Mode
mode
|
|
Create 4 VLANs
|
|
Define ports g0/1 and g0/2 as Trunk mode (*all VLAN data is transmitted through this interface to the client device)
|
|
Assign ports f0/1-10 to Vlan10
|
|
Assign ports f0/11-20 to Vlan20
|
|
Save
Switch2
|
|
Enter
Global Configuration Mode
mode
|
|
Create 4 VLANs
|
|
Define port g0/2 as Trunk mode (* connect to port g0/2 of Switch1)
|
|
Assign ports f0/1-10 and f0/24 to Vlan40
|
|
Assign ports f0/11-20 to Vlan30
|
|
Save
Test DHCP IP Assignment
Now, we can test the DHCP IP assignment by setting the PCs in each VLAN to obtain IP addresses automatically.
If the configuration is correct, they should receive IP addresses within their respective VLANs’ IP ranges from the DHCP Server.
The IP address assigned to PC1 is 192.168.10.11 (vlan10 network segment)
The IP address assigned to PC2 is 192.168.20.10 (vlan20 network segment)
The IP address assigned to PC3 is 192.168.30.10 (vlan30 network segment)
The IP address assigned to PC0 is 192.168.40.11 (vlan40 network segment)
PC1 Ping PC2, PC3, PC0 (can communicate with each other)
Conclusion:
In this example configuration, the PCs in vlan10, vlan20, vlan30, and vlan40 have successfully obtained IP addresses from the DHCP Server in vlan40. The IP Helper (DHCP Relay Agent) has successfully helped in relaying the DHCP requests and responses between the clients and the DHCP server across different VLANs.