|
|
This chapter describes how to use traffic filters at your router to control network access.
Traffic filters allow you to control whether router traffic is forwarded or blocked at the router's interfaces. You should use traffic filters to provide a basic level of security for accessing your network. If you do not configure traffic filters on your router, all traffic passing through the router could be allowed onto all parts of your network.
By setting up traffic filters at your router, you can control which traffic enters or leaves your network. Traffic filters are commonly used in "firewalls." Typically, a router configured for traffic filtering is positioned between your internal network and an external network such as the Internet. Using traffic filtering routers allows you to control what traffic is allowed onto your internal network.
Traffic filtering services on Cisco devices are provided by access lists (also called "filters"). Access lists must be defined on a per-protocol basis. In other words, you should define access lists for every protocol enabled on an interface if you want to control traffic flow for that protocol.
This chapter includes the following two sections:
The first section describes standard, static access lists, which are the most commonly used type of access lists. Static access lists should be used with each routed protocol that you have configured for router interfaces.
Lock-and-Key Security, available only for IP traffic, provides additional security functions.
Access lists can be used for many purposes. For example, access lists can be used to:
Access lists can be used for these and other purposes. However, not all uses are recommended as specific security measures. Only the first listed use, controlling packet transmission, is recommended as a valid security measure. The following sections describe how to use access lists to control packet transmission.
To control packet transmission for a given protocol, you must configure access lists for that protocol.
Table 7 and Table 8 identify the protocols for which you can configure access lists.
You should consider configuring access lists for each protocol that you have configured for an interface.
You must identify all access lists by either a name or a number. You assign this name or number to each access list when you define the access list. Access lists of certain protocols must be identified by a name, and access lists of other protocols must be identified by a number. Some protocols can be identified by either a name or a number. When a number is used to identify an access list, the number must be within the specific range of numbers that is valid for the protocol.
Table 7 lists protocols that use access lists specified by names.
| Protocol |
|---|
| Apollo Domain |
| IP |
| Extended IP |
| ISO CLNS |
| Source-route bridging NetBIOS |
| NetBIOS IPX |
Table 8 lists protocols that use access lists specified by numbers, and also includes the range of access list numbers that is valid for each protocol.
| Protocol | Range |
|---|---|
| IP | 1 to 99 |
| Extended IP | 100 to 199 |
| Ethernet type code | 200 to 299 |
| Ethernet address | 700 to 799 |
| Transparent bridging (protocol type) | 200 to 299 |
| Transparent bridging (vendor code) | 700 to 799 |
| Extended transparent bridging | 1100 to 1199 |
| DECnet and extended DECnet | 300 to 399 |
| XNS | 400 to 499 |
| Extended XNS | 500 to 599 |
| AppleTalk | 600 to 699 |
| Source-route bridging (protocol type) | 200 to 299 |
| Source-route bridging (vendor code) | 700 to 799 |
| IPX | 800 to 899 |
| Extended IPX | 900 to 999 |
| IPX SAP | 1000 to 1099 |
| Standard VINES | 1 to 100 |
| Extended VINES | 101 to 200 |
| Simple VINES | 201 to 300 |
Although each protocol has its own set of specific tasks and rules required for you to provide traffic filtering, in general most protocols require at least two steps to be accomplished. The first step is to create an access list definition, and the second step is to apply the access list to an interface. (Note that some protocols refer to access lists as "filters," and some protocols refer to the act of applying the access lists to interfaces as "filtering.")
Access list definitions provide a set of criteria which are applied to each packet that is processed by the router. The router decides whether to forward or block each packet based on whether or not the packet matches the access list criteria.
Typical criteria defined in access lists are packet source addresses, packet destination addresses, or upper-layer protocol of the packet. However, each protocol has its own specific set of criteria that can be defined.
For a given access list, you define each criteria in separate access list statements. These statements specify whether to block or forward packets that match the criteria listed. An access list, then, is the sum of individual statements that all share the same identifying name or number.
Note that each additional criteria statement that you enter is appended to the end of the access list statements. Also, you cannot delete individual statements after they have been created. You can only delete an entire access list.
The order of access list statements is important. When the router is deciding whether to forward or block a packet, the Cisco IOS software tests the packet against each criteria statement in the order the statements were created. After a match is found, no more criteria statements are checked.
If you create a criteria statement that explicitly permits all traffic, no statements added later will ever be checked. If you need additional statements, you must delete the access list and retype it with the new entries.
At the end of every access list is an implied "deny all traffic" criteria statement. Therefore, if a packet does not match any of your criteria statements, the packet will be blocked.
Because the order of access list statements is important, and because you cannot reorder or delete statements, we recommend that you create all access list statements on a tftp server, and then download the entire access list to your router.
To do this, create the access list statements using any text editor, and save the access list in ASCII format to a tftp server that is accessible by your router. Then, from your router, use the copy tftp running-config file_id command to copy the access list to your router. Finally, perform the copy running-config startup-config command to save the access list to your router's NVRAM.
Then, if you ever want to make changes to an access list, you can make them to the text file on the tftp server, and copy the edited file to your router as before. Note that the first command of an edited file should delete the previous access list (for example, type a no access-list command at the beginning of the file). If you do not first delete the previous version of the access list, when you copy the edited file to your router you will merely be appending additional criteria statements to the end of the existing access list.
You can apply only one access list to an interface for a given protocol.
With most protocols, you can apply access lists to interfaces as either inbound or outbound. If the access list is inbound, when the router receives a packet the Cisco IOS software checks the access list's criteria statements 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.
If the access list is outbound, after receiving and routing a packet to the outbound interface, the software checks the access list's criteria statements for a match. If the packet is permitted, the software transmits the packet. If the packet is denied, the software discards the packet.
The guidelines discussed previously apply in general to all protocols. However, the specific guidelines for creating access lists and applying them to interfaces vary from protocol to protocol. See the appropriate protocol-specific chapters in the Cisco IOS configuration guides and command references for detailed task information on each protocol-specific access list.
To authorize remote access to local services, a common security solution is to create access lists, as discussed previously. Standard and static extended access lists have the following limitations:
An improved security solution is the lock-and-key access feature, which is available only with IP extended access lists. Lock-and-key access allows you to set up dynamic access lists that grant access per user to a specific source/destination host through a user authentication process. You can allow user access through a firewall dynamically, without compromising security restrictions.
![]() | Caution Enhancements to the access-list command are backward compatible; migrating from releases prior to Cisco IOS Release 11.1 converts your access lists automatically. However, releases prior to Cisco IOS Release 11.1 are not upwardly compatible with these enhancements. Therefore, if you save an access list with these images and then use software prior to Cisco IOS Release 11.1, the resulting access list will not be interpreted correctly. This could cause you severe security problems. Save your old configuration files before booting these images. |
![]() | Caution Lock-and-key access allows an external event to place an opening in the firewall. After this opening exists, the router is susceptible to source address spoofing. To prevent this, you need to provide encryption support using IP encryption with authentication or encryption. This issue is discussed further in this section. Spoofing is a problem with all existing access-lists. Lock-and-key access does not address this problem. |
Because lock-and-key access introduces a potential pathway through your network firewall, you need to evaluate the following serious considerations:
Two examples of when you might use lock-and-key access are as follows:
The following process describes the lock-and-key access operation:
To configure lock-and-key access, perform the following tasks (Step 1 through Step 6) beginning in global configuration mode:
| Task | Command |
|---|---|
| Step 1 Configure a dynamic access list, which serves as a template and place holder for temporary access list entries. | access-list access-list-number [dynamic dynamic-name [timeout minutes]] {deny | permit} protocol source source-wildcard destination destination-wildcard [precedence precedence] [tos tos] [established] [log] 1 |
| Step 2 Configure an interface. | interface type number 2 |
| Step 3 In interface configuration mode, apply the access list to the interface. | ip access-group access-list-number 3 |
| Step 4 In global configuration mode, define one or more virtual terminal (VTY) ports. If you specify multiple VTY ports, they must all be configured identically because the software hunts for available VTY ports on a round-robin basis. If you do not want to configure all your VTY ports for lock-and-key access, you can specify a group of VTY ports for lock-and-key support only. | line VTY line-number [ending-line-number] 4 |
| Step 5 Configure user authentication. | login tacacs
or username name password secret or password password |
| Step 6 Enable the creation of temporary access list entries. If the host argument is not specified, all hosts on the entire network are allowed to set up a temporary access list entry. The dynamic access list contains the network mask to enable the new network connection. | autocommand access-enable [host] [timeout minutes] |
There are three possible methods to configure an authentication query process (see Step 5 in the previous task list):
Router# login tacacs
Router# username name password password
Router# password password
Router# login local
For an example of lock-and-key access, see the section "Lock-and-Key Access Example" later in this chapter.
Follow these guidelines when you configure dynamic access lists:
When you create dynamic access lists, remember the following:
To manually clear or to display dynamic access lists, refer to the section "Monitor and Maintain Dynamic Access Lists" in this chapter.
User authentication is successful when the following router events occur:
You can verify that this operation is successful on the router by:
The following sample display illustrates what the end-user might see after successfully completing the authentication process. Notice that the connection was closed immediately after the password was entered and authenticated. The temporary access list entry has already been created, and the host that initiated the Telnet session has access inside the firewall.
Router% telnet corporate
Trying 172.21.52.1 ...
Connected to corporate.abc.com.
Escape character is '^]'.
User Access Verification
Password:Connection closed by foreign host.
For an example of lock-and-key access, see the "Lock-and-Key Access Example" at the end of this chapter.
To manually delete a temporary access list entry, perform the following task in privileged EXEC mode:
| Task | Command |
|---|---|
| Delete a dynamic access list. | clear access-template [access-list-number | name] [dynamic-name] [source] [destination] |
You can display temporary access list entries when they are in use. After a temporary access list entry is cleared by you or by the absolute or idle timeout parameter, it can no longer be displayed. The number of matches displayed indicates the number of times the access list entry was hit.
To view dynamic access lists and any temporary access list entries that are currently established, perform the following task in privileged EXEC mode:
| Task | Command |
|---|---|
| Display dynamic access lists and temporary access list entries. | show access-lists [access-list-number] 1 |
The following example shows how to configure lock-and-key access. In this example, login is on the TACACS+ server, so no autocommand command appears in this configuration. Lock-and-key access is configured on the BRI0 interface. Four VTY ports are defined with the password "cisco."
aaa authentication login default tacacs+ enable aaa accounting exec stop-only tacacs+ aaa accounting network stop-only tacacs+ enable password ciscotac ! isdn switch-type basic-dms100 ! interface ethernet0 ip address 172.18.23.9 255.255.255.0 !! interface BRI0 ip address 172.18.21.1 255.255.255.0 encapsulation ppp dialer idle-timeout 3600 dialer wait-for-carrier-time 100 dialer map ip 172.18.21.2 name diana dialer-group 1 isdn spid1 2036333715291 isdn spid2 2036339371566 ppp authentication chap ip access-group 102 in ! access-list 102 dynamic testlist timeout 5 permit ip any any access-list 102 permit tcp any host 172.18.21.2 eq 23 ! ! ip route 172.18.250.0 255.255.255.0 172.18.21.2 priority-list 1 interface BRI0 high tacacs-server host 172.18.23.21 tacacs-server host 172.18.23.14 tacacs-server key test1 tftp-server rom alias all ! dialer-list 1 protocol ip permit ! line con 0 password cisco line aux 0 line VTY 0 4 password cisco !
|
|