I have made a walled garden for my non-paying customers as a replacement for my old method of disconnecting them. We however have a LNS cluster so I need to add and remove the Addresses form the address list on 10 routers. This part was easy.
the problem im having is for some reason, sometimes, the addresses don't remove! Its very annoying and I cant figure out why.
now I thought it could have just locked up on one router, but, it does not remove it from any.
API SCRIPT: [when I want to remove a single IP from the overdue list]
Code: Select all
$ipAddress='192.168.1.1'; //ip from billing_script
$API->write('/ip/firewall/address-list/print', false);
$API->write("?address=$ipAddress");
$API->write('=.proplist=.id',false);
$tarefas = $API->read();
foreach ($tarefas as $tarefa):
$API->write('/ip/firewall/address-list/remove', false);
$API->write('=.id='.$tarefa['.id']);
$API->read();
endforeach;
<<< [31] /ip/firewall/address-list/print <<< [21] ?address=192.168.1.1 <<< [14] =.proplist=.id >>> [3/3] bytes read. >>> [3, 110]!re >>> [10/10] bytes read. >>> [10, 99]=.id=*1B90 >>> [22/22] bytes read. >>> [22, 76]=list=payment_reminder >>> [21/21] bytes read. >>> [21, 54]=address=192.168.1.1 >>> [14/14] bytes read. >>> [14, 39]=dynamic=false >>> [14/14] bytes read. >>> [14, 24]=dynamic=false >>> [15/15] bytes read. >>> [15, 8]=disabled=false >>> [5/5] bytes read. >>> [5, 1]!done <<< [32] /ip/firewall/address-list/remove <<< [10] =.id=*1B90 >>> [5/5] bytes read. >>> [5, 40]!trap >>> [31/31] bytes read. >>> [31, 8]=message=no such command prefix >>> [5/5] bytes read. >>> [5, 1]!done
Running my script that flushes all IP's off my address list (and then re-adds them) works, but I don't want to do this every time, that's a lot of load on the routers.