Hi all,
I made a script that has a list of MAC-addresses and then it will find the associated IP and put that into an address-list.
When I was trying the intermediate pieces, the script was working and the list was created.
However after I have added a simple filter to avoid adding over and over the same IPs if they are already within the list, the script does not run anymore.
I don’t see errors in the log, therefore I’m posting it here in case someone has any idea what is failing.
I’m running the latest RouterOS 6.46.6.
Yes, you’re absolutely right about doing it easier with fixed IP.
Basically I did it like that, at the beginning. I made these 2 devices to be outside DHCP and assigned them their IP and manually added them to the list.
However for other reasons I wanted to keep them again on DHCP, so I tried initially to use firewall-raw rules in pre-routing with src-mac-address to build the list, which worked fine too.
But then I didn’t want to engage raw-prerouting that much and also I didn’t like that added addresses are dynamic and lost after reboot, so I decided to do it over scripting.
At the end the issue was most likely that when the list contains IPs the script was not running and exited from the loop.
So now I have changed the scheme and it’s working fine.
Again, as you indicated, not the smartest way (better to use static LAN IP), but till when I’m keeping them into DHCP, this method will do the job.
Armando.