Answer the question
In order to leave comments, you need to log in
How to change DNS in Mikrotik after raising the tunnel?
My ISP has PPTP Internet access with Round Robin DNS server balancing.
After raising the PPTP tunnel, I need to raise the L2TP tunnel to the VPN provider.
How can I make the ISP's DNS server used only to obtain the PPTP server address, and then other DNS servers are used?
Answer the question
In order to leave comments, you need to log in
It is possible to catch the l2tp connection with a script and register statics in the dns settings. But I'm not sure that statically registered servers have priority over dynamic ones for Mikrotik.
In this case, you can use the script to catch the rise of the l2tp connection and enable the rule to redirect requests to 53/UDP to 8.8.8.8, for example.
:if ([:len [/ppp active find name="l2tp connection name"]] > 0) do={
/ip firewall nat enable [find comment~"Redirect rule comment part"]
} else {
/ip firewall nat disable [find comment~"Comment part of the rule with a redirect"]
}
Well, create the redirect rule itself with the corresponding comment, and run the script every 10 seconds, suppose.
Something like this, but it's not accurate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question