Script elimination of double rules

sorry for the question, but is it possible to make sure that when I paste a firewall rule script, the doubles are not loaded?
thank you

Unfortunately not, the interpretation of a script from file doesn’t automatically handle duplicities, and the exported configuration actually is nothing but a script. So you’d have to export the source configuration, extend it with a million if statements, and then interpret the modified one. If you don’t need to add items to an already existing configuration but just want to copy an existing one from another device, then if the target box is not 120 meters high and 1000 km away, you may try to use this approach (remove the existing configuration completely before importing the export, but as the reset-configuration involves a restart of the device, you need to give it the name of the file with the export as a parameter). Also, bear in mind that the file to be imported must be in the flash/ directory, otherwise it disappears as the device is reset and you are out.

You’ve changed the topics text while I was answering :slight_smile:

The order of firewall rules matters and when you paste the new rules, they will be added after the existing ones unless you use place-before on each line. So duplicities themselves are not a problem in terms that they would be rejected (you can have exactly the same rule ten times and the firewall will not complain), but the resulting behaviour will depend on both the pre-existing and newly added rules and you have to analyse in advance how exactly it will behave all together.

Thanks Sindy, I have to follow a particular rule on how to insert firewall rules?

For a turbo-introduction into Mikrotik firewall, look here. Come back here if questions remain.