Home > Access List Tutorial

Access List Tutorial

February 13th, 2011 Go to comments

In this tutorial we will learn about access list.

Access control lists (ACLs) provide a means to filter packets by allowing a user to permit or deny IP packets from crossing specified interfaces. Just imagine you come to a fair and see the guardian checking tickets. He only allows people with suitable tickets to enter. Well, an access list’s function is same as that guardian.

Access lists filter network traffic by controlling whether packets are forwarded or blocked at the router’s interfaces based on the criteria you specified within the access list.

To use ACLs, the system administrator must first configure ACLs and then apply them to specific interfaces. There are 3 popular types of ACL: Standard, Extended and Named ACLs.

Standard IP Access List

Standard IP lists (1-99) only check source addresses of all IP packets.

Configuration Syntax

access-list access-list-number {permit | deny} source {source-mask}

Apply ACL to an interface

ip access-group access-list-number {in | out}

Example of Standard IP Access List

Standard_ACL_Example1.jpg

Configuration:

In this example we will define a standard access list that will only allow network 10.0.0.0/8 to access the server (located on the Fa0/1 interface)

Define which source is allowed to pass:

Router(config)#access-list 1 permit 10.0.0.0 0.255.255.255

(there is always an implicit deny all other traffic at the end of each ACL so we don’t need to define forbidden traffic)

Apply this ACL to an interface:

Router(config)#interface Fa0/1

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

The ACL 1 is applied to permit only packets from 10.0.0.0/8 to go out of Fa0/1 interface while deny all other traffic. So can we apply this ACL to other interface, Fa0/2 for example? Well we can but shouldn’t do it because users can access to the server from other interface (s0 interface, for example). So we can understand why an standard access list should be applied close to the destination.

Note: The “0.255.255.255″ is the wildcard mask part of network “10.0.0.0″. We will learn how to use wildcard mask later.

Extended IP Access List

Extended IP lists (100-199) check both source and destination addresses, specific UDP/TCP/IP protocols, and destination ports.

Configuration Syntax

access-list access-list-number {permit | deny} protocol source {source-mask} destination {destination-mask} [eq destination-port]

Example of Extended IP Access List

Extended_ACL_Example1.jpg

In this example we will create an extended ACL that will deny FTP traffic from network 10.0.0.0/8 but allow other traffic to go through.

Note: FTP uses TCP on port 20 & 21.

Define which protocol, source, destination and port are denied:

Router(config)#access-list 101 deny tcp 10.0.0.0 0.255.255.255 187.100.1.6 0.0.0.0 eq 21

Router(config)#access-list 101 deny tcp 10.0.0.0 0.255.255.255 187.100.1.6 0.0.0.0 eq 20

Router(config)#access-list 101 permit ip any any

Apply this ACL to an interface:

Router(config)#interface Fa0/1

Router(config-if)#ip access-group 101 out

Notice that we have to explicit allow other traffic (access-list 101 permit ip any any) as there is an “deny all” command at the end of each ACL.

As we can see, the destination of above access list is “187.100.1.6 0.0.0.0″ which specifies a host. We can use “host 187.100.1.6″ instead. We will discuss wildcard mask later.

In summary, below is the range of standard and extended access list

Access list type Range
Standard 1-99, 1300-1999
Extended 100-199, 2000-2699

Comments (378) Comments
Comment pages
1 3 4 5 6 7 8 458
  1. Richard
    June 14th, 2013

    About the graphics extended ACL example, why is it ACL is applied at “port f0/1 out”? why not at the “port f0/0 in”?
    As far as i know, in standard ACL, the ACL should be applied close to the destination and in extended ACL, be applied close from the source.

  2. Larissa
    June 14th, 2013

    I think, because we have two interfaces for input traffic (from f0/0 and from f0/2) and one interface for output traffic (f0/1) and we use only one access list to manage both

  3. rudy
    June 17th, 2013

    That makes since Larissa

  4. richard
    June 21st, 2013

    About the graphics extended ACL example, why is it ACL is applied at “port f0/1 out”? why not at the “port f0/0 in”?
    As far as i know, in standard ACL, the ACL should be applied close to the destination and in extended ACL, be applied close from the source.???????

  5. Richard
    June 22nd, 2013

    I see, thanks!

  6. samer
    June 25th, 2013

    this access applied on int fa0/2 in will accomplish the same purpose !!! and it is actually more correct because it reduces the access-list processing in the router because it only has to filter the traffic generated from network 10.0.0.0/8 going to host 187.100.1.6 .

  7. samer
    June 25th, 2013

    to make more clear .. if you wanted to ONLY permit network 10.0.0.0/8 (and no other)to have ftp access to host 187.100.1.6 then your extended access-list would go on the int fa0/1 out and look like this..
    access-list 101 permit tcp 10.0.0.0 0.255.255.255 host 187.100.16 eq 20
    access-list 101 permit tcp 10.0.0.0 0.255.255.255 host 187.100.16 eq 21
    but since you are denying protocol access for a specific group then the access list should be implemented near the source…
    if you were denying protocol access to many groups and allowing just a few then you implement the extended list near the destination..

  8. Nelson
    June 25th, 2013

    thanks 9tut i be taken the exam 640-802 on 15 of july if there are any changes the sims please do inform me at nelsonnebache@yahoo.com i be waiting to here from any one who might be of help

  9. Abe
    July 17th, 2013

    thanks for this great tutorial 9tut… :)

  10. Anonymous
    July 18th, 2013

    thanx 9 tut for this great platform!

  11. Anonymous
    July 28th, 2013

    I dont understand what is the meaning of “close to the destination”?

  12. fabian
    July 30th, 2013

    for this example how can we write deny all traffic except 10.0.0.0 /8 ?

  13. packet29
    August 8th, 2013

    @Anonymus

    For Standard Access list:

    “close to the destination” = interface of the destination of the packet.
    In the example, the source = network 10.0.0.0/8 &
    destination = 187.100.1.6, interface fa0/1

  14. Pls hw much is cisco exam nw
    August 12th, 2013

    Thanks so much 4 ur tutoria

  15. Rubel
    August 26th, 2013

    Dear all,
    Why extended ACL 101 applied at “fa0/1 out” port? If I applied it at “fa0/1 in” port, it is correct or wrong and why?

  16. Denis
    August 31st, 2013

    there is a mistake in How to use the wildcard mask explanation
    255.255.240.0 is /20 so address has to be 172.23.16.0/20 not /28

  17. candidate
    September 2nd, 2013

    when we want to apply an ACL to an interface, how to know if we should use fa0/0 or fa0/1?
    plzz help me

  18. CCNAMember081
    September 4th, 2013

    I passed my exam, THANKS for everything 9tut!

  19. inayat shah
    September 13th, 2013

    I am going to sit my CCNA exam on 28 Sep. Could anybody send me the latest Sim or all the Sim at 9tut is still enough for CCNA 640-802 exam? please do inform and support me. Thank you.

    E-mail: inayat291@gmail.com
    best regard!

  20. inayat shah
    September 13th, 2013

    thanks 9tut i be taken the exam 640-802 on 15 of july if there are any changes the sims please do inform me at nelsonnebache@yahoo.com i be waiting to here from any one who might be of help

  21. inayat shah
    September 13th, 2013

    sorry for mistake!

  22. Sid
    September 13th, 2013

    Guys I have my ccna exam on 20th sept .. does anyone have latest dumps

  23. jhenards
    September 17th, 2013

    i will be having my exam too on the 20th..wish me luck :)

  24. murtonfor
    September 23rd, 2013

    for the telnet for apply in the interface i thank we apply by access-class not access-group as
    we not from the example
    is it right

  25. Donna
    September 24th, 2013

    This is a comment to the webmaster. Your website is missing out on at least 300 visitors per day. I have found a company which offers to dramatically increase your visitors to your website: http://gmbal.com/239r They offer 1,000 free visitors during their free trial period and I managed to get over 30,000 visitors per month using their services, you could also get lot more targeted traffic than you have now. Hope this helps :) Take care.

  26. anil thapa
    September 24th, 2013

    thank you..9tut… m new in this zone…unaware of thing…bt hope wont be the same …

  27. Last minute tips
    September 26th, 2013

    Dear All, I have the exam tomorrow morning and could use some extra tips! Which lab simulations are the most probable? Any other suggestions??

  28. patchrist
    October 1st, 2013

    Thank a lot 9tut.com. i pass my exam on 30 sept scoring 947/1000.
    thank!!!!!!!

  29. nisha
    October 7th, 2013

    dont u think ineed yo help?im talking to you
    patchrist

  30. Bcia
    October 8th, 2013

    What is the difference between ACL and ACL2.
    is there any? or it is the same.. thank you!!!

  31. josh
    October 21st, 2013

    cidr mask asks in exam for acl??

  32. andrew bhandari
    October 24th, 2013

    am i right ? ACL mean standard , ACL2 mean EXtended or what ? i m not sure what is it but i guess though !

  33. andrew bhandari
    October 24th, 2013

    cna any one link me ccna dump , i got a test following week

  34. Luciano
    November 13th, 2013

    why the extended access list 101 is not applied close to the source thus fa0/0 out i dont understand

  35. hi
    November 25th, 2013

    as far as i know the ACL LOOKS So boarning to me and why instead of ACL WE Can’t use port securities

  36. alex
    November 26th, 2013

    Hello friends
    I am taking the exam this week,please e-mail me the current sims they are testing
    Thanks..

  37. alex
    November 26th, 2013

    Hello friends
    I am taking the exam this week,please e-mail me the current sims they are testing barazanalex@gmail.com
    Thanks..

  38. pavani
    December 2nd, 2013

    i am planning to write my ccna in next week. can anyone please send the latest dumps and sim labs.@ micky.pavani@gmail.com or singam.s@hcl.com

  39. mani
    January 7th, 2014

    Hello friends
    how to create acl between directly connected both in the same subnet (R1-s0/1 to R2-s0/1).when I filtered them, the algorithm find another route and send the updates throw R1-s1/1 via R3 to the R2.thank you

  40. Santu
    January 8th, 2014

    This is really helps in the exam….

  41. basavaraj
    February 27th, 2014

    thank u do much , very useful

  42. kannan
    March 1st, 2014

    In this Extended Acl why use destination ip ok but why use 0000 (what is meaning of this)
    Thanking you

  43. 9tut
    March 1st, 2014

    @kannan: 0.0.0.0 represents for a host (only 1 PC) so “187.100.1.6 0.0.0.0″ means “only host 187.100.1.6″

  44. beruka
    March 27th, 2014

    nice

  45. ATIF
    April 4th, 2014

    Richard

    you are right access-list will be applied fa0/0 in ……………….it will deny access of any FTP traffic from 10.0.0.0 network going towards 187.100.1.6……….as soon as it enters the router………………..this is by far the best way to apply it ………….as it will save the maximum resources………rather than going in the router and then out to deny it…………….hope it is useful info for your guys out there …………….thanks………………….

    Atif

  46. ATIF
    April 4th, 2014

    kannan

    just remember the rule about wild card mask

    0 = match the octet value
    255 = do not match that octet value at all

    so …………..you can say its opposite to the Subnet mask in a way

  47. ATIF
    April 4th, 2014

    mani

    i think you are confusing………….ACL and STP / RSTP …..

    put a diagram and explain……………in a clear language for someone to help you out with.
    thanks

  48. Anonymous
    April 18th, 2014

    Hey I plan to take my ccna exem this week …can I have a latest dumps add lab questions. …I’m waiting
    hornella.ngongo@gmail.com

  49. pranil
    May 2nd, 2014

    please shar configuration of router and switch

  50. joseph
    May 10th, 2014

    my CCNA certificate has expire. Now i want to write CCNE.Is it possible

Comment pages
1 3 4 5 6 7 8 458
Add a Comment