i want to open p2p for specific time but below script is not working. i dont want to disable/enable the filter rule.
/ip firewall filter set [find P2P=all-p2p] action=accept
/ip firewall filter set [find P2P=all-p2p] action=drop
Try
/ip firewall filter set [find p2p="all-p2p"] action=accept
/ip firewall filter set [find p2p="all-p2p"] action=drop
thnxs for reply, but it’s not working..
What version are you running? And what exactly is not working as expected?
i have tried with v3.28, 3.24, 3.20, 3.13 . script can run but changes not occurs in filter rules.
thnxs,
raktim
I tested this with 3.20 and it worked for me. Once again, make sure “p2p” is in lower-case and “all-p2p” is in quotes. And, of course, if you run both of those commands at the same time then second command line will overwrite changes done by the first line.
is “all-ptp” a comment? Try these tests with the command line:
:put [/ip firewall filter find ptp="all-ptp"]
:put [/ip firewall filter find comment="all-ptp"]
Is one responding correctly? The response should show an asterisk and a couple numbers for each rule.
ADD: If more than one line of rules show, you will need to use a “for” loop to set them.
EDIT: My bad on the spelling. Change “ptp” to “p2p”, and “all-ptp” to “all-p2p”
thnxs kirshteins & SurferTim, it’s working