www.howtonetwork.org

CCNA & CCNP Certifcation Training

  • About
  • Contact
  • FAQ
  • Join
  • Home
  • CCNA
    • ICND1
    • ICND2
    • 101 CCNA LABS
  • CCNP
    • ROUTE
    • SWITCH
    • TSHOOT
    • 101 CCNP LABS
  • CompTIA
    • Security+
    • Network+
  • Design
    • CCDA
    • CCDP
You are here: Home / ICND1 / Day 9 – Access Control Lists / Day 9 Tasks / Access Control List Rules

Access Control List Rules

This is one of the hardest parts to understand. I’ve never seen a complete list of rules written down in one Cisco manual. Some refer to them generally or explain some of them, but then miss others completely. The difficulty is that the rules always apply but (until now) you found them only by trial and error. Here are the rules you need to know:

ACL Rule 1 – Use only one ACL per interface per direction.

This makes good sense. You wouldn’t want to have several ACLs doing different things on the same interface. Simply configure one ACL which does everything you need it to, rather than spreading out filters over two or more lists. I could have added “per protocol” to the above rule because you could have an IPX access control list, but IP is really the only protocol in use in modern networks.

 

9.1

Figure 9.1 – One ACL per Interface per Direction

ACL Rule 2 – The lines are processed top-down.

Some engineers become confused when their ACL doesn’t perform as expected. The router will look at the top line of the ACL, and if it sees a match, it will stop there and will not examine the other lines. For this reason, you need to put the most specific entries at the top of the ACL. For example, take the ACL blocking host 172.16.1.1:

Permit 10.0.0.0

No match

Permit 192.168.1.1

No match

Permit 172.16.0.0

Match – Permit

Permit 172.16.1.0

Not processed

Deny 172.16.1.1

Not processed

In the example above, you should have put the Deny 172.16.1.1 line at the top, or at least above the Permit 172.16.0.0 statement.

ACL Rule 3 – There is an implicit “deny all” at the bottom of every ACL.

This catches many engineers out. There is an invisible command at the bottom of every ACL. This command is set to deny all traffic which hasn’t been matched yet. The only way to stop this command coming into effect is to configure a “permit all” at the bottom manually. For example, take an incoming packet from IP address 172.20.1.1:

Permit 10.0.0.0

No match

Permit 192.168.1.1

No match

Permit 172.16.0.0

No match

Permit 172.16.1.0

No match

[Deny all]

Match – DROP PACKET

You actually wanted the packet to be permitted by the router, but instead it denies it. The reason

is the implicit “deny all,” which is a security measure.

 

ACL Rule 4 – The router can’t filter self-generated traffic.

This can cause confusion when doing testing before implementing your ACL on a live network. A router won’t filter traffic it generated itself. This is demonstrated in Figure 9.2 below:

 

9.2

 

Figure 9.2 – ACL Testing with Self-Generated Traffic

ACL Rule 5 – You can’t edit a live ACL.

In fact, until IOS 12.4 you could only edit a named ACL, not standard or extended ACLs. This was a limitation of ACL architecture. Before IOS 12.4, if you wanted to edit a standard or extended ACL, you had to follow these steps ( I used list 99 as an example):

  1. Stop ACL traffic on the interface with the no ip access-group 99 in command.
  2. Copy and paste the ACL into Notepad and edit it there.
  3. Go into ACL mode and paste in the new ACL.
  4. Apply the ACL to the interface again.

Here are the steps on a live router:

ACL created and applied to interface:

Router>en

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#access-list 1 permit 172.16.1.1

Router(config)#access-list 1 permit 172.16.2.1

Router(config)#interface FastEthernet0/0

Router(config-if)#ip access-group 1 in

Take off the active interface:

Router(config)#int FastEthernet0/0

Router(config-if)#no ip access-group 1 in

Router(config-if)#^Z

Show the ACLs. Copy and paste into Notepad and make the changes:

Router#show run ← or show ip access lists

access-list 1 permit host 172.16.1.1

access-list 1 permit host 172.16.2.1

You actually need to add an exclamation mark in-between each line of configuration (if you are pasting it in) to tell the router to do a carriage return:

access-list 1 permit host 172.16.1.1

!

access-list 1 permit host 172.16.2.2

The lines being pasted into the router configuration are shown below. Delete the previous ACL and then paste in the new version:

Router#conf t

Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#no access-list 1

Router(config)#access-list 1 permit host 172.16.1.1

Router(config)#!

Router(config)#access-list 1 permit host 172.16.2.2

Router(config)#exit
Router#

%SYS-5-CONFIG_I: Configured from console by console

show ip access

Router#show ip access-lists

Standard IP access list 1

permit host 172.16.1.1

permit host 172.16.2.2

Router#

Router(config)#int FastEthernet0/0

Router(config-if)#ip access-group 1 in ← reapply to the interface

The commands above may not work if you are using Packet Tracer. Also, please do try these commands on a router because they are exam topics. Bear in mind that you should disable the ACL on the interface (so it’s no longer live) before you edit it in order to avoid strange or unpredictable behaviour. I’ll show you how to edit live ACLs on IOS 12.4 and later shortly.

ACL Rule 6 – Disable the ACL on the interface.

Many engineers, when they want to test or deactivate the ACL for a while, will actually delete it altogether. This isn’t necessary. If you want to stop the ACL from working, simply remove it from the active interface it is applied to:

Router(config)#int FastEthernet0/0

Router(config-if)#no ip access-group 1 in

Router(config-if)#^Z

ACL Rule 7 – You can reuse the same ACL.

I’ve seen this often on live networks. You will usually have the same ACL policy throughout your network. Rather than configuring several ACLs, simply refer to the same ACL and apply it to as many interfaces as you require. Figure 9.3 below illustrates this concept:

 

9.3
Figure 9.3 – You Can Reuse an ACL

ACL Rule 8 – Keep them short!

The basic rule with ACLs is to keep them short and focused. Many novice Cisco engineers stretch their ACL over many lines when, with some thought, it could be tightened to just a few lines of configuration. I’ve mentioned previously that you want your most specific lines of configuration on top. This is good practice and saves CPU cycles on the router.

Good ACL configuration skills come with knowledge and practise.

ACL Rule 9 – Put your ACL as close to the source as possible.

Cisco documentation advises us to put an EXTENDED ACL as close to the SOURCE as possible and STANDARD ACL as close to the DESTINATION as possible, because that will prevent unnecessary overhead but will still allow any “legitimate” traffic.

 

9.4
Figure 9.4 – Put Your ACL Close to the Source

 

Farai says – “The official Cisco advice is EXTENDED as close to the SOURCE as possible and STANDARD as close to the DESTINATION as possible.”

Prev

Next

About Us

This is a free bonus site for members of www.howtonetwork.com

Copyright

The content on this copyright Reality Press Ltd.
Copyright Reality Press Ltd.