If not its supposed to set both the primary recursive and secondary recursive gatewayIPs to the newgateway IP.
Code: Select all
:if (\$bound=1) do={
:local newgw $"gateway-address";
:local routegw [/ip route get [find comment="PrimaryRecursive"] gateway ];
:if ($newgw != $routegw) do={
/ip route set [find comment="PrimaryRecursive"] gateway=$newgw;
/ip route set [find comment="SecondaryRecursive"] gateway=$newgw;
/tool e-mail send to="llamaworks@accesswave.ca" subject=([/system identity
get name]) body=" This is your new gateway IP: $newIgw" start-tls=yes;
}
}
Go to dhcp client hit release and renew.
Results: The new gateway IP was NOT transferred to the IP Route primary and secondary recursive routings. ??????????????
CONFIG INFO
Code: Select all
/ip route
add check-gateway=ping distance=3 gateway=1.0.0.1
add check-gateway=ping distance=4 gateway=9.9.9.9
add comment=SecondaryWAN distance=10 gateway=seondaryGW_ip
add comment=PrimaryRecursive distance=3 dst-address=1.0.0.1/32 gateway=\
primaryGW_ip scope=10
add comment=SecondaryRecursive distance=4 dst-address=9.9.9.9/32 gateway=\
primaryGW_IP scope=10
add comment=Email_bypass distance=1 dst-address=24.222.0.20/32 gateway=\
secondaryGW_ip
Code: Select all
/ip dhcp-client
add comment=BellFibre default-route-distance=255 disabled=no interface=vlanbell\
script="\r\
\n:if (\\\$bound=1) do={\r\
\n:local newgw \$\"gateway-address\";\r\
\n:local routegw [/ip route get [find comment=\"PrimaryRecursive\"] gatewa\
y ];\r\
\n:if (\$newgw != \$routegw) do={\r\
\n/ip route set [find comment=\"PrimaryRecursive\"] gateway=\$newgw;\r\
\n/ip route set [find comment=\"SecondaryRecursive\"] gateway=\$newgw;\r\
\n/tool e-mail send to=\"email@address.com\" subject=([/system iden\
tity\r\
\nget name]) body=\" This is your new gateway IP: \$newIgw\" start-tls=yes\
;\r\
\n}\r\
\n}\r\
\n"