Fri Feb 20, 2015 12:25 am
I figured out how to do this - it's a little bit strange but seems to work in my lab.
Step1: Create the "loop" address on a standalone bridge interface (and don't connect it to any physical ports)
/interface add name="bridge1"
/ip address add address=10.10.10.1/32 interface=bridge1
Step2: Create the IP Pool
/ip pool add name=Relay1 ranges=192.168.1.10-192.168.1.255
Step3: Create the network
/ip dhcp-server network add address=192.168.1.0/24 gateway=192.168.1.1 dns-server=8.8.8.8
So far, it's all normal, right?
Say your server has 3 interfaces that could reach the relay network: ether1, ether2, and ether3
For each relay network, you would need to add three DHCP servers, all three of which use the same remote pool, relay address, and SRC-ADDRESS set to your "loop" address from step 1.
Step4:
/ip dhcp server add Relay1-ether1 relay=192.168.1.1 address-pool=Relay1 src-address=10.10.10.1 interface=ether1
/ip dhcp server add Relay1-ether2 relay=192.168.1.1 address-pool=Relay1 src-address=10.10.10.1 interface=ether2
/ip dhcp server add Relay1-ether3 relay=192.168.1.1 address-pool=Relay1 src-address=10.10.10.1 interface=ether3
Step5:
On your relay server, set the relay address to the loop address: 10.10.10.1
/ip dhcp-relay add name=LocalRelay1 interface=Local1 dhcp-server=10.10.10.1 local-address=192.168.1.1 disabled=no
Why it doesn't work for just one DHCP server on bridge1:
If you set interface=bridge1 on the DHCP server, the process will never receive the packets. The DHCP daemon is listening for packets coming INTO the Mikrotik from bridge1 (imagine a firewall rule in-interface = bridge1) - however, the packets are not arriving on bridge1, they're arriving on ether1, ether2, or ether3 as the routing protocols determine.... so they're not being passed to the DHCP server.
Creating the three (in this example) DHCP server processes allows the Mikrotik to listen on all interfaces, but to share the single pool of addresses. If you make changes to the parameters/options on the network then it will be the same for all three.
If you make an entry static in the Mikrotik, be sure to remove the specific server from the static entry!
Another solution might be to just create a Metarouter just for running DHCP.
Last edited by
ZeroByte on Thu Mar 05, 2015 1:19 am, edited 1 time in total.