Community discussions

MikroTik App
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Converting dynamic address lists to static

Tue Mar 27, 2007 5:05 pm

Greetings.

I need to convert Dynamic lists from our MK 2.29 firewall to statique lists. Anyone has an idea ? A script ?

Thank you for any suggestions.
 
runet
newbie
Posts: 34
Joined: Fri Jun 23, 2006 6:07 pm
Location: USA

Tue Mar 27, 2007 6:26 pm

How about exporting to a text file, then using a text editor to search and replace, and finaly use the import command.

You might also need to remove the old IP numbers after the updates have been completed.

You can also use the set command to replace a value
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Tue Mar 27, 2007 6:39 pm

Ideally it would be much easier if we had a chance to select "static" or "dynamic" whenever an IP is added to a list by a filetr rule. But this is a feature request and has nothing to do with the forum.

I will try the directions you gave me . Thank you.
 
runet
newbie
Posts: 34
Joined: Fri Jun 23, 2006 6:07 pm
Location: USA

Tue Mar 27, 2007 6:53 pm

Sounds like you are using mt for client devices.

I have never done this but I imagine one could have a script (perl or php) that would go through a text file line by line, ssh to an IP, log in and then issue :

/ip dhcp-client add interface=ether1 ...
/ip address=xxx.xxx.xxx.xxx disable (or remove)

if you are connecting via this IP number, the connection will be terminated at this point.

This is also why it is a good idea to "push" out configurations from a central point. That way you can edit, tweek, and test BEFORE you commit, realize that its too late now and you have to jump in the truck, drive over to reset the device and so on and so forth...
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Tue Mar 27, 2007 7:08 pm

Altough this is not what I am trying to do, it sounds interesting to use a scripting tool on a workstation and do the editing before pushing the commit button. Thank you for the idea.

The truth is that I realized that our firewall rules were sometimes too harsh in blacklisting IPs. This is why I use a withelist rule on top of chain that garanties to clients (public IPs) that do a "certain" thing whenever they connect for the first time. I only want to convert these dynamic addresses to static because they vaporise after a reboot.
 
changeip
Forum Guru
Forum Guru
Posts: 3833
Joined: Fri May 28, 2004 5:22 pm

Tue Mar 27, 2007 7:38 pm

There was a script posted in the forums to do exactly what you wanted... I'll see if I can find it.
 
ipdruide
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Mon Aug 07, 2006 2:07 pm
Location: Paris France

Wed Mar 28, 2007 2:00 pm

Never mind. I did a search and I have found the script example. I'll try to do with that. Thanks.

Who is online

Users browsing this forum: lurker888, MaxwellsEq, mkx, papayeya and 31 guests