Community discussions

MikroTik App
 
cysergtlo
just joined
Topic Author
Posts: 7
Joined: Wed Jan 08, 2014 11:30 am

Can't Remove prefix /32 Address List

Tue Nov 11, 2014 8:39 pm

:local vpnIP [/ip address get [find interface="vpn_Interface"] address];
/ip firewall address-list add list="MY NETWORK" address=$vpnIP;
/ip firewall address-list remove [/ip firewall address-list find list="MY NETWORK" address=$vpnIP];
:local vpnIP [/ip address get [find interface="vpn_Interface"] address];
Will Return Value 10.50.1.1/32
/ip firewall address-list add list="MY NETWORK" address=$vpnIP;
Will Save to address_list 10.50.1.1
/ip firewall address-list remove [/ip firewall address-list find list="MY NETWORK" address=$vpnIP];
This Syntaks Will Find 10.50.1.1/32 and the result not found because in the address List just 10.50.1.1 not 10.50.1.1/32
How to manipulate it....??? Thanks Before
 
bingo220
Member Candidate
Member Candidate
Posts: 124
Joined: Sun Sep 22, 2013 9:30 pm
Location: Ukraine

Re: Can't Remove prefix /32 Address List

Wed Nov 12, 2014 8:39 pm

ros code

:local vpnIP [/ip address get [find interface="vpn_Interface"] address]; :for i from=( [:len $vpnIP] - 1) to=0 do={:if ( [:pick $vpnIP $i] = "/") do={:set vpnIP [:pick $vpnIP 0 $i]}};
/ip firewall address-list add list="MY NETWORK" address=$vpnIP;
/ip firewall address-list remove [/ip firewall address-list find list="MY NETWORK" address=$vpnIP];
 
cysergtlo
just joined
Topic Author
Posts: 7
Joined: Wed Jan 08, 2014 11:30 am

Re: Can't Remove prefix /32 Address List

Tue Dec 02, 2014 9:37 am

ros code

:local vpnIP [/ip address get [find interface="vpn_Interface"] address]; :for i from=( [:len $vpnIP] - 1) to=0 do={:if ( [:pick $vpnIP $i] = "/") do={:set vpnIP [:pick $vpnIP 0 $i]}};
/ip firewall address-list add list="MY NETWORK" address=$vpnIP;
/ip firewall address-list remove [/ip firewall address-list find list="MY NETWORK" address=$vpnIP];
Thanks

Who is online

Users browsing this forum: woland and 112 guests