Hi all,
I'd like to share with you a little problem I recently encountered about ACL.
Symptom
In a cutover, we need to modify the ACL configuration on the device.
Original Configuration
ACL 3010
rule 10 permit tcp source 172.16.2.128 0.0.0.63 destination 10.18.31.7 0 destination-port eq 22
rule 20 deny tcp source-port eq 22 destination-port lt 1024
The cutover script
ACL 3010
rule 10 permit tcp source 10.207.135.0 0.0.0.255 destination 10.4.76.119 0 destination-port eq 22
rule 20 permit tcp source 172.16.2.128 0.0.0.63 destination 10.18.31.7 0
During the migration verification, We found that the configuration is changed to the following:
ACL 3010
rule 10 permit tcp source 10.207.135.0 0.0.0.255 destination 10.4.76.119 0 destination-port eq 22
rule 20 permit tcp source 172.16.2.128 0.0.0.63 source-port eq 22 destination 10.18.31.7 0 destination-port eq 22
After the script is reconfigured, the two port numbers in rule 20 still exist. The configuration was successful after deleting rule 20 and reconfiguring.
Cause
The existing ACL rule is modified incrementally instead of being overwritten!
If the specified rule ID already exists and the new rule conflicts with the original rule, the part of the new rule that conflicts with the original rule replace the part that exists in the original rule.
To modify an existing rule, delete the old rule, and then create a new rule. Otherwise, the configuration result may be incorrect.