Inserting Rules into ACLs

To insert rules into an ACL, follow these steps.
  1. Enter the configure terminal command to access global configuration mode.
    device# configure terminal
    
  2. Enter ACL configuration sub-mode for the IPv4, IPv6, or MAC ACL you want to modify.
    device(config)# ip access-list standard ip_acl_1
    
    device(config)# ipv6 access-list ipv6_acl_1
    
    device(config)# mac access-list macdata
  3. Enter the appropriate show command to display the rules of the relevant ACL.
    • Enter the show ip access-lists command followed by the name of an IPv4 ACL.
    • Enter the show ipv6 access-lists command followed by the name of an IPv6 ACL.
    • Enter the show mac access-lists command followed by the name of a MAC ACL.
    device(config-std-ipacl-ip_acl_1)# show ip access-lists ip_acl_1
    Standard IP access list ip_acl_1: 3 entries
    10: permit 1.1.1.0  0.0.0.255
    11: permit host 2.2.2.1 
    20: deny   2.2.2.0  0.0.0.255
    
    device(config-ipv6-access-list ipv6_acl_1)# show ipv6 access-lists ipv6_acl_1
    ipv6 access list ipv6_acl_1: 3 entries
    10: permit ipv6 2001:DB8::/64 any
    11: permit ipv6 2001:DB8:101::/64 any 
    20: permit ipv6 host 2001:DB8:aa:10::102 host 2001:DB8:101::102
    
    device(config-macl-mac123)# show mac access-lists mac123
    mac access-list mac123: 1 entries
    permit 1111.2222.3333 ffff.ffff.ffff 4444.5555.6666 ffff.ffff.ffff
    
  4. To insert a rule between two adjacent rules, complete the following steps:
    1. In ACL configuration sub-mode, enter the regenerate-seq-number command.
      device(config-ipv6-access-list ipv6_acl_1)# regenerate-seq-number
      
    2. Re-enter the appropriate show command to display the updated contents of the ACL.
      device(config-ipv6-access-list ipv6_acl_1)# show ipv6 access-lists ipv6_acl_1
      10: permit ipv6 2001:DB8::/64 any
      20: permit ipv6 2001:DB8:101::/64 any 
      30: permit ipv6 host 2001:DB8:aa:10::102 host 2001:DB8:101::102
      
  5. Create the new rule, beginning with the keyword sequence and the needed sequence number.
    device(config-ipv6-access-list ipv6_acl_1)# sequence 25 permit ipv6 2001:DB8:10::/64 2001:DB8:102::/64