If you are a Mikrotik user, chances are you have seen the DHCP relay feature severally but do not know what it is used for or how it can be configured. The DHCP relay feature is used to provision a Mikrotitik router to act as a DHCP server on behalf of the real DHCP server. In this piece, we will look it how to configure a DHCP relay to mediate between the dhcp server and dhcp clients.
As can be seen in the diagram above, the dhcp server is on the same network with the dhcp relay while the dhcp clients are not on the same network as the dhcp server. The dhcp relay, in turn, is on the same network with the hosts. When a dhcp request is sent from network hosts, the dhcp relay receives it and forwards the request to the dhcp server. The question on most people’s mind at this point is, why do I need a dhcp relay? Why can’t I just configure a dhcp server instead. Well, in a nutshell, a dhcp relay agent is used to forward dhcp requests and replies between a dhcp server and clients who are not on the same subnets.
In this demonstration, I will configure a dhcp server for the two LAN subnets attached to the dhcp relay. Here is how it is done. First, IPs have to be assigned to the interface connecting to the dhcp-relay as shown below.