Is there a way to move a rule in the iptables and change it position ? I'm aware i can use -I to insert a rule in a specific position, but i also like to keep the counters.
|
|
|||
|
|
|
No, you cannot move a rule. However, you can set the counter for any rule you add/insert/replace (using the |
|||
|
|
|
You can also do following
|
||||
|
|
|
To see what you have and what you want to change you first need to do some examination. 1) Check for counters and write these somewhere so you can enter them later.
2) Check for the line you want to replace / reposition using
3) Write the rule in the designated CHAIN and add the counters explained in step on. For example.
Meaning of
The above iptables rule will be entered on line 5. Note. Save iptables rules using |
|||
|
|