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 2 3 4 5 8 458
  1. Fawad
    May 2nd, 2012

    can we apply access-list to sub intererfaces???

  2. confuse
    May 4th, 2012

    on the exhibit above about wilcard mask..why is 00010011= 18? i think it should 19

  3. Anonymous
    May 8th, 2012

    /28 should have been 255.255.255.240
    and since its is a wildcard mask it should have been 0.0.0.15

  4. vikas
    May 13th, 2012

    good example

  5. dinesh patni
    May 19th, 2012

    Ethiolion after reading the extended acl example i also wonder why it is not implemented on
    Fa 0/0 in , i m agree with ur point and this implementation will satisfy both the theory and our requirement

    if any one disagree or want to give any comment pls give on this point why it is not implemnented on Fa0/0 in
    it will clear my big doubt and i wil get a clear idea about the implementation of acl
    pls help me out

  6. Drry
    June 8th, 2012

    @dinesh patni,
    i think it should be applied on interface access-group fa0/0 in, best practice in ACL is that if you use standard ACL it should be placed closest to destination while extended ACL usually placed closest to source.

  7. Klauss
    June 20th, 2012

    Dinesh and Drry – you are correct. It should have been applied to the in side of the router.

  8. RJCCNA:)
    June 26th, 2012

    Thanks it helps lot

  9. Anonymous
    July 4th, 2012

    thanx ,its realy helpfull

  10. Network messiah
    July 12th, 2012

    Hello Guys,

    I hate all of u that have just passed d ccna.I failled 2day,So am back in the books.Got eigrp,acl and Nat.

    Goodluck to u guys that are doing it soon.

  11. Anonymous
    July 13th, 2012

    Guys if any one has latest dumps for ccna , kindly send it to rubin.shane@yahoo.co.in

  12. Anonymous
    July 18th, 2012

    great info

  13. Sasank Choudhury
    July 24th, 2012

    thanks a lot………….

  14. aJmAL
    July 25th, 2012

    hi friends anyone help me ..still i dont understand IN and OUT

  15. jahuta
    August 5th, 2012

    If u need to find the wildcard mask of the subnet mask,the u can follow my easy system.
    just imagine your subnet is 255.255.255.240……………
    then u can reduce the subnet mask from the 255.255.255.255………
    answer is 255.255.255.255 – 255.255.255.240 =0.0.0.15

  16. Gushungo
    August 9th, 2012

    Thanx for that Jahuta can you please now hel p me with this subnet

    255.128.0.0 using ur easy system

  17. Ab
    August 15th, 2012

    255.128.0.0 – 255.255.255.255 = 0.127.0.0

  18. Ab
    August 15th, 2012

    Correction*

    0.127.255.255, my bad. It will only check the first 8 bits from the first octet, and the first bit on the second octet.

  19. messinah
    August 15th, 2012

    @aJmAL
    Define In, Out, Inbound, Outbound, Source, and Destination
    This topic is very simple if u draws it from the following scenario
    The router uses the terms in, out, source, and destination as references. Traffic on the router can be compared to traffic on the highway. If you were a law enforcement officer in Pennsylvania and wanted to stop a truck going from Maryland to New York, the source of the truck is Maryland and the destination of the truck is New York. The roadblock could be applied at the Pennsylvania–New York border (out) or the Maryland–Pennsylvania border (in). replace with town/cities which u are familiar with.
    When you refer to a router, these terms have these meanings.
    • Out—Traffic that has already been through the router and leaves the interface. The source is where it has been, on the other side of the router, and the destination is where it goes.
    • In—Traffic that arrives on the interface and then goes through the router. The source is where it has been and the destination is where it goes, on the other side of the router.
    • Inbound —if the access list is inbound, when the router receives a packet, the Cisco IOS software checks the criteria statements of the access list for a match. If the packet is permitted, the software continues to process the packet. If the packet is denied, the software discards the packet.
    • Outbound—if the access list is outbound, after the software receives and routes a packet to the outbound interface, the software checks the criteria statements of the access list for a match. If the packet is permitted, the software transmits the packet. If the packet is denied, the software discards the packet.
    The in ACL has a source on a segment of the interface to which it is applied and a destination off of any other interface. The out ACL has a source on a segment of any interface other than the interface to which it is applied and a destination off of the interface to which it is applied.
    I just hope that u will grasp one or two things from this scenario.
    9tut help me if I am giving this man poison
    @9tut
    Thnks 4yo valuable website, ques, answers & explanations
    Hie all aspiring CCNA network engineers and already in the field?
    Can any one send me the vce engine software (Visual CertExam Suite) and dumbs from collision 486q by Jericho 632q or Bruce 564q by DHAKANI 615Q. I tried to google the vce engine, but got a trial version which only exhibited five questions.
    My id is musinawellaz@gmail.com
    Pliz help- I am preparing for ccna final exam on this month end (August 2012),so pliz again send me latest dumbs from collision 486q by Jericho 632q or Bruce 564q by DHAKANI 615Q.

  20. sonu
    August 15th, 2012

    my ccna exam is aug 23 2012 Please can someone send me the lattest CCNA dumps.” My email add is indiasonu20@gmail.com Pls help me

  21. Anonymous
    August 16th, 2012

    I have my ccna exam on 31 aug 2012. Please send me the latest dumps at arjun.upadhya@yahoo.com. Many Thanks in advance.

  22. Syed Masood
    August 18th, 2012

    Hello Guys…!!! Need your help regarding CCNA Dumps the upgrade one, i schdueled my exam coming month, thanks in advance , please forward to clomr@live.com

  23. jayantha
    August 22nd, 2012

    I have my ccna exam on 31 aug 2012. Please send me the latest dumps at jayantha33@yahoo.com. Many Thanks in advance.

  24. Byron Bruno
    August 24th, 2012

    Am certifying next month. Any one with latest update please send me a copy on goodbyron@yahoo.com or goodbruno88@gmail.com I will be grateful for help. Thanx

  25. Byron Bruno
    August 24th, 2012

    Sory i meant the latest CCNA dumps. Thanx

  26. sumudu harshitha
    August 25th, 2012

    Guys i have the exam on 1st of september i would be grateful if anyone could send me the latest dump to my mail..

    sumududesilva@gmail.com

    Thanks in advance
    n All the best for the people who are doing to do the exam… :)

  27. 9tut fan
    September 18th, 2012

    guys, i have the exam on 29 september. can someone please send me the latest dump on mail kuruzna@yahoo.com. thank you :)))

  28. prasant kumar
    September 24th, 2012

    plz send me some dumps of CCNA. my id prasant.kumar1985@gmail.com

  29. Rob
    October 1st, 2012

    Could someone also send me the latest dump please? robproctor61@gmail.com
    Many thanks in advance……:)

  30. gg
    October 8th, 2012

    ave my egzam on fridei!!

  31. anonymous
    October 9th, 2012

    pls my exam is on the16th, wat do i need to revise

  32. ossa
    October 10th, 2012

    I’m writing CCNA ending of this month – october, pls i need some1 to help me with current dumps. thumps up to u guys that hv succeeded. thanks in advance.

  33. ossa
    October 10th, 2012

    this is my email fonimely@yahoo.com

  34. tamilarasi
    October 12th, 2012

    Can any one send me the vce engine software (Visual CertExam Suite) and dumbs from collision 486q by Jericho 632q or Bruce 564q by DHAKANI 615Q. I tried to google the vce engine, but got a trial version which only exhibited five questions.my mail id.tamilarasiek@gmail.com

  35. mash
    October 17th, 2012

    please guys sent me the latest CCNA dumps, jose.m20076@gmail.com.
    thanks guys

  36. sneha
    October 17th, 2012

    Hi! Guys. i m planning to attempt CCNA 640-802, can anyone send me latest Dumps for the same.

  37. Anonymous
    October 18th, 2012

    can anybody send me ccna dumps, my email is himal.nepali@gmail.com

  38. keith Geminus
    October 21st, 2012

    CCNA first or MCSE first?

  39. Anonymous
    October 23rd, 2012

    Hey guys I have my CCNA scheduled for this month (October) could anyone please send me the latest dumps…I would be super thankful, congrats to those who passed it already…THANKS in advance !!!

  40. Anonymous
    October 23rd, 2012

    Sorry I forgot to type my e-mail it’s: cr7cubanocr7@gmail.com

  41. ANITA
    October 25th, 2012

    I’ll give CCNA exam in first week of November..
    please contact me who recently passed CCNA exam or planning to give CCNA exam…
    please tell me which dump is good and sims…

    er.anita.annu@gmail.com

  42. MARIO
    October 29th, 2012

    miren recomendaciones para CCNA es realizar demasiadas simulaciones hay es donde mas tiempo se toma uno para realizarlas sobre todo de estas ACL

  43. an
    October 30th, 2012

    latest dumb please..help me..

  44. an
    October 30th, 2012

    please send me a latest dumb ..anonimandvo@yahoo.com..thankss

  45. musonda
    October 31st, 2012

    Am in for the exam ping 10.0.0.0/8

  46. finiwp007
    November 9th, 2012

    This is as direct as it will ever get! Concisely and pointedly outlined – thank you!

  47. Hamlet
    November 12th, 2012

    There is a small mistake

    172.23.16.0/28 must be 172.23.16.0/20

  48. Hamlet
    November 12th, 2012

    ofcourse in the second page

  49. Amir
    November 23rd, 2012

    please explain concept of “in” & “out” . when we should us “in” or “out”?

  50. Amir
    November 23rd, 2012

    please explain concept of “in” & “out” . when we should use “in” or “out”?

Comment pages
1 2 3 4 5 8 458
Add a Comment