This chapter covers the following subjects:
• Zone-based policy firewall overview: Describes the different types of NAT that are available and discusses how to configure them to meet the requirements of modern networks.
• Zone-based Layer 3/4 policy firewall configuration: Describes the concepts and configuration required for a Layer 3/4 firewall.
• Zone-based Layer 7 policy firewall configuration: Describes the concepts and configuration required for a Layer 7 firewall.
One of the most important pieces in securing a network is the implementation of a firewall. This system provides a wall of protection between the sensitive data held inside the organizational network and the potential outside attackers. Although it is only one of the pieces, it is important that the firewall be designed and implemented to mitigate a number of different potential threats. This chapter reviews the options that are available when designing and implementing a Cisco Zone-Based Policy Firewall.
The “Do I Know This Already?” quiz helps you decide whether you really need to read the entire chapter. If you already intend to read the entire chapter, you do not necessarily need to answer these questions now.
The ten-question quiz, derived from the major sections in the “Foundation Topics” section of this chapter, helps you determine how to spend your limited study time.
Table 12-1 outlines the major topics discussed in this chapter and the “Do I Know This Already?” quiz questions that correspond to those topics.
Table 12-1. “Do I Know This Already?” Foundation Topics Section-to-Question Mapping

The goal of self-assessment is to gauge your mastery of the topics in this chapter. If you do not know the answer to a question or are only partially sure of the answer, you should mark this question wrong for purposes of the self-assessment. Giving yourself credit for an answer that you correctly guess skews your self-assessment results and might provide you with a false sense of security.
1. The Context-Based Access Control (CBAC) applies policies using which of the following?
a. inspect statements
b. cbac-policy statements
c. ACLs on interfaces
d. ACLs on zones
3. Traffic between zones is only permitted when?
a. A zone pair is configured.
b. The zone is configured.
c. The zone is assigned to an interface.
d. The ZBPFW feature is enabled.
4. Traffic that is sourced and destined within the same zone can be configured when using at least which IOS version?
a. 12.4.24T
b. 15.1.0M
c. 15.0.1M
d. 12.3.10
5. A parameter map is applied inside which of the following?
a. Class map
b. Service map
c. Interface
d. Policy map
6. Which of the following are valid methods for matching traffic with a class map?
a. match-all
b. match-same
c. match-any
d. match-none
7. Which of the following are valid inspect policy map actions?
a. police
b. ignore
c. inspect
d. deny
8. To configure the ZBPFW for management and control plane traffic, which of the following zones is used?
a. Manage
b. Self
c. Router
d. Entity
9. Which of the following are supported AIC protocols?
a. AOL Instant Messenger
b. TFTP
c. MGCP
d. H.323
10. Which of the following parameter map types is used along with HTTP inspection?
a. GLOB
b. Shell
c. regex
d. inspect
The answers to the “Do I Know This Already?” quiz are found in Appendix A. The suggested choices for your next step are as follows:
• 8 or less overall score: Read the entire chapter. This includes the “Foundation Topics” and the “Exam Preparation” sections.
• 9 or 10 overall score: If you want more review on these topics, skip to the “Exam Preparation” section.
The Zone-Based Policy Firewall (ZBPFW) is the next Cisco implementation of a router-based firewall that runs in Cisco IOS Software. It was introduced in IOS Release 12.4(6)T and takes advantage of many new features that make the configuration and implementation of a firewall easier than was available previously.
The first obvious questions are “What is a firewall used for?” and “How does it perform its function?” A firewall is used to enforce an access policy between security domains. With the ZBPFW feature, these domains are represented by security zones. The previous Cisco IOS firewall feature was called Context-Based Access Control (CBAC), which applied policies through inspect statements and configured access control lists (ACL) between interfaces. ZBPFW applies policies using the Cisco Common Classification Policy Language (C3PL), which closely resembles the Modular QoS Command-Line Interface (MQC) structure. Security classification with C3PL is done through the use of class maps, which are then combined into a security policy that uses policy maps. These policy maps are then applied to a specific security zone pair.
As was supported by CBAC, the ZBPFW supports stateful inspection as well as Application Inspection and Control (AIC), which is also referred to as Deep Packet Inspection (DPI). This includes inspection support for Layers 3 through 7.
Stateful inspection offers the capability to track the connection status of active connections going between the configured zone pair. The connections through the firewall can be tracked by inspecting the setup communications between the source and destination as well as using many other traffic attributes. The tracking database can also be used to allow valid return inbound connections back through the firewall.
AIC provides the ability to perform in-memory reassembly of Layer 4 sessions to obtain stream information between the two connected hosts. It also provides the ability to monitor application layer protocol information and verify that this information is conforming to established standards.
When using both ACLs and zone policies, the ACLs will be considered before any zone polices will be enforced.
As mentioned previously, one of the main differences between a firewall using CBAC and ZBPFW is the use of security zones. These zones separate the specific security areas within a network. Each organization has its own specific security divisions that must be defined before the implementation of a ZBPFW is successful. A typical example would be a firewall that touches three main security zones:
• Internal: Internal organizational network
• DMZ: Where publicly available servers are located
• External: Includes all outside destinations
Figure 12-1 illustrates these three main security zones.


After the zones are created, the interfaces are then assigned to their specific zones, and traffic in and out of each zone interface is controlled by zone policy. A number of rules are used by default when configuring a ZBPFW, including the following:

• Intrazone traffic is freely permitted by default; only IOS Release 15.0.1M and higher will support intrazone policies.
• Interzone traffic is not permitted by default; traffic is allowed only when configured within a zone policy.
• Interfaces are not required to be a member of a zone; however, traffic will not be permitted between an interface in a zone and an interface not in a zone regardless of policy.
ZBPFW is also Virtual Routing and Forwarding (VRF) aware and can be used between different VRFs. Interfaces that are configured in different VRFs should not be configured in the same zone, and thus all interfaces that are in a zone must be configured within the same VRF. If there is a common interface or interfaces that are used by multiple VRFs, a common zone should be created and individually paired with each zone (and thus with each VRF).
Traffic policy is applied unidirectionally between zones using zone pairs. When traffic needs to flow between zones, a zone pair is set up in the direction of the traffic flow. If a bidirectional traffic flow is required, two zone pairs are required, one in each direction. This second zone pair is not required if using stateful inspection and the only expected traffic is return traffic. The second zone pair is not required because this traffic is permitted by default. Figure 12-2 displays a possible configuration when using the three zones described in the previous section.

Zone pairs can also be set up to protect the control and management planes. This is done through the use of the system-defined self zone. The self zone includes all traffic that is directed at the device directly or traffic that is generated by the device, as illustrated in Figure 12-3. As with other zones, the self zone can be used as both the source or destination zone and is also configured unidirectionally.

Figure 12-3. Self Zone Zone Pair

Prior to IOS Release 15.0.1M, all traffic that was sourced and destined for devices inside the same zone was freely permitted. With this IOS release, the ability to configure a zone pair with the same zone as both source and destination is possible; this enables you to apply policies for traffic traveling within the same zone across the device, as illustrated in Figure 12-4.
Figure 12-4. Intrazone Zone Pair

The ZBPFW also supports transparent firewalls, which utilize the bridging interface mode capability. After the bridge mode is configured, these bridged interfaces are then configured in the same way as with routed interfaces by placing the bridged interface into a zone. One big restriction with a transparent firewall is that Network-Based Application Recognition (NBAR) cannot be used.
As stated previously, the configuration of ZBPFW uses the Cisco Common Classification Policy Language (C3PL). This structure should be familiar to many people because it closely resembles Modular Quality of Service Command-Line Interface (MQC). For ZBPFW, a class map is created to match the specific traffic that will be subject to the firewall policy. For Layer 3 and 4 traffic, this is done through the matching of a protocol or access group (ACL) or through a second nested class map. A policy is then created and an action assigned to the traffic matched with the class map.
A default class map is also supported that enables the creation of a catchall rule that is applied should the traffic not match any configured class map. This is useful when specific traffic is required to be dropped while all other permitted traffic needs to be inspected.
The default parameters of inspect type class and policy maps are often used because the parameters are correctly set for many situations. When these parameters need to be changed, a parameter map can be created and applied to the inspect action inside a policy map.
The ZBPFW feature also supports the use of Port to Application Matching (PAM). This feature can be used when nonstandard ports are used for common services. For example, if HTTP is configured to be used on port 8000 instead of 80, with PAM, port 8000 can be mapped as an HTTP port and be analyzed as a normal HTTP connection.
As with all configurations, a number of pieces of information are required before configuration should begin. For ZBPFW, these include

• Security zone separation policy: The specific zones that will be used within the organizational network must be researched and mapped out before configuration should continue.
• Access rule definition: After the specific zones have been defined, the rules that will be configured should be mapped out to ensure both the highest level of security and full operation of existing applications.
• Dynamic application requirements definition: Many protocols are dynamic in how they operate and are inspected in different ways. The requirements for these applications should be mapped out before the firewall is configured to ensure operability.
• Management access requirements: It is vital that the device itself has the highest level of security because it controls the access to the entire network. The specific management requirements for the device should be defined to ensure the security and access to the device.
Figure 12-5 will be used for the configurations displayed in the following sections.
Figure 12-5. Common Configuration Design

The traffic matched using a class map can be based on the protocol or access group (ACL) or through a second nested class map. With Layer 3 and 4 traffic, the class map type is always the inspect type. When configuring the class-map command, there are two different methods of matching traffic, which include the following parameters:
• match-any: When using the match-any parameter, traffic that meets any of the configured match criteria will be matched and be subject to the associated policy.
• match-all: When using the match-all parameter, for the traffic to be matched and be subject to the associated policy, it must match every match command.
Another important thing to keep in mind when using the match-any parameter is to make sure that the more specific match commands are entered before any less specific ones in order. This is to ensure that the traffic is handled and inspected in the most detailed way possible.
Table 12-1 displays the commands that can be used to configure a ZBPFW class map. The class-map command and at least one of the match commands are required.
Table 12-1. Configuring a Layer 3/4 Class Map

Example 12-1 shows the configuration of a class map named DMZ-Internal-class. This matches traffic based on access list 150 and FTP as well as a class map named Internal-DMZ-class, which matches traffic based on access list 151 and FTP. This specifies the traffic that will be allowed between the DMZ and the internal zone.
Example 12-1. Configuring a Layer 3/4 Class Map (DMZ-Internal)
Router# configure terminal
Router(config)# access-list 150 permit any 192.168.1.0 255.255.255.0
Router(config)# access-list 151 permit 192.168.1.0 255.255.255.0 any
Router(config)# class-map type inspect DMZ-Internal-class
Router(config-cmap)# match access-group 150
Router(config-cmap)# match protocol ftp
Router(config)# class-map type inspect Internal-DMZ-class
Router(config-cmap)# match access-group 151
Router(config-cmap)# match protocol ftp
Example 12-2 shows the configuration of a class map named External-DMZ-class that matches traffic based on HTTP. This specifies the traffic that will be allowed between the external zone and the DMZ.
Example 12-2. Configuring a Layer 3/4 Class Map (External-DMZ)
Router# configure terminal
Router(config)# class-map type inspect External-DMZ-class
Router(config-cmap)# match protocol http
Example 12-3 shows the configuration of a class map named Internal-External-class that matches traffic based on protocols AOL and ICQ (instant messengers) and IRC (relay chat). This specifies the traffic that will be allowed between the internal zone and the external zone.
Example 12-3. Configuring a Layer 3/4 Class Map (Internal-External)
Router# configure terminal
Router(config)# class-map type inspect Internal-External-class
Router(config-cmap)# match protocol aol
Router(config-cmap)# match protocol icq
Router(config-cmap)# match protocol irc
When using the inspect type policy map, the creation of a parameter map is optional and can be included within the policy map configuration. A number of different parameters can be altered within a parameter map that change the behavior of the stateful inspection engine. Table 12-2 displays the most commonly used parameter options and their default settings.
Table 12-2. Parameter Map Options


Example 12-4 shows the configuration of a parameter map named example-parms that enables IOS stateful packet inspection alert messages.
Example 12-4. Configuring a Parameter Map
Router# configure terminal
Router(config)# parameter-map type inspect example-parms
Router(config-profile)# alert on
A policy map is used to configure the action that will be taken with the traffic that was matched within the class map configuration. Table 12-3 highlights a limited number of actions that are available when using ZBPFW.

Table 12-3. Policy Map Actions

Policing is not permitted on zone pairs that have the self zone as source or destination.
Table 12-4 displays the commands that can be used to configure a ZBPFW policy map. The policy-map command and at least one of the inspect, pass, drop, or police commands is required. To nest a Layer 7 policy map using the service-policy command, the inspect action must be configured first.
Table 12-4. Configuring a Layer 3/4 Policy Map

Example 12-5 shows the configuration of two policies:
• DMZ-Internal-policy: Automatically passes all traffic matched with the DMZ-Internal-class
• Internal-DMZ-policy: Automatically passes all traffic matched with the Internal-DMZ-class
Example 12-5. Configuring a Layer 3/4 Policy Map (DMZ-Internal)
Router# configure terminal
Router(config)# policy-map type inspect DMZ-Internal-policy
Router(config-pmap)# class type inspect DMZ-Internal-class
Router(config-pmap-c)# pass
Router(config-pmap-c)# policy-map type inspect Internal-DMZ-policy
Router(config-pmap)# class type inspect Internal-DMZ-class
Router(config-pmap-c)# pass
Example 12-6 shows the configuration of a policy map named External-DMZ-policy that automatically passes all traffic matched with the External-DMZ-class.
Example 12-6. Configuring a Layer 3/4 Policy Map (External-DMZ)
Router# configure terminal
Router(config)# policy-map type inspect External-DMZ-policy
Router(config-pmap)# class type inspect External-DMZ-class
Router(config-pmap-c)# pass
Example 12-7 shows the configuration of a policy map named Internal-External-policy that automatically drops all traffic matched with the Internal-External-class and inspects all unmatched traffic using the example-parms parameter map.
Example 12-7. Configuring a Layer 3/4 Policy Map (Internal-External)
Router# configure terminal
Router(config)# policy-map type inspect Internal-External-policy
Router(config-pmap)# class type inspect Internal-External-class
Router(config-pmap-c)# drop
Router(config-pmap)# class class-default
Router(config-pmap-c)# inspect example-parms
The configuration of the zones is simple because it only requires the creation of the zone itself and the assignment of specific interfaces into the zone.
Table 12-5 displays the commands that can be used to create zones and assign interfaces into their assigned zone.
Table 12-5. Configuring and Assigning Zones

Example 12-8 shows the creation of the DMZ, internal, and external zones.
Example 12-8. Configuring Zones
Router# configure terminal
Router(config)# zone security DMZ
Router(config-sec-zone)# zone security internal
Router(config-sec-zone)# zone security external
Example 12-9 shows the assignment of interfaces fastethernet0/0, 0/1, and 0/2 into their respective zones.
Example 12-9. Assigning Interfaces into Zones
Router# configure terminal
Router(config)# interface fastethernet0/0
Router(config-if)# zone-member security internal
Router(config-if)# interface fastethernet0/1
Router(config-if)# zone-member security DMZ
Router(config-if)# interface fastethernet0/2
Router(config-if)# zone-member security external
The configuration of the zone pair is important because its configuration dictates the direction in which traffic is allowed to flow. As stated previously, a zone pair is unidirectional and is the part of the configuration that controls traffic between zones; this is referred to as interzone. If no zone pair is defined, traffic will not flow between zones. The only exception to the unidirectional behavior of zone pairs is with return traffic; this traffic is inspected and permitted based on the configured policy. The zone pair can also be configured to control the traffic permitted directly into the device; this includes control and management plane traffic. This is configured by creating a zone pair using the self zone as the source or destination zone. With the release of IOS 15.0.1M, it is also possible to control the traffic within the same zone; this is referred to as intrazone. This is configured by creating a zone pair with the same two zone names as both source and destination.
The zone pair configuration is also where the firewall policy is applied. Make sure to associate the correct firewall policy with the correct zone pair.
Table 12-6 displays the commands that can be used to create zone pairs and are used to apply a firewall policy to each specific zone pair.
Table 12-6. Configuring Zone Pairs and Assigning Firewall Policy

Example 12-10 shows the creation of two zone pairs, one going from the DMZ to the internal zone and the other from the internal zone to the DMZ. Both allow FTP traffic between the DMZ and internal zones in each direction.
Example 12-10. Configuring Zone Pairs and Assigning Firewall Policy (DMZ-Internal)
Router# configure terminal
Router(config)# zone-pair DMZ-Internal-pair source DMZ destination internal
Router(config-sec-zone-pair)# service-policy type inspect DMZ-Internal-policy
Router(config-sec-zone-pair)# zone-pair Internal-DMZ-pair source internal
destination DMZ
Router(config-sec-zone-pair)# service-policy type inspect Internal-DMZ-policy
Example 12-11 shows the creation of two zone pairs, one going from the external zone to the DMZ and the other from the DMZ to the external zone. Both allow unrestricted HTTP traffic between the DMZ and internal zone in each direction. It was also possible to configure this differently by inspecting the traffic from the external zone into the DMZ. In this scenario, only one zone pair would be required because the traffic coming into the HTTP server would be monitored and only permitted return traffic would be allowed.
Example 12-11. Configuring Zone Pairs and Assigning Firewall Policy (External-DMZ)
Router# configure terminal
Router(config)# zone-pair External-DMZ-pair source external destination DMZ
Router(config-sec-zone-pair)# service-policy type inspect External-DMZ-policy
Router(config-sec-zone-pair)# zone-pair DMZ-Internal-pair source DMZ destination
external
Router(config-sec-zone-pair)# service-policy type inspect External-DMZ-policy
Example 12-12 shows the creation of a zone pair between the internal zone and external zone and is applied in the direction from the internal zone to the external zone. The Internal-External-policy firewall policy is then applied to the zone pair. In this case, the traffic is inspected, so the second zone pair is not needed for return traffic.
Example 12-12. Configuring Zone Pair and Assigning Firewall Policy (Internal-External)
Router# configure terminal
Router(config)# zone-pair Internal-External-pair internal DMZ destination external
Router(config-sec-zone-pair)# service-policy type inspect Internal-External-policy
As discussed previously, Port to Application Mapping (PAM) enables you to use nonstandard ports for standard services. For example, if HTTP traffic was going to use port 8080 instead of 80, PAM could be used to associate port 8080 with HTTP. After this configuration is complete, commands such as match protocol http could be used to detect traffic on these ports as well as the standard ports.
System-defined port mapping cannot be changed or deleted. This means that, although it is possible to associate HTTP traffic with port 8080, it is not possible to associate it with another well-known port, such as 21 (FTP).
Table 12-7 shows a list of system-defined port mappings.
Table 12-7. System-Defined Port Mappings

PAM can be configured in one of two ways:
• On the service as a whole (all hosts)
• Host-specific
The host-specific option enables you to associate different ports not only based on their port number but also based on the device. In this situation, port associations could be different from one host to another.
Table 12-8 displays the commands that can be used to configure PAMs.

Example 12-13 shows the mapping of the HTTP application to port 8080.
Example 12-13. Configuring HTTP PAMs
Router# configure terminal
Router(config)# ip port-map http port 8080
The use of the Layer 7 policies with a zone-based firewall is also supported. This capability allows the device to control the traffic through attributes that are provided at Layers 5–7. A requirement of these policies is that they must be nested under an existing Layer 3/4 policy map to be applied (using the service-policy command) and there must be an inspect action configured first.
A number of different protocols are supported using Application Inspection and Control (AIC):
• America Online (AOL) Instant Messenger
• eDonkey P2P protocol
• FastTrack traffic P2P protocol
• Gnutella Version 2 traffic P2P protocol
• H.323 VoIP Protocol version 4
• Hypertext Transfer Protocol (HTTP) (URL filtering and HTTP inspection)
• Internet Message Access Protocol (IMAP)
• I Seek You (ICQ) IM protocol
• Kazaa Version 2 P2P protocol
• MSN Messenger IM protocol
• Post Office Protocol version 3 (POP3)
• Session Initiation Protocol (SIP)
• Simple Mail Transfer Protocol (SMTP)
• Windows Messenger IM protocol
• Yahoo IM protocol
The URL filter and HTTP inspection features are covered in the following sections.
The URL Filter feature provides the ability to pass, drop, or log the traffic whose URL matches specific configured characteristics. These characteristics can be quite robust, including the capability to match traffic based on something as simple as a domain or something as complex as is provided by category matching (porn, gaming, weapons, and so on). The more complex configurations use an external URL filtering server, including support for Websense and N2H2. Unlike with the simpler Layer 3/4 configurations demonstrated in the previous section, the URL Filtering feature requires the configuration of a parameter map. The parameter map is used to define the specific parameters that will be referenced in the class map or policy map.
Two different types of parameter maps can be configured for the URL Filter feature:
• URL filter policy parameter map: Sets up the different parameters to be used with the URL filter policy.
• URL filter - GLOB parameter map: Specifies a list of domains, URL keywords, or URL metacharacters when setting up a local whitelist or blacklist.
The options that are available using the URL filter policy parameter map depend on the type of URL filtering that is going to be used: local, N2H2, or Websense. N2H2 and Websense provide competing databases that can be referenced when performing URL filtering. Table 12-9 lists the available options.
Table 12-9. Configuring URL Filter Policy Parameter Map


Example 12-14 shows the configuration of a URL filter policy parameter map using a local filtering database that enables URL filtering alert messages and changes the blocked page message to “Access Denied.”
Example 12-14. Configuring URL Filter Policy Parameter Map
Router# configure terminal
Router(config)# parameter-map type urlfpolicy local local-urlf-parameter-map
Router(config-profile)# alert on
Router(config-profile)# block-page message "Access Denied"
The URL filter - GLOB parameter map is used to configure the specific traffic patterns that will be matched to server domains or URL keywords used inside the URL filter class map. The pattern matching is rather flexible. For matching server domains, a simple expression like “microsoft.com” will work to match URLs with “microsoft.com” in them. A URL keyword is matched against any part of the URL after the initial / character and between any later / characters. The pattern matching is only limited by matching the /, {, and } characters, which are not permitted. Table 12-10 shows the different expressions that are supported.
Table 12-10. URL Filtering GLOB Expressions

Table 12-11 displays the commands that can be used to configure URL filtering.
Table 12-11. Commands to Configure the URL Filter - GLOB Parameter Map

Example 12-15 shows the configuration of two expressions:
• One matching the server domain: The server domains to be matched would be the ones containing testing-1.com, testing-2.com, or testing-3.com.
• One matching URL keywords: The URL keyword to be matched would include a URL with the words test or example (For example, http://www.testing-1.com/test/index.html).
Example 12-15. Configuring URL Filter - GLOB Parameter Map
Router# configure terminal
Router(config)# parameter-map type urlf-glob glob_server_parameter_map
Router(config-profile)# pattern testing-[1-3].com
Router(config)# parameter-map type urlf-glob glob_keyword_parameter_map
Router(config-profile)# pattern test
Router(config-profile)# pattern example
The class map is used to match the specific traffic, as described in the earlier sections. The options that are available using the class map depend on the type of URL filtering that is going to be used: local, N2H2, or Websense.
When setting up a local matching database, there are two available options: to match based on the server domain or to match based on a URL keyword. When setting up a remote URL-filtering solution, like N2H2 or Websense, only matching based on server response is supported.
Table 12-12 displays the commands that can be used to configure a URL filter class map.
Table 12-12. Configuring URL Filter Class Map

Example 12-16 shows the configuration of a URL filter class map that matches traffic based on the glob_server_parameter_map and glob_keyword_parameter_map parameter maps configured in Example 12-15.
Example 12-16. Configuring URL Filter Class Map
Router# configure terminal
Router(config)# class-map type urlfilter url_class_map
Router(config-cmap)# match server-domain urlf-glob glob_server_parameter_map
Router(config-cmap)# match url-keyword urlf-glob glob_keyword_parameter_map
The policy map is used to create the policy that will use all the different variables configured with the parameter maps and class map and dictates the behavior of the matched traffic. Table 12-13 lists the available policy actions.
Table 12-13. URL Filter Policy Map Actions

Table 12-14 displays the commands that can be used to configure a URL filter policy map.
Table 12-14. Commands to Configure a URL Filter Policy Map

Example 12-17 shows the configuration of a URL filter policy map that uses the parameters in the local-urlf-parameter-map created in one of the previous sections, matches traffic based on the url_class_map defined in the previous section, and logs all matched traffic.
Example 12-17. Configuring URL Filter Policy Map
Router# configure terminal
Router(config)# policy-map type inspect urlfilter url_policy_map
Router(config-pmap)# parameter type urlfilter local local-urlf-parametermap
Router(config-pmap)# class type urlfilter url_class_map
Router(config-pmap-c)# log
The application of a URL filter policy map can be confusing because it is not possible to directly associate it with a specific zone pair as is possible with a Layer 3/4 policy map. With a Layer 7 policy map, the URL filter policy map must be nested under an existing Layer 3/4 policy using the service-policy command.
To apply a URL filter policy to a Layer 3/4 policy map, enter the following command:
Router(config-pmap-c)# service-policy urlfilter DPI_policy_map_name
Example 12-18 shows the association of the url_policy_map created in the previous section with a Layer 3/4 policy.
Example 12-18. Applying a URL Filter Policy
Router# configure terminal
Router(config)# class-map type inspect http_class_map
Router(config-cmap)# match protocol http
Router(config-cmap)# exit
Router(config)# policy-map type inspect http_policy_map
Router(config-pmap)# class http_class_map
Router(config-pmap-c)# inspect
Router(config-pmap-c)# service-policy urlfilter url_policy_map
The ability to inspect HTTP traffic directly is also possible with ZBPFW using AIC. As with the previous features, HTTP inspection is configured using the C3PL. The abilities of the HTTP inspection engine are quite vast and will be covered briefly in the following sections. For information on all the available features, check out Cisco.com.
With HTTP inspection, only one parameter map needs to be configured if the class map requires pattern matching. The regex parameter map offers the ability to do very detailed pattern matching using a number of different variables. The pattern-matching abilities are not the same as URL filtering, as described in Table 12-15. Table 12-16 shows how a HTTP Inspection parameter map is created and configured.
Table 12-15. HTTP Inspection Regex Expressions


Table 12-16. Configuring HTTP Inspection Parameter Map

Example 12-19 shows the configuration of a regex parameter map that matches either tim or tom.
Example 12-19. Configuring HTTP Inspection Parameter Map
Router# configure terminal
Router(config)# parameter-map type regex http_DPI_parameter_map
Router(config-profile)# pattern t(i|o)m
The HTTP inspection-matching abilities are quite extensive and include several options for the HTTP request, HTTP response, or both. There are also a couple of different options that can be used to detect other criteria, including non-HTTP traffic using HTTP ports and whether the traffic contains Java applet(s). Table 12-17 shows a number of the available options.
Table 12-17. Configuring HTTP Inspection Class Map


Example 12-20 shows the configuration of an HTTP inspection class map that matches traffic that is misusing the HTTP port or traffic that contains tim or tom as configured in the regex_parameter_map.
Example 12-20. Configuring HTTP Inspection Class Map
Router# configure terminal
Router(config)# class-map type inspect http match-any http_DPI_class_map
Router(config-cmap)# match request port-misuse any
Router(config-cmap)# match req-resp body regex http_DPI_parameter_map
The policy map is used to create the policy that will then be enforced against the traffic matched in the class map. Table 12-18 lists the available policy actions.

Table 12-18. HTTP Inspection Policy Map Actions

Table 12-19 displays the commands that can be used to configure an HTTP inspection policy map.
Table 12-19. Commands to Configure HTTP Inspection Policy Map

Example 12-21 shows the configuration of an HTTP inspection policy map that matches traffic based on the http_DPI_class_map and resets the connection of this traffic.
Example 12-21. Configuring HTTP Inspection Policy Map
Router# configure terminal
Router(config)# policy-map type inspect http http_DPI_policy_map
Router(config-pmap)# class-map type inspect http http_DPI_class_map
Router(config-pmap-c)# reset
The application of an HTTP inspection policy map is completed in the same way as a URL-filtering policy:
Router(config-pmap-c)# service-policy http DPI_policy_map_name
Example 12-22 shows the association of the http_DPI_policy_map created in the previous section with a Layer 3/4 policy.
Example 12-22. Applying an HTTP Inspection Policy
Router# configure terminal
Router(config)# class-map type inspect http_class_map
Router(config-cmap)# match protocol http
Router(config-cmap)# exit
Router(config)# policy-map type inspect http_policy_map
Router(config-pmap)# class http_class_map
Router(config-pmap-c)# inspect
Router(config-pmap-c)# service-policy http http_DPI_policy_map
As mentioned in the section, “How to Use This Book,” in the Introduction, you have several choices for exam preparation: the exercises here, the memory tables in Appendix C, the final exam preparation chapter, and the exam simulation questions on the CD-ROM. The following questions present a bigger challenge than the exam itself because they use an open-ended question format. By using this more difficult format, you exercise your memory better and prove your conceptual and factual knowledge of this chapter. You can find the answers to these questions in Appendix A, “Answers to the DIKTA’ Quizzes and Fill in the Blanks Questions.”
Review the most important topics in the chapter, noted with the Key Topics icon in the margin of the page. Table 12-20 lists a reference of these key topics and the page numbers on which each is found.

Print a copy of Appendix C, “Memory Tables” (found on the CD), or at least the section for this chapter, and complete the tables and lists from memory. Appendix D, “Memory Table Answers,” also on the CD, includes completed tables and lists to check your work.
Define the following key terms from this chapter, and check your answers in the Glossary:
Table 12-21 lists the important commands from this chapter. To test your memory, cover the right side of the table with a piece of paper, read the description on the left side, and then see how much of the command you can remember.
Table 12-21. Command Reference










