Community discussions

MikroTik App
 
adm1329
just joined
Topic Author
Posts: 8
Joined: Mon May 19, 2008 10:05 pm

converting a dynamic list to a static list

Tue Jun 24, 2008 4:11 pm

I have a handful of users that are allowed to connect to MSN Messenger, I am trying to block it for other users. I looked into Layer 7 filters, but I couldn't get it to work. What I finally decided to do was build a list of all MSN Messenger servers by creating a dynamic list everytime something tries to connect to an ip on port 1863 it adds the destination ip to the list. So my problem is on the rare occasion the router has to be rebooted the list is lost. I have been converting it by hand, but that is a very time consuming job.

I found an old post about it http://forum.mikrotik.com/viewtopic.php ... +to+static and have played around with the example trying to get it to work, but so far no luck.

This is the script I've got, but it's not working can anyone tell me why?
:foreach i in=[/ip firewall address-list find list=msn ]\
do= { \
:set w [/ip firewall address-list get $i address]
/ip firewall address-list remove [/ip firewall address-list find address=$w]
/ip firewall address-list add list=msn-static address=$w
}

I'm using a RB532 with OS 3.4.
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Re: converting a dynamic list to a static list

Tue Jun 24, 2008 7:56 pm

3.4 scripting is very buggy and mostly unusable. Upgrade to the latest and report back.
 
adm1329
just joined
Topic Author
Posts: 8
Joined: Mon May 19, 2008 10:05 pm

Re: converting a dynamic list to a static list

Tue Oct 07, 2008 4:09 pm

So I have finally got back around to this, I recently upgraded to 3.13 and have the same result. The only thing I can tell is that it wants the ":set w" to be ":set i"
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7198
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: converting a dynamic list to a static list

Tue Oct 07, 2008 4:13 pm

You have to declare w before usage.
 
adm1329
just joined
Topic Author
Posts: 8
Joined: Mon May 19, 2008 10:05 pm

Re: converting a dynamic list to a static list

Tue Oct 07, 2008 4:52 pm

thank you! being a newb to scripting that was easy to overlook, or maybe it was just easy for me to overlook