DNS Redirect Sanity Check
Posted: Wed Feb 28, 2024 2:51 pm
Hello,
I'm configuring a NAT rule to redirect all the DNS traffic bypassing the Mikrotik gateway to the Mikrotik CHR itself:
Checking for previous guides/posts, I configured the rules above. My understanding is that rule 3 is redirecting all the traffic not directed to 192.168.1.1 (DNS provided by DHCP) on port 53 to 192.168.1.1 port 53. Is this correct?
Performing several dig tests, it seems to be working, but I don't understand the meaning of rule 4 with srcnat masquerate. I see no hits for rule 4, while rule 3 is increasing while I dig towards an external DNS server.
What am I missing?
Thank you!
I'm configuring a NAT rule to redirect all the DNS traffic bypassing the Mikrotik gateway to the Mikrotik CHR itself:
Code: Select all
3 chain=dstnat action=dst-nat to-addresses=192.168.1.1 to-ports=53
protocol=udp src-address=!192.168.1.1 dst-address=!192.168.1.1
dst-port=53 log=yes log-prefix=""
4 chain=srcnat action=masquerade protocol=udp src-address=!192.168.1.1
dst-address=192.168.1.1 src-address-list=allowed_to_router dst-port=53
log=yes log-prefix=""
Performing several dig tests, it seems to be working, but I don't understand the meaning of rule 4 with srcnat masquerate. I see no hits for rule 4, while rule 3 is increasing while I dig towards an external DNS server.
What am I missing?
Thank you!