4.3_ACL

download 4.3_ACL

of 31

Transcript of 4.3_ACL

  • 8/7/2019 4.3_ACL

    1/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE I Chapter 6 1

    Access Control Lists (ACLs)

  • 8/7/2019 4.3_ACL

    2/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 2

    Packet FilteringPacket filtering, sometimes called static packetfiltering, controls access to a network by analyzingthe incoming and outgoing packets and passing or halting them based on stated criteria.

    These rules are defined using ACLs.

    An ACL is a sequential list of permit or deny statementsthat apply to IP addresses or upper-layer protocols.

    The ACL can extract the following information fromthe packet header, test it against its rules, and make"allow" or "deny" decisions based on:

    Source IP address

    Destination IP address

    ICMP message typeTCP/UDP source port

    TCP/UDP destination port

    And .

  • 8/7/2019 4.3_ACL

    3/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 3

    Wh at is an ACL?B y default, a router does not have any ACLsconfigured and therefore does not filter traffic.

    Traffic that enters the router is routed according to therouting table.

    An ACL is a router configuration script that controlswhether a router permits or denies packets to pass

    based on criteria found in the packet header.As each packet comes through an interface with an

    associated ACL, the ACL is checked from top to bottom,one line at a time, looking for a pattern matching theincoming packet.

    [Tony]: It stops when it finds a matching statement.The ACL applying a permit or deny rule to determine the

    fate of the packet.[Tony]: If ACL cannot find a matching statement from thelist, the default action is deny the traffic.

    ACLs can be configured to control access to a networkor subnet.

    [Tony]: It can control into and out of the network, or subnet,or, single host.

  • 8/7/2019 4.3_ACL

    4/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 4

    Wh at is an ACL?H

    ere are some guidelines for using ACLs:Use ACLs in firewall routers positioned betweenyour internal network and an external network

    such as the Internet.Use ACLs on a router positioned between twoparts of your network

    to control traffic entering or exiting a specific part of your internal network.

    Configure ACLs on border routersrouters situated at the edges of your networks.This provides a very basic buffer from the outsidenetwork, or between a less controlled area of your own network and a more sensitive area of your network.

    Configure ACLs for each network protocolconfigured on the border router interfaces.

    You can configure ACLs on an interface to filter inbound traffic, outbound traffic, or both.

  • 8/7/2019 4.3_ACL

    5/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 5

    ACL: T h e T h ree Ps

    ACL: The Three Ps:O ne ACL per protocol - An ACL must bedefined for each protocol enabled on the interface.

    O ne ACL per direction - ACLs control traffic inone direction at a time on an interface. Twoseparate ACLs must be created to control inbound

    and outbound traffic.O ne ACL per interface - ACLs control traffic for an interface, for example, Fast Ethernet 0/0.

    The router in the example has two interfacesconfigured for IP: AppleTalk and IPX .

    Th is router could require 12 separate ACLs one ACL for each protocol, times two for each direction, times two for the number of ports. 3 protocols X 2 directions X 2 directions = 12

  • 8/7/2019 4.3_ACL

    6/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 6

    ACLs perform t h e following tasksLimit network traffic to increase network performance.

    If corporate policy does not allow video traffic, ACLs can block video traffic.

    Provide traffic flow control.ACLs can restrict the delivery of routing updates.

    If updates are not required because of network conditions, bandwidth is preserved.

    Provide a basic level of security for network access.ACLs can allow one host to access a part of the network and prevent others fromaccessing the same area.

    Decide which types of traffic to forward or block at the router interfaces.For example, an ACL can permit e-mail traffic, but block all Telnet traffic.

    Control which areas a client can access on a network.Screen hosts to permit or deny access to network services.

    ACLs can permit or deny a user to access file types, such as FTP or H TTP.

    ACLs inspect network packets based on criteria, such as source address,destination address, protocols, and port numbers.

    ACL can classify traffic to enable priority processing down the line.

  • 8/7/2019 4.3_ACL

    7/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 7

    ACL O peration

    ACLs are configured either to apply toinbound traffic or to apply to outboundtraffic.

    Inbound ACLs - An inbound ACL is efficient it saves the overhead of routing lookups if

    packet is discarded. If the packet is permitted by the tests, it isthen processed for routing.

    Outbound ACLs - Incoming packets arerouted to the outbound interface, and then

    they are processed through the outboundACL.

    ACLs do not act on packets t h atoriginate from t h e router itself.

  • 8/7/2019 4.3_ACL

    8/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 8

    ACL O peration - Inbound ACLsACL statements operate in sequential order.

    They evaluate packets against the ACL, from the topdown, one statement at a time .

    If a packet header and an ACL statement match, therest of the statements in the list are skipped,

    and the packet is permitted or denied as determined by

    the matched statement.If a packet header does not match an statement, thepacket is tested against the next statement in the list.

    This matching process continues until the end of the list.

    A final implied (IMPLICIT) statement covers all packets

    for which conditions did not test true.This final statement is often referred to as the "implicitdeny any statement" or the "deny all traffic" statement.

    B ecause of this statement, an ACL should have at leastone permit statement in it; otherwise, the ACL blocks alltraffic.

  • 8/7/2019 4.3_ACL

    9/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 9

    ACL O peration - O utbound ACLsB efore a packet is forwarded to an outboundinterface, the router checks the routing table to see if the packet is routable.

    If the packet is not routable, it is dropped.

    Next, the router checks to see whether the outboundinterface is grouped to an ACL.

    If the outbound interface is not grouped to an ACL,The packet is sent directly to the outbound interface.

    If the outbound interface is grouped to an ACL ,the packet is not sent out on the outbound interfaceuntil it is tested by the combination of ACL statements

    that are associated with that interface.A final implied (IMPLICIT) statement covers allpackets for which conditions did not test true.

    This final statement is often referred to as the "implicitdeny any statement" or the "deny all traffic" statement.

  • 8/7/2019 4.3_ACL

    10/31

  • 8/7/2019 4.3_ACL

    11/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 11

    H ow a Standard ACL W orksA standard ACL is a sequential collection of permit and deny conditions thatapply to source IP addresses.

    The destination of the packet and the ports involved are not covered.

    B ecause the software stops testing conditions after the first match, the order of theconditions is critical.

    If no conditions match, the address is rejected.

    The two main tasks involved in using ACLs are as follows: Step 1. Create an access list by specifying an access list number or name and access

    conditions.

    Step 2. Apply the ACL to interfaces or terminal lines.

  • 8/7/2019 4.3_ACL

    12/31

  • 8/7/2019 4.3_ACL

    13/31

  • 8/7/2019 4.3_ACL

    14/31

  • 8/7/2019 4.3_ACL

    15/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 15

    G eneral G uidelines for Creating ACLsUsing ACLs requires attention to detail and great care. Mistakes can becostly in terms of downtime, troubleshooting efforts, and poor networkservice.

    B efore starting to configure an ACL, basic planning is required.

    The figure presents guidelines that form the basis of an ACL best

    practices list.

  • 8/7/2019 4.3_ACL

    16/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 16

    E ntering Criteria StatementsRecall that when traffic comes into the router, it iscompared to ACL statements based on the order thatthe entries occur in the router. The router continuesto process the ACL statements until it has a match.

    For this reason, you should have the most frequentlyused ACL entry at the top of the list.

    If no matches are found when the router reaches theend of the list, the traffic is denied because there is animplied deny for traffic.

    A single-entry ACL with only one deny entry has theeffect of denying all traffic. You must have at least onepermit statement in an ACL or all traffic is blocked.

    For example, the two ACLs (101 and 102) in thefigure have the same effect.

    Network 192.168.10.0 would be permitted to accessnetwork 192.168.30.0 while 192.168.11.0 would not beallowed.

  • 8/7/2019 4.3_ACL

    17/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 17

    Standard ACL LogicIn the figure, packets that come in Fa0/0 are checked for their source addresses:

    access-list 2 deny 192.168.10.1

    access-list 2 permit 192.168.10.0 0.0.0.255

    access-list 2 deny 192.168.0.0 0.0.255.255

    access-list 2 permit 192.0.0.0 0.255.255.255

    If packets are permitted, they are routed through the router to an output interface.If packets are not permitted, they are dropped at the incoming interface.

  • 8/7/2019 4.3_ACL

    18/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 18

    Configuring a Standard ACLTo configure a standard ACLs, you must

    First: create the standard ACL

    Second: activate the ACL on an interface.

    The access-list global configuration command definesa standard ACL with a number in the range of 1 to 99 .

    Cisco IOS Software Release 12.0.1 extended these numbers by

    allowing 1300 to 1999 to provide a maximum of 798 possiblestandard ACLs. These additional numbers are referred to asexpanded IP ACLs.

    Router(config)# access-list access-list-number [ deny| permit | remark ] source [source-wildcard] [log]

    For example, to create a numbered ACL designated

    10 that would permit network 192.168.10.0 /24, youwould enter:R1(config)# access-list 10 permit 192.168.10.0 0.0.0.255

  • 8/7/2019 4.3_ACL

    19/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 19

    R emove and R emark a Standard ACLRemove ACL

    To remove the ACL, the global configuration noaccess-list command is used.

    Issuing the show access-list command confirmsthat access list 10 has been removed.

  • 8/7/2019 4.3_ACL

    20/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 20

    ACL W ildcard MaskingACLs statements include wildcard masks.

    A wildcard mask is a string of binary digits telling therouter which parts of the subnet number to look at.

    The numbers 1 and 0 in the mask identify how to treatthe corresponding IP address bits.

    Wildcard masks are referred to as an inverse mask.Unlike a subnet mask in which binary 1 is equal to a matchand binary 0 is not a match, the reverse is true.

    Wildcard masks and subnet masks differ in the waythey match binary 1s and 0s. Wildcard masks use thefollowing rules to match binary 1s and 0s:

    Wildcard mask bit 0 - Match the corresponding bitvalue in the address

    Wildcard mask bit 1 - Ignore the corresponding bitvalue in the address

    The table in the figure shows the results of applying a0.0.255.255 wildcard mask to a 32-bit IP address.

    Another key point of wildcard mask is which it

    does not has to be

    contiguous 1 and 0 likesubnetmask.

  • 8/7/2019 4.3_ACL

    21/31

  • 8/7/2019 4.3_ACL

    22/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 22

    W ildcard Bit Mask KeywordsThe keywords host and any help identify the mostcommon uses of wildcard masking.

    The host option substitutes for the 0.0.0.0 mask. Thismask states that all IP address bits must match or onlyone host is matched.

    The any option substitutes for the IP address and255.255.255.255 mask .

    This mask says to ignore the entire IP address or to acceptany addresses.

    Example for keyword any :Instead of entering

    R1(config)# access-list 1 permit 0.0.0.0 255.255.255.255,you can use

    R1(config)# access-list 1 permit anyExample for keyword host :

    Instead of entering

    R1(config)# access-list 1 permit 192.168.10.10 0.0.0.0,you can use

    R1(config)# access-list 1 permit host 192.168.10.10.

  • 8/7/2019 4.3_ACL

    23/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 23

    Applying Standard ACL to InterfacesAfter a standard ACL is configured, it is linked to aninterface using the ip access-group command:

    Router(config-if)#ip access-group {access-list-number |access-list-name} {in | out}

    To remove an ACL from an interface ,Use the no ip access-group command on the interface,

    then enter the global no access-list command to removethe entire ACL.

    Example 1: use an ACL to permit a single network.This ACL allows only traffic from source network 192.168.10.0 to

    be forwarded out on S0/0/0. Traffic from networks other than192.168.10.0 is blocked.

    The first line identifies the ACL as access list 1. It permits trafficthat matches the selected parameters.access-list 1 permit 192.168.10.0 0.0.0.255The unseen implicit deny all other traffic.

    The ip access-group 1 out interface configuration command linksand ties ACL 1 to the Serial 0/0/0 interface as an outbound filter.

  • 8/7/2019 4.3_ACL

    24/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 24

    Creating Standard N amed ACLsNaming an ACL makes it easier to understand.

    For example, an ACL to deny FTP could be calledNO_FTP.

    When you identify your ACL with a name, theconfiguration command syntax are slightly different.

    The steps to create a standard named ACL.

    Step 1. Starting from the global configuration mode, use the ipaccess-list command to create a named ACL.

    ACL names are alphanumeric, must be unique and mustnot begin with a number.

    Step 2. From the named ACL configuration mode, use the permitor deny statements to specify one or more conditions for determining if a packet is forwarded or dropped.

    Step 3. Return to privileged EXEC mode with the end command.

    In the figure, the screen output shows the commandsused to configure a standard named ACL on router R1, interface Fa0/0 that denies host 192.168.11.10access to the 192.168.10.0 network.

  • 8/7/2019 4.3_ACL

    25/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 25

    Creating Standard N amed ACLsCapitalizing ACL names is not required, butmakes them stand out when viewing therunning-config output.

    ACL names can be up to 31 characters in length;

    ACL names are case sensitive

    ACL names can include the dash (-), the underscore (_),

    and the period (.).ACL names must start with an alphabetic character, and

    must be unique from all other ACLs of all types on theswitch router.

    You cannot use keywords from any command as anACL name.

    http://www.cisco.com/univercd/cc/td/doc/product/l3sw/8540/12_1/lhouse/sw_confg/8500acl.htm

  • 8/7/2019 4.3_ACL

    26/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 26

    Monitoring and Verifying ACLsWhen you finish an ACL configuration, use Cisco IOS show commandsto verify the configuration.

    In the figure the top example shows the Cisco IOS syntax to display thecontents of all ACLs.

    The bottom example shows the result of issuing the show access-listscommand on router R1. The capitalized ACL names, SALES and ENG

    stand out in the screen output.

  • 8/7/2019 4.3_ACL

    27/31

  • 8/7/2019 4.3_ACL

    28/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 28

    E xtended ACLs: Ports and ServicesThe ability to filter on protocol and portnumber allows you to build very specificextended ACLs.

    The figure shows some examples of how an administrator specifies a TCP or UDP port number by placing it at the

    end of the extended ACL statement. Logical operations can be used, such

    as equal (eq), not equal (neq), greater than (gt), and less than (lt).

  • 8/7/2019 4.3_ACL

    29/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 29

    Configuring E xtended ACLsThe procedural steps for configuring extended ACLsare the same as for standard ACLs

    first create the extended ACL

    then activate it on an interface.

    For example, the network administrator needs torestrict Internet access to allow only web browsing.

    ACL 103 applies to traffic leaving 192.168.10.0network,

    It allows traffic to go to any destination ports 80 ( H TTP)and 443 ( H TTPS) only.

    ACL 104 applies to traffic coming into the network. ACL 104 blocking all incoming traffic, except for the

    established connections.H TTP establishes connections starting with the requestand then exchange of ACK, FIN, and SYN messages.

    A match occurs if the TCP datagram has the ACK or reset (RST) bits set, which indicates that the packetbelongs to an existing connection.

    This parameter allows responses to traffic that originatesfrom the 192.168.10.0 /24 network to return to s0/0/0.

  • 8/7/2019 4.3_ACL

    30/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 30

    Applying E xtended ACLs to InterfacesRecall that we want to allow users tobrowse both insecure and securewebsites.

    First consider whether the traffic you wantto filter is going in or out.

    In the example in the figure, R1 has twointerfaces. It has a serial port, S0/0/0,and a Fast Ethernet port, Fa0/0. The Internet traffic coming in is going in

    the S0/0/0 interface,

    but is going out the Fa0/0 interface toreach PC1.

    The example applies the ACL to theserial interface in both directions.

  • 8/7/2019 4.3_ACL

    31/31

    2006 Cisco Systems, Inc. All rights reserved. Cisco PublicITE 1 Chapter 6 31

    Applying E xtended ACLs to InterfacesExample: Deny FTP

    Denying FTP traffic from subnet 192.168.11.0 goingto 192.168.10.0, but permitting all other traffic.

    Remember that FTP requires ports 20 and 21,therefore you need to specify to deny FTP.

    With extended ACLs, you can choose to use portnumbers as in the example, or to call out a well-known port by name.

    access-list 114 permit tcp 192.168.20.0 0.0.0.255 anyeq ftp

    access-list 114 permit tcp 192.168.20.0 0.0.0.255 anyeq ftp-data

    Example: Deny Telnet

    Denies Telnet traffic from 192.168.11.0 going outinterface Fa0/0, but allows all other IP traffic fromany other source to any destination out Fa0/0.

    Note the use of the any keywords, meaning fromanywhere going to anywhere.