Hello,
I was looking here and there is nothing or I can’t find it so if someone can point me where to find it.
What I have a hap rb, and I need to connect 2 gsm modem and if one goes down the second one take all traffic.
I have found some scripts but all is for static ip adresses. My booth ISP have dynamic Ip, so I don’t know how to do that with dynamic IP from ISP.
So situation is like this:
1 ISP modem----- dynamic IP
—mikrotik Hap------lan users
2 ISP modem-----dynamic IP
What this does is choose is force the router to use ISP one due to a shorter distance marking,
the router will continually ping to make sure the gateway is up.
If it goes down then it will switch to the second connection but keep checking to see if the first one is backup yet.
This method does not rely on a fixed IP address from the ISPs, but it does rely on their gateway addresses being fixed. If the gateway is dynamic as well, and issued to you by DHCP or LCP or something then I don’t think the normal method can be used.
Or much simpler version of that, add everything as if it was static config, mark route(s) using unique comments, and then use lease script to only update gateway. Example:
Then GO the the respective IP DHCP Client settings and set add-default-route=no for dhcp client and use lease script to update the route you added
For WAN1
:if ($bound=1) do={
/ip route set [find where comment="dhcp1"] gateway=$"gateway-address" disabled=no
} else={
/ip route set [find where comment="dhcp1"] disabled=yes
}
FOR WAN2
:if ($bound=1) do={
/ip route set [find where comment="dhcp2"] gateway=$"gateway-address" disabled=no
} else={
/ip route set [find where comment="dhcp2"] disabled=yes
}
Every time the IP is bound, the new gateway will be inserted into the IP route.
thank you, for your help, I will try your advice, I am not an expert so a will give a try if will success will let you know, Not sure if all understood but you gave me a good start point
thank you,
Hello,
Thanks all of you guy but I’m really struggling with all configuration, I am not sure but there is many way to achieve the goal.
I am little bit confused in all that, can you explain me what all I have to do for it. We can make an agreement too, so please if someone can help.
Thank you