6. Access Control Lists (ACLs)Top 10 Graphics:
Access Lists perform serveral functions within a cisco router, including:
Extended Access Lists allow filtering on address, protocol, and applications. Access lists are used to limit broadcast traffic. Why use Access Lists:
Dial-on-demand routing (DDR) - technique whereby a Cisco router can automatically initiate and close a circuit-switched session as transmitting stations demand. The router spoofs keepalives so that end stations treat the session as active. DDR permits routing over ISDN or telephone lines using an external ISDN terminal adaptor or modem. The two main types of access lists are:
Access lists express the set of rules that give added control for packets that enter inbound interfaces, packets that relay through the router, and packets that exit outbound interfaces of the router. Access lists do not act on packets that originates in the router itself. Access list statements operate in sequential, logical order. They evaluate packets from the top down. If a packet header and access list statement match, the packet skips the rest of the statements. If a condition match is true, the packet is permitted or denied. There can be only one access list per protocol per interface. NOTE: For logical completeness, an access list must have conditions that test true for all packets using the access list. A final implied statement covers all packets for which conditions did not test true. This final test condition matches all other packets. It results in a deny. Instead of proceeding in or out an interface, all these remaining packets are dropped. Access List command overviewStep 1: Set parameters for this access list test statement (which can be one of several statements). The access list process contains global statements:
Step 2: Enable an interface to become part of the group that uses the specific acces list. The access list process uses an interface command. All the access list statements identified by the access-list number associate with one or more interfaces. Any packets that pass the access list test conditions can be permitted to use any interface in the access group of interfaces. Router(config-if)# {protocol} access-group acl-numberAccess lists are numbered (for IP, numbered or named)How to identify Access Lists: * IP Standard 1 - 99 * IP Extended 100-199 Named (Cisco IOS 11.2 and later) * IPX Standard 800 - 899 * IPX SAP filters 1000 - 1099 * Apple Talk 600 - 699 * Number identifies the protocol and type * Other number ranges for most protocols For TCP/IP packet filters, Cisco IOS access lists check the packet and upper-layer headers for:
Key Concepts for IP Access Lists:
Wildcard mask - 32-bit quantity used in conjunction with an IP address to determine which bits in an IP address should be ignored when comparing that address with another IP address. A wildcard mask is specified when setting up access lists.
NOTE: Wildcard masking for access lists operates differently from an IP subnet mask. A zero in a bit position of the access list mask indicates that the corresponding bit in the address must be checked; a one in a bit position of the access list mask indicates the corresponding bit in the address is not 'interesting' and can be ignored. How to use Wildcard mask bits -
Standard IP Access List configurationAccess list -
IP access-group - Command that links an existing access list to an outbound interface. Router(config-if)# ip access-group acl-number {in|out}
NOTE: To remove an access list, first enter the 'no ip access-group' command, including 'list number', for each interface where the list had been used, then enter the 'no access-list' command (with list number). Standard Access List examples:(1.) Allow only traffic from a specific source network Router(config)# access-list 1 permit 172.16.0.0 0.0.255.255 (implicit deny any - not visable in the list) (access-list 1 deny 0.0.0.0 255.255.255.255) Router(config)# interface ethernet 0 Router(config-if)# ip access-group 1 out Router(config)# interface ethernet 1 Router(config-if)# ip access-group 1 out (2.) Deny a specific host Router(config)# access-list 1 deny host 172.16.4.13 Router(config)# access-list 1 permit 0.0.0.0 255.255.255.255 (implicit deny any - not visable in the list) (access-list 1 deny 0.0.0.0 255.255.255.255) Router(config)# interface ethernet 0 Router(config-if)# ip access-group 1 (3.) Deny a specific subnet Router(config)# access-list 1 deny 172.16.4.0 0.0.0.255 Router(config)# access-list 1 permit any (implicit deny any - not visable in the list) (access-list 1 deny 0.0.0.0 255.255.255.255) Router(config)# interface ethernet 0 Router(config-if)# ip access-group 1 Extended IP Access List configurationAllow more precise filtering conditions:
Well-Known IP Protocol Port Numbers (Decimal):
Router(config)# access-list acl-number {permit|deny} protocol source source-mask destination destination-mask [operator operand] [established]
IP access-group - Command that links an existing access list to an outbound interface. Only one access list per port per protocol is allowed. Router(config-if)# ip access-group acl-number {in|out}
Extended Access List examples:(1.) Deny FTP for E0 Router(config)# access-list 101 deny tcp 172.16.4.0 0.0.0.255 172.16.3.0 0.0.0.255 eq 21 Router(config)# access-list 101 permit ip 172.16.4.0 0.0.0.255 0.0.0.0 255.255.255.255 (implicit deny any - not visable in the list) (access-list 101 deny ip 0.0.0.0 255.255.255.255 0.0.0.0 255.255.255.255) Router(config)# interface ethernet 0 Router(config-if)# ip access-group 101 (2.) Allow only SMTP for E0 Router(config)# access-list 101 permit tcp 172.16.4.0 0.0.0.255 any eq 25 (implicit deny any - not visable in the list) (access-list 101 deny ip 0.0.0.0 255.255.255.255 0.0.0.0 255.255.255.255) Router(config)# interface ethernet 0 Router(config-if)# ip access-group 101 Using Named IP Access ListsA feature for Cisco IOS Release 11.2 or newer, Named IP access lists can be used to delete individual entries from a specific access list. This enables you to modify your access lists without deleting and then reconfiguring them. Use named IP access lists when:
NOTE: Most of the commonly used IP access list commands accept named IP access lists. Router(config)# ip access-list {standard|extended} name * Alaphanumeric name string must be unique Router(config {std-|ext-}nacl)# {permit|deny} {ip access list text cond} Router(config {std-|ext-}nacl)# {permit|deny} {ip access list text cond} Router(config {std-|ext-}nacl)# no {permit|deny} {ip access list text cond} * Permit or deny statements have no prepended number * "no" removes the specified tests from the named access list Router(config-if)# ip access-group {name|1-199 {in|out}} * Activate the IP named access list on an interface Where to 'place' IP Access ListsAn access lists can act as a firewall. A firewall filters packets and eliminates unwanted traffic at a destination. Where the administrator places an access list statement can reduce unnecessary traffic. Traffic that will be denied at a remote destination should not use network resources along the route to that destination.
Firewall - Router or access server, or several routers or access servers, designated as a buffer between any connected public networks and a private network. A firewall router uses access lists and other methods to ensure the security of the private network. Router> show ip interface * Command that displays IP interface information and indicates whether any access lists are set. (Monitor Access Lists) Router> show access-lists * Command that displays the contents of all access lists. This Cisco IOS command provides more details about the access list statements. By entering the access list name or number as an option for this command, you can see a specific list. (Monitor Access List statements) Reserved TCP Port Numbers -------------------------------------------------- Decimal Keyword Description ------- ------------ -------------------------- 0 Reserved 1-4 Unassigned 5 RJE Remote Job Entry 7 ECHO Echo 9 DISCARD Discard 11 USERS Active Users 13 DAYTIME Daytime 15 NETSTAT Who is Up or NETSTAT 17 QUOTE Quote of the Day 19 CHARGEN Character Generator 20 FTP-DATA File Transfer Protocol (data) 21 FTP File Transfer Protocol 23 TELNET Terminal Connection 25 SMTP Simple Mail Transfer Protocol 37 TIME Time of Day 39 RLP Resource Location Protocol 42 NAMESERVER Host Name Server 43 NICNAME Who Is 53 DOMAIN Domain Name Server 67 BOOTPS Bootstrap Protocol Server 68 BOOTPC Bootstrap Protocol Client 69 TFTP Trivial File Transfer Protocol 75 Any Private Dial-out Service 77 Any Private RJE Service 79 FINGER Finger 95 SUPDUP SUPDUP Protocol 101 HOSTNAME NIC Host Name Server 102 ISO-TSAP ISO-TSAP 113 AUTH Authentication Service 117 UUCP-PATH UUCP Path Service 123 NTP Network Time Protocol 133-159 Unassigned 160-223 Reserved 224-241 Unassigned 242-255 Unassigned Reserved UDP Port Numbers -------------------------------------------------- Decimal Keyword Description ------- ------------ -------------------------- 0 Reserved 1-4 Unassigned 5 RJE Remote Job Entry 7 ECHO Echo 9 DISCARD Discard 11 USERS Active Users 13 DAYTIME Daytime 15 NETSTAT Who is Up or NETSTAT 17 QUOTE Quote of the Day 19 CHARGEN Character Generator 20 FTP-DATA File Transfer Protocol (data) 21 FTP File Transfer Protocol 23 TELNET Terminal Connection 25 SMTP Simple Mail Transfer Protocol 37 TIME Time of Day 39 RLP Resource Location Protocol 42 NAMESERVER Host Name Server 43 NICNAME Who Is 53 DOMAIN Domain Name Server 67 BOOTPS Bootstrap Protocol Server 68 BOOTPC Bootstrap Protocol Client 69 TFTP Trivial File Transfer Protocol 75 Any Private Dial-out Service 77 Any Private RJE Service 79 FINGER Finger 123 NTP Network Time Protocol 133-159 Unassigned 160-223 Reserved 224-241 Unassigned 242-255 Unassigned
|