Community discussions

MikroTik App
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Wed Jun 12, 2019 5:04 am

DHCP Relay in VRF

Wed Jul 19, 2023 4:13 pm

Hello everyone!

We are having trouble migrating our services from ROSv6 to ROSv7 because we are unable to get the DHCP relay service to work within VRF.

Although this limitation existed in ROSv6, there was a workaround through mange firewall rules (viewtopic.php?t=57579#p413786). However, we couldn't get it to work on ROSv7. We suspect that changes to the VRF implementation in ROSv7 will prevent the workaround with mangle rules from working.

Has anyone been able to get the DHCP relay to work on VRF in ROSv7?
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Wed Jun 12, 2019 5:04 am

Re: DHCP Relay in VRF

Sun Jul 23, 2023 12:09 am

I have done more tests and I have found that using the following mangle rule:
/ip firewall mangle
add action=mark-routing chain=output dst-address=10.10.10.10 dst-port=67 new-routing-mark=VRF1 protocol=udp
DHCPDISCOVER messages are sent to the DHCP server. Also, the DHCPOFFER messages sent by the DHCP server arrive at the DHCP Relay, however they do not seem to be processed and sent to the DHCP Client. I suspect that this is where the difference in behavior in ROSV7 and ROSv7 lies.
Below the relevant configuration:
/ip dhcp-relay
add dhcp-server=10.10.10.10 disabled=no interface=ether2.10 local-address=192.168.1.1 name=dhcp-relay
/ip vrf
add interfaces=ether2.10 name=VRF1
/ip firewall mangle
add action=mark-routing chain=output dst-address=10.10.10.10 dst-port=67 new-routing-mark=VRF1 protocol=udp
The network topology:
Network Topology.png
You do not have the required permissions to view the files attached to this post.
 
User avatar
clambert
Member Candidate
Member Candidate
Topic Author
Posts: 123
Joined: Wed Jun 12, 2019 5:04 am

Re: DHCP Relay in VRF

Tue Sep 26, 2023 6:22 pm

I'm updating the thread in case anyone else is interested in this topic. Support told me that DHCP relay inside VRF is in the "To Do" list. However, they couldn't give me an ETA.
 
norpan
newbie
Posts: 37
Joined: Sat Dec 19, 2009 12:40 pm

Re: DHCP Relay in VRF

Thu Dec 28, 2023 4:26 pm

I have discovered the same thing recently.

My conclusion is that since the vrf's in v7 are totally separated and the response from the DHCP-server (DHCPOFFER) will have a dst-address of an IP-address belonging to the main-table, the old workaround does not behave as in v6.
The dst-address in DHCPOFFER will in your case be looked up only in VRF1 and be routed away if a matching route is found.

I have tried with mangle-rules, nat-rules and route-leaking to work around this but neither worked.
The only idea of a workaround I have so far is if you create a new loopback interface, add it to VRF1 and set the IP-address (/32) of the dst-address in the DHCPOFFER to the loopback.
I have not tested this with dhcp-relay but I made a similar test with ping and it worked. It's an ugly workaround I know but i might just make dhcp-relay work on a vrf again until dhcp-relay is vrf-aware. :)

Unfortunately I do not have any examples available at the moment so I hope this makes sense without it.
 
Mikuser17
just joined
Posts: 7
Joined: Sat Jul 07, 2018 12:01 am

Re: DHCP Relay in VRF

Thu Apr 25, 2024 10:13 am

I searched with no result - Maybe I look in the wrong direction :-|
Anybody found an "easy" way to add working dhcp relay to vrf-interfaces?

KR
 
akakua
Frequent Visitor
Frequent Visitor
Posts: 55
Joined: Mon Apr 06, 2020 4:52 pm

Re: DHCP Relay in VRF

Thu Apr 25, 2024 11:37 am

I searched with no result - Maybe I look in the wrong direction :-|
Anybody found an "easy" way to add working dhcp relay to vrf-interfaces?

KR
https://help.mikrotik.com/docs/display/ ... cedin7.15)

Who is online

Users browsing this forum: dustious, LabarH, mongobongo, mrz, Semrush [Bot] and 47 guests