[Event]Execute command on src IP Address connecting

Hello,
I wish to know if is there a way to execute a command when a new IP address appears on ip/firewall/connection?
So each new IP will appear I need to check this Ip via sending a request URL to my service and based on the response I wish to add it to black list or not.

So you will like for every new inside IP to see what it is and then accept it or not?
Its possible to do using the connection but not easy. You need to store all IP in a matrix and then test all IP and see if some is new. This then have to be scheduled and run for example every 5 min.

What you can do it to convert all DHCP to static IP (set up a big enough scope, and you can remove IP not used in one year). Then for every new IP requesting DHCP send an email, or what I have done for some, setup PushBullet and get message on the phone immediately when new DHCP are request.

I mean the external IP - incoming connection to the WAN port.

Then I do not understand what you want. There are 10000+ new IP accessing your public IP every day.
Or do you like to know when your public IP change? Why?

I would like to check which country the client trying to reach the server. So I will use my own service to detect the country connected from and add this IP to the blacklist.
So the flow of detection will be looks like this: if MT gets the new connection, and send public IP to the service then the service will return info that should be blocked or not. But I see only one problem, the blacklist should be checked first before the service request.

Then block the country you do not like with access lists. You can get the from here:
https://mikrotikconfig.com/firewall/

How often the list is updated?

Yeah is out of date: 94.19.103.74, but not only this list is out of date, GeoLite2 is too… :frowning:
So I need to create a service for it.

IP2location.com LITE no alternative ? (updated 1x / month which is not that bad)

Ok, I need to execute the script from MT on the new connection income on WAN, how to catch it?