Community discussions

MikroTik App
 
zxd
just joined
Topic Author
Posts: 2
Joined: Sat Apr 30, 2022 7:03 pm

Check if IP in certain address-list

Sat Apr 30, 2022 7:23 pm

Hi, I'm writing a script to redail my many pppoe clients,
I want to log current IP to an address-list then redail, if the new IP match any of the old IPs then redail again.
Now I can easily add IP to address-list with
:local OLDIP [/ip address get [find interface=$PPPoE] address];
/ip/firewall/address-list add list=old-ip address=$OLDIP;
But how can I check if new IP in the address-list?

Any help will be appreciated.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Check if IP in certain address-list

Sat Apr 30, 2022 8:04 pm

Ok, you need to change IP continuosly for spam?
 
zxd
just joined
Topic Author
Posts: 2
Joined: Sat Apr 30, 2022 7:03 pm

Re: Check if IP in certain address-list

Sat Apr 30, 2022 8:49 pm

Well, for unknown reasons some IPs are block by a game I played, so when I got the IP I need to redail so I can login.

Basically what I want to do is read the address-list, so can use IF to determine if it's in the blocked range
:local CheckIP ([:toip $currentIP] in [:toip $Blocked-IP]);
:if ($CheckIP = true) do={ ##redail or something};

Who is online

Users browsing this forum: No registered users and 17 guests