Remote firewall managing. How to remove rules?

Hello.

May be my question was already asked here, but I could not find anything…

:question: Short question: does anybody know how to automatically add/remove firewall rules on mikrotik from remote host? (Fex expect script.)

Longer story: I need to manage mikrotik router from remote server to allow or deny users to go online. I could not find how to set up policy on forward chain in mikrotik 2.9, but my idea to “emulate” policy is simple. Just create two rules. 1. send all trafic from forward chain to some other chain where I’m going to add allow rules and 2. is to drop everything. BTW. Does there exsist default forward chain policy in mikrotik :question: Well now I need to add rules. It’s quite simple with expect. But how do I remove rules? Should I parse output to find rule number? I thougt find will help me, but actually I receive empty rule list with it:

[admin@MikroTik] > /ip firewall filter add chain=my_forward src-address=192.168.1.4 action=accept
[admin@MikroTik] > /ip firewall filter find src-address=192.168.1.4
[admin@MikroTik] >

How can I find rule number from IP? Are there any expect hackers here??? :slight_smile:

TAI,
Peter.

Check the manual
this is not the sintaxis to use FIND command

Maximiliano Dobladez

I’ve checked the manual. And I could not find any mention about ‘/ip firewall find’ there at all. Please, can you tell me exact page?

And that was just related question :wink: More important is: Does anybody here do automatic firewall rules insertion/deletion? How :question:

http://www.mikrotik.com/docs/ros/2.9/system/scripting