I have two internet lines, the first is ftth and the other is a 5g router, a bridge. I am trying to do load balancing, but I can’t because IP 5g changes automatically every 24 hours or when rebooting.
Can I copy the new IP from ip-Dhcp clinet and add them in ip-firewall-mangle and ip-route list automatic
schedule
:local newgw [ip dhcp-client get [find interface="ether7"] gateway];
:local routegw [/ip route get [find comment="isp1"] gateway ];
:if ($newgw != $routegw) do={
/ip route set [find comment="isp1"] gateway=$newgw;
}
schedule
:local newgw1 [ip dhcp-client get [find interface="ether7"] address];
:local routegw1 [/ip firewall mangle get [find comment="isp2"] dst-address ];
:if ($newgw1 != $routegw1) do={
/ip firewall mangle set [find comment="isp2"] dst-address=$newgw1;
}
/ip firewall mangle
add action=accept chain=prerouting comment=isp2 dst-address=1.1.1.1/30
/ip route
add comment=isp1 distance=1 gateway=1.1.1.1 routing-mark=to_wan2