Posted: Sun Oct 17, 2021 11:02 Post subject: IPTables management software for copy/paste into SH scripts
I mostly use "iptables -I INPUT/FORWARD/OUTPUT #" syntax and when the number of rules grows, management becomes a problem because "-I" must be numbered. If there are 50 rules and you make one change to insert a rule somewhere in the middle, then you need to re-number all the "-I" rules below it. That's tedious. Is there not some GUI-based software that can arrange those numbers automatically and also be able to copy/paste import/export to a simple SH script? MS Excel can manage numbering if you use a separate column for "-I" rule numbers, but it doesn't populate what is copied from SH script into Excel sheet.
Actually you do not have to have a number for the -I, it defaults to 1, so as long as you realize that the dd-wrt script will result in the rules going the opposite order you should be fine.
from the man page (https://ipset.netfilter.org/iptables.man.html)
-I, --insert chain [rulenum] rule-specification
Insert one or more rules in the selected chain as the given rule number. So, if the rule number is 1, the rule or rules are inserted at the head of the chain. This is also the default if no rule number is specified.