Home > Security > IOS Access-List Functionality & Management

IOS Access-List Functionality & Management

Well, it appears that Cisco IOS is slowly gaining features that I love on the ASA. Although I find the ASA is far superior when it comes to access-list technology, Cisco IOS is starting to make life easier in terms of updating and managing access-lists. One issue I always ran into when working with IOS ACL’s is the addition or deletion of the entries that made up the ACL. So a basic extended access-list would start like this:

R1(config)#ip access-list extend acl_resequenced
R1(config-ext-nacl)#permit ip host 10.1.1.1 host 10.1.2.1
R1(config-ext-nacl)#permit ip host 10.1.1.1 host 5.5.5.5
R1(config-ext-nacl)#permit tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255

Now, lets show the access-list which should reveal our line numbers.

R1(config-ext-nacl)#do sh ip access-list acl_resequenced
Extended IP access list acl_resequenced
    10 permit ip host 10.1.1.1 host 10.1.2.1
    20 permit ip host 10.1.1.1 host 5.5.5.5
    30 permit tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255

Ok, so now we have been asked to deny some things and these entries must be between previous entered entries. On the ASA, it is no problem; we specify our new entry with a line number and can add or remove entries this way. No problem. Well, we can do this on IOS as well as this feature has been around for a while. So, let’s add some entries:

R1(config-ext-nacl)#15 deny udp host 10.1.1.1 host 5.5.5.5 eq ntp
R1(config-ext-nacl)#17 deny icmp host 10.1.1.1 host 5.5.5.5
R1(config-ext-nacl)#22 deny tcp host 10.1.1.2 host 10.1.2.3 eq 80
R1(config-ext-nacl)#23 deny tcp host 10.1.1.2 host 10.1.2.4 eq 80

And lets view our new ACL again:

R1(config-ext-nacl)#do sh ip access-list acl_resequenced
Extended IP access list acl_resequenced
    10 permit ip host 10.1.1.1 host 10.1.2.1
    15 deny udp host 10.1.1.1 host 5.5.5.5 eq ntp
    17 deny icmp host 10.1.1.1 host 5.5.5.5
    20 permit ip host 10.1.1.1 host 5.5.5.5
    22 deny tcp host 10.1.1.2 host 10.1.2.3 eq www
    23 deny tcp host 10.1.1.2 host 10.1.2.4 eq www
    30 permit tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255

So, the issue I have had is running out of lines between the default line numbers (multiples of 10) in the acl. What happens if we need 9 more lines between entries 10 and 20. Well, we wouldn’t be able to do this because we would be out of line numbers. Now this is an issue since we don’t want to take the ACL off the interface and install the new ACL since downtime will occur and security vulnerabilities may surface during that window, not to mention other issues.

Well, Cisco has given us a command called resequence. By implementing this, our line numbers can be resequenced and changed so we can add more entries if needed. The command syntax is shown below. There are two arguements that we can enter with this command. The first is “starting sequence number” and the second is “step to increment sequence number”. The first arguement determines where in the access-list we want to start the resequence. Most times a number of 1o will be used since this is our first line. The second number is the incremental value that is to be applied to the first line number in the list, resulting in new line numbers for the entry.

R1(config)#ip access-list resequence acl_resequenced 10 20

So the above line is going to resort our access-list acl_resequenced starting at line 10 and will increment the line numbers by 20. Let’s verify the result

R1(config)#do sh ip access-list acl_resequenced
Extended IP access list acl_resequenced
    10 permit ip host 10.1.1.1 host 10.1.2.1
    30 deny udp host 10.1.1.1 host 5.5.5.5 eq ntp
    50 deny icmp host 10.1.1.1 host 5.5.5.5
    70 permit ip host 10.1.1.1 host 5.5.5.5
    90 deny tcp host 10.1.1.2 host 10.1.2.3 eq www
    110 deny tcp host 10.1.1.2 host 10.1.2.4 eq www
    130 permit tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255

Well, that will work and will solve our issue for needing more than the 9 extra entries we needed between lines 10 and 20 earlier.

So now if only we could implement the addition of remark statements to the extended access-list using line numbers. Unfortunately, the functionality of IOS access-lists has been improved with the use of the resequence sub-command but making our own remarks for managment (ease of use) is still lacking. We can insert remarks, but they will always drop down to the bottom the acl. Look below:

R1(config-ext-nacl)#remark Remark Functionality in Access-Lists Need Work
R1(config-ext-nacl)#10 ?
  deny      Specify packets to reject
  dynamic   Specify a DYNAMIC list of PERMITs or DENYs
  evaluate  Evaluate an access list
  exit      Exit from access-list configuration mode
  permit    Specify packets to forward

And if we show our access-list extend, we don’t even see the remark statement:

R1(config-ext-nacl)#do sh ip access-list acl_resequenced
Extended IP access list acl_resequenced
    10 permit ip host 10.1.1.1 host 10.1.2.1
    30 deny udp host 10.1.1.1 host 5.5.5.5 eq ntp
    50 deny icmp host 10.1.1.1 host 5.5.5.5
    70 permit ip host 10.1.1.1 host 5.5.5.5
    90 deny tcp host 10.1.1.2 host 10.1.2.3 eq www
    110 deny tcp host 10.1.1.2 host 10.1.2.4 eq www
    130 permit tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255

However, it does sh up in our run command:

R1(config-ext-nacl)#do sh run | beg access-list
ip access-list extended acl_resequenced
 permit ip host 10.1.1.1 host 10.1.2.1
 deny   udp host 10.1.1.1 host 5.5.5.5 eq ntp
 deny   icmp host 10.1.1.1 host 5.5.5.5
 permit ip host 10.1.1.1 host 5.5.5.5
 deny   tcp host 10.1.1.2 host 10.1.2.3 eq www
 deny   tcp host 10.1.1.2 host 10.1.2.4 eq www
 permit tcp 10.1.1.0 0.0.0.255 10.1.2.0 0.0.0.255
 remark Remark Functionality in Access-Lists Need Work

So the access-list subcommand “resequence” can help us if we need to keep our access-list functional and organized better if many changes are needed in IOS. The ASA on the otherhand, is much more powerful and easier to use. I prefer the ASA in this regard.

Categories: Security Tags:
  1. No comments yet.
  1. No trackbacks yet.