The DHCP server can only dynamically distributing network configuration parameters to the client computers within the same network with DHCP server. For client computers that reside a separated networks to get the network configuration parameters from DHCP server, we need a DHCP relay server.
In this article you will see how to install and configure DHCP relay server on Cisco L3 switch.
In this tutorial, it is supposed that:
a. You have already installed DHCP server up and running. In case that you don’t, you would probably like to read this link Configuring DHCP Server on RHEL/CentOS 7.
b. You have the SSH remote access to Cisco L3 switch.
3. System Architecture Diagram
There are three VLANs on Huawei L3 switch. The DHCP server locates in VLAN 10. For DHCP server to dynamically distributing network configuration parameters to clients computers locate in another separated VLANs which are VLAN20 and VLAN30, we need to configure DHCP relay on Cisco L3 switch.
The DHCP relay need to apply on the interface or VLAN that connect the clients. It is no need to apply DHCP relay on the interface or VLAN that connect to DHCP server. So, in our case just need to apply DHCP relay configuration on interface VLAN 20 and interface VLAN 30 only.
4. Configure VLAN Interface
Let configure the VLAN interfaces for VLAN 10, VLAN 20, and VLAN 30
# vlan 10 name VLAN-Servers # vlan 20 name VLAN-Client01 # vlan 30 name VLAN-Client02 # int vlan 10 ip address 10.0.10.1 255.255.255.0 # int vlan 20 ip address 10.0.20.1 255.255.255.0 # int vlan 30 ip address 10.0.30.1 255.255.255.0
Now we need to assign the switch ports to the associated VLANs.
# int G0/1 no sh des DHCP-Server_NIC01 switchport mode access switchport access vlan 10 # int G0/2 no sh des Client-PC01 switchport mode access switchport access vlan 20 # int G0/3 no sh des Client-PC02 switchport mode access switchport access vlan 30
5. Configure DHCP Relay
To configure DHCP relay on Cisco L3 switch , execute the following commands on VLANs that connect the client, which are interface VLAN 20 and VLAN30.
# int vlan 20 ip helper-address 10.0.10.1 # int vlan 30 ip helper-address 10.0.10.1
6. Test DHCP Relay
To verify if the DHCP relay is working on VLAN 20, we can plug the client computer to port G0/2 which was configured for VLAN 20. The client computer should be able get the IP as the the following.
Also, to verify if the DHCP relay is working on VLAN 30, we can plug the client computer to port G0/3 which was configured for VLAN 30. The client computer should be able get the IP as the the following.
Now you just have done the configuration of DHCP relay server on Cisco L3 switch. I hope that you can find this instruction informative. If you have any questions or suggestions you can always leave your comments below. I will try all of my best to review and reply them.