I'm 100% new to scripting so this will probably be something stupid I'm missing. But I'm trying to get the current IP of ether1 and add it to an address list. On the address list, I'm getting the network address (e.g. 192.168.200.0/24) instead of just the IP address (192.168.200.1). Am I pulling the data from the wrong value-name?
Here's the code.Any help is much appreciated.
Here's the code.
Code:
:global currentIP; :local newIP [/ip address get [find interface="ether1"] address]; :if ($newIP != $currentIP) do={ :put [/ip firewall/address-list/add list=wan_ip address=$newIP dynamic=yes]; :put "ip address $currentIP changed to $newIP"; :set currentIP $newIP;}
Statistics: Posted by mbd777 — Tue Mar 12, 2024 10:33 pm