Hi everyone,
I have a router with a specific DHCP client script:
:log warning "Setting new IP addresses from DHCP-client";
:if ($"bound"=1) do={
:log warning "Setting new IP addresses from DHCP-client";
/ip firewall address-list remove [/ip firewall address-list find list="WANs"];
/ip firewall address-list add list=WANs address=$"lease-address";
/ip route set [ find comment="WAN1_1" ] gateway=$"gateway-address" disabled=no;
/ip route set [ find comment="WAN1_2" ] gateway=$"gateway-address" disabled=no;
:log warning "New ISP Gateway: " . $"gateway-address";
:log warning "New ISP IP: " . $"lease-address";
}
However it seems for me that this script is not working. Even the first log event won’t show up in the logs.
What is wrong with this script? Also how can I trigger so that this script runs? If I release/renew the IP address it still don’t work, I can’t even see a log event.
Here is the full config of the DHCP client:
/ip dhcp-client
add add-default-route=no disabled=no interface=ether5 script=":log warning \"Set\
ting new IP addresses from DHCP-client\";\r\
\n:if (\$\"bound\"=1) do={\r\
\n :log warning \"Setting new IP addresses from DHCP-client\";\r\
\n /ip firewall address-list remove [/ip firewall address-list find list=\
\"WANs\"];\r\
\n /ip firewall address-list add list=WANs address=\$\"lease-address\";\r\
\n /ip route set [ find comment=\"WAN1_1\" ] gateway=\$\"gateway-address\
\" disabled=no;\r\
\n /ip route set [ find comment=\"WAN1_2\" ] gateway=\$\"gateway-address\
\" disabled=no;\r\
\n :log warning \"New ISP Gateway: \" . \$\"gateway-address\";\r\
\n :log warning \"New ISP IP: \" . \$\"lease-address\";\r\
\n}" use-peer-dns=no use-peer-ntp=no