10.3.12 Lab - Configure ZPFs - ILM
10.3.12 Lab - Configure ZPFs - ILM
Instructor Note: Red font color or gray highlights indicate text that appears in the instructor copy only.
Topology
IP Addressing Table
Device Interface IP Address Subnet Mask Default Gateway Switch Port
R1
G0/0/1 192.168.1.1 255.255.255.0 N/A S1 F0/5
R2 G0/0/0 10.1.1.2 255.255.255.252 N/A N/A
R2
G0/0/1 10.2.2.2 255.255.255.252 N/A N/A
R3 G0/0/0 10.2.2.1 255.255.255.252 N/A N/A
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 22 www.netacad.com
Lab - Configure ZPFs
R3
G0/0/1.3 192.168.3.1 255.255.255.0 N/A S3 F0/5
R3
G0/0/1.33 192.168.33.1 255.255.255.0 N/A S3 F0/5
PC-A NIC 192.168.1.3 255.255.255.0 192.168.1.1 S1 F0/6
PC-B NIC 192.168.3.3 255.255.255.0 192.168.3.1 S3 F0/18
PC-C NIC 192.168.33.3 255.255.255.0 192.168.33.1 S3 F0/23
Blank Line, No additional information
Objectives
Part 1: Basic Device Configuration
Configure host names, interface IP addresses, and access passwords on routers.
Configure the static routes to enable end-to-end connectivity on routers.
Configure access and trunk ports on a switch.
Part 2: Configuring a Zone-Based Policy Firewall (ZPF)
Use the CLI to configure a Zone-Based Policy Firewall.
Use the CLI to verify the configuration.
Part 3: Verify ZPF Firewall Functionality
Background
The most basic form of a Cisco IOS firewall uses access control lists (ACLs) to filter IP traffic and monitor
established traffic patterns. A traditional Cisco IOS firewall is an ACL-based firewall.
The newer Cisco IOS Firewall implementation uses a zone-based approach that operates as a function of
interfaces instead of access control lists. A Zone-Based Policy Firewall (ZPF) allows different inspection
policies to be applied to multiple host groups connected to the same router interface. It can be configured for
extremely advanced, protocol specific, granular control. It prohibits traffic via a default deny-all policy between
different firewall zones. ZPF is suited for multiple interfaces that have similar or varying security requirements.
In this lab, you build a multi-router network, configure the routers and PC hosts, and configure a Zone-Based
Policy Firewall using the Cisco IOS command line interface (CLI).
Note: The routers used with hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.4 (universalk9
image). The switches used in the labs are Cisco Catalyst 2960+ with Cisco IOS Release 15.2(2) (lanbasek9
image). Other routers, switches, and Cisco IOS versions can be used. Depending on the model and Cisco
IOS version, the commands available and the output produced might vary from what is shown in the labs.
Refer to the Router Interface Summary Table at the end of the lab for the correct interface identifiers.
Note: Make sure that the routers and switches have been erased and have no startup configurations.
Required Resources
3 Routers (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
2 Switches (Cisco 2960+ with Cisco IOS Release 15.2(7) lanbasek9 image or comparable)
3 PCs (Windows OS with a terminal emulation program, such as Tera Term or PuTTy installed)
Console cables to configure the Cisco IOS devices via the console ports
Ethernet cables as shown in the topology
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 22 www.netacad.com
Lab - Configure ZPFs
Instructor Notes: This lab is divided into three parts. Each part can be administered individually or in
combination with others as time permits. The main objective of this lab is to configure a ZPF firewall on a
router.
R1 and R3 are on separate networks and communicate through R2, which simulates an ISP.
Students can work in teams of two for router configuration, one person configuring R1 and the other
configuring R3.
Although two switches are shown in the topology, switch S1 can be omitted and use a crossover cable
between PC-A and R1. However, the switch S3 is required between R3 and the PCs in the R3 G0/0/1 LAN.
The switch S3 must support multiple access VLANs and trunking.
The basic running configurations for all three routers are captured after Part 1 of the lab is completed. The
running configuration commands that are added to R3 in Part 2 are captured and listed separately. All
configurations are found at the end of the lab.
Instructions
To prevent the router from attempting to translate incorrectly entered commands, disable DNS lookup.
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 22 www.netacad.com
Lab - Configure ZPFs
know how to reach R1’s and R3’s internal networks before end-to-end IP reachability is achieved. Below
is the static route configuration for R1, R2 and R3. On R1, use the following command:
R1(config)# ip route 0.0.0.0 0.0.0.0 10.1.1.2
b. On R2, use the following commands.
R2(config)# ip route 192.168.1.0 255.255.255.0 10.1.1.1
R2(config)# ip route 192.168.3.0 255.255.255.0 10.2.2.1
R2(config)# ip route 192.168.33.0 255.255.255.0 10.2.2.1
c. On R3, use the following command.
R3(config)# ip route 0.0.0.0 0.0.0.0 10.2.2.2
Step 8: Configure a user account, encrypted passwords and crypto keys for SSH.
Note: Passwords in this task are set to a minimum of 10 characters, but are relatively simple for the benefit of
performing the lab. More complex passwords are recommended in a production network.
a. Configure a minimum password length using the security passwords command to set a minimum
password length of 10 characters.
R1(config)# security passwords min-length 10
b. Configure a domain name.
R1(config)# ip domain-name netsec.com
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 22 www.netacad.com
Lab - Configure ZPFs
Step 9: Save the basic running configuration for all three routers.
Save the running configuration to the startup configuration from the privileged EXEC prompt.
R1# copy running-config startup-config
Close configuration wndow
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 22 www.netacad.com
Lab - Configure ZPFs
No traffic initiated from the Internet should be allowed into the internal or conference room networks.
Returning Internet traffic (return packets coming from the Internet into the R3 site, in response to
requests originating from any of the R3 networks) should be allowed.
Computers in the R3 internal network are considered trusted and are allowed to initiate any type
traffic (TCP, UDP or ICMP based traffic).
Computers in the R3 conference room network are considered untrusted and are allowed to initiate
only web traffic (HTTP or HTTPS) to the Internet.
No traffic is allowed between the internal network and the conference room network. There is no
guarantee regarding the condition of guest computers in the conference room network. Such
machines could be infected with malware and might attempt to send out spam or other malicious
traffic.
a. Ping from R1 to R3 using both of R3’s G0/0/1 interface IP addresses (192.168.3.1 and 192.168.33.1).
If the pings are not successful, troubleshoot the basic device configurations before continuing.
b. Ping from PC-A on the R1 LAN to PC-C on the R3 conference room LAN.
If the pings are not successful, troubleshoot the basic device configurations before continuing.
c. Ping from PC-A on the R1 LAN to PC-B on the R3 internal LAN.
If the pings are not successful, troubleshoot the basic device configurations before continuing.
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 22 www.netacad.com
Lab - Configure ZPFs
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 22 www.netacad.com
Lab - Configure ZPFs
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 22 www.netacad.com
Lab - Configure ZPFs
service-policy INSIDE_TO_INTERNET
Zone-pair name CONFROOM_TO_INTERNET
Source-Zone CONFROOM Destination-Zone INTERNET
service-policy CONFROOM_TO_INTERNET
c. To obtain more information about the zone-pairs, their policy-maps, the class-maps and match counters,
use the show policy-map type inspect zone-pair command:
R3# show policy-map type inspect zone-pair
Zone-pair: CONFROOM_TO_INTERNET
Service-policy inspect : CONFROOM_TO_INTERNET
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 22 www.netacad.com
Lab - Configure ZPFs
zone service
Description: System defined zone
zone INSIDE
Member Interfaces:
GigabitEthernet0/0/1.3
zone CONFROOM
Member Interfaces:
GigabitEthernet0/0/1.33
zone INTERNET
Member Interfaces:
GigabitEthernet0/0/0
b. Even though no commands were issued to create a “self” zone, the output above still displays it.
Question:
Why is R3 displaying a zone named “self”? What is the significance of this zone?
Type your answers here.
The “self” zone is a special default security zone. This zone relates to traffic that originates in or
is destined to the control plane of the router itself (e.g. routing protocols, SSH, SNMP, etc.). By
default, all traffic is allowed into the “self” zone.
Close configuration wndow
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 22 www.netacad.com
Lab - Configure ZPFs
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 22 www.netacad.com
Lab - Configure ZPFs
No. The ICMP packets sent by PC-C enter R3 through its G0/0 interface. Because R3’s G0/0/1.33
was assigned to the CONFROOM zone, R3 correctly sees these ICMP packets as ConfRoom
originating packets. PC-A has an IP address of 192.168.1.3 which does not belong to any of R3’s
networks; R3 must use its default route through R2 to reach this destination. Because the packets
will exit R3 via R3’s G0/0/0 towards R2, R3 correctly concludes the ICMP packets are originating in
the CONFROOM zone towards the INTERNET zone. Based on the security policy in place in R3,
ConfRoom originating packets moving towards the INTERNET zone should only be allowed if they
are HTTP or HTTPS or DNS packets. Because the ping generates ICMP packets, they are dropped
and not able to reach PC-A.
Challenge (optional)
Create the proper zone-pair, class-maps, and policy-maps and configure R3 to prevent Internet originating
traffic from reaching the Self Zone.
R3(config)# policy-map type inspect internet_to_self
R3(config-pmap)# class class-default
R3(config-pmap)# drop
R3(config)# zone-pair security INTERNET_to_Self source INTERNET destination
self
R3(config-sec-zone-pair)# service-policy type inspect internet_to_self
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 22 www.netacad.com
Lab - Configure ZPFs
different interfaces of the same zone to communicate by default. In those cases, a zone-pair must be created
using the same zone as source and destination.
Traffic between similarly zoned interfaces will always be bidirectional due to the fact that the zone-pair’s
source and destination zones are the same. Because of that, there is no need to inspect traffic to allow for
automatic return traffic handling; return traffic will always be allowed because it will always conform to the
zone-pair definition. In this case, the policy-map should have a pass action instead of inspect. Because of
the pass action, the router will not inspect packets matched by the policy-map, it will simply forward it to its
destination.
In the context of this lab, if R3 had a G0/0/1.2 interface also assigned to the INSIDE zone, and the router IOS
version did not support allowing traffic between interfaces configured to the same zone, the extra
configuration would look like this:
New zone-pair: Inside to Inside; allows routing of traffic among the internal trusted interfaces.
Creating the policy-map (notice that no explicit class-map is needed because we use the default “catch-all”
class):
R3(config)# policy-map type inspect inside
R3(config-pmap)# class class-default
R3(config-pmap-c)# pass
Creating the zone-pair and assigning the new policy-map to it. Notice that the INSIDE zone is both the source
and the destination of the zone-pair:
R3(config)# zone-pair security INSIDE source INSIDE destination INSIDE
R3(config-sec-zone-pair)# service-policy type inspect inside
To verify the existence of the new pair, use show zone-pair security:
R3# show zone-pair security
Zone-pair name INSIDE_TO_INTERNET
Source-Zone INSIDE Destination-Zone INTERNET
service-policy INSIDE_TO_INTERNET
Zone-pair name CONFROOM_TO_INTERNET
Source-Zone CONFROOM Destination-Zone INTERNET
service-policy CONFROOM_TO_INTERNET
Zone-pair name INSIDE
Source-Zone INSIDE Destination-Zone INSIDE
service-policy inside
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 22 www.netacad.com
Lab - Configure ZPFs
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many
interfaces the router has. There is no way to effectively list all the combinations of configurations for each router
class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device.
The table does not include any other type of interface, even though a specific router may contain one. An example
of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be used in
Cisco IOS commands to represent the interface.
Device Configurations
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 22 www.netacad.com
Lab - Configure ZPFs
negotiation auto
!
interface GigabitEthernet0/0/1
ip address 192.168.1.1 255.255.255.0
negotiation auto
!
ip forward-protocol nd
no ip http server
ip http secure-server
ip route 0.0.0.0 0.0.0.0 10.1.1.2
!
control-plane
!
!
line con 0
exec-timeout 5 0
logging synchronous
login local
transport input none
stopbits 1
line aux 0
exec-timeout 5 0
logging synchronous
login local
stopbits 1
line vty 0 4
exec-timeout 5 0
logging synchronous
login local
!
end
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 15 of 22 www.netacad.com
Lab - Configure ZPFs
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 16 of 22 www.netacad.com
Lab - Configure ZPFs
exec-timeout 5 0
logging synchronous
login local
end
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 17 of 22 www.netacad.com
Lab - Configure ZPFs
negotiation auto
!
interface GigabitEthernet0/0/1.3
encapsulation dot1Q 3
ip address 192.168.3.1 255.255.255.0
!
interface GigabitEthernet0/0/1.33
encapsulation dot1Q 33
ip address 192.168.33.1 255.255.255.0
!
ip forward-protocol nd
no ip http server
ip http secure-server
ip route 0.0.0.0 0.0.0.0 10.2.2.2
!
control-plane
!
line con 0
exec-timeout 5 0
logging synchronous
login local
transport input none
stopbits 1
line aux 0
exec-timeout 5 0
logging synchronous
login local
stopbits 1
line vty 0 4
exec-timeout 5 0
logging synchronous
login local
!
end
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 18 of 22 www.netacad.com
Lab - Configure ZPFs
boot-start-marker
boot-end-marker
!
no aaa new-model
system mtu routing 1500
!
spanning-tree mode rapid-pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
!
interface FastEthernet0/1
!
interface FastEthernet0/2
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
switchport mode trunk
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
switchport access vlan 3
switchport mode access
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 19 of 22 www.netacad.com
Lab - Configure ZPFs
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
switchport access vlan 33
switchport mode access
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
!
ip http server
ip http secure-server
!
line con 0
line vty 5 15
!
end
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 20 of 22 www.netacad.com
Lab - Configure ZPFs
!
no aaa new-model
!
no ip domain lookup
ip domain name netsec.com
!
login on-success log
!
subscriber templating
!
multilink bundle-name authenticated
!
spanning-tree extend system-id
!
username admin01 secret 9
$9$iogyahiyu3/CWM$pwefMZLpP.o2v0JvqBHHRV1b.jr5zE3G.J/w5Rj.DlY
!
redundancy
mode none
!
class-map type inspect match-any CONFROOM_PROTOCOLS
match protocol http
match protocol https
match protocol dns
class-map type inspect match-any INSIDE_PROTOCOLS
match protocol tcp
match protocol udp
match protocol icmp
!
policy-map type inspect CONFROOM_TO_INTERNET
class type inspect CONFROOM_PROTOCOLS
inspect
class class-default
policy-map type inspect INSIDE_TO_INTERNET
class type inspect INSIDE_PROTOCOLS
inspect
class class-default
!
zone security INSIDE
zone security CONFROOM
zone security INTERNET
zone-pair security CONFROOM_TO_INTERNET source CONFROOM destination INTERNET
service-policy type inspect CONFROOM_TO_INTERNET
zone-pair security INSIDE_TO_INTERNET source INSIDE destination INTERNET
service-policy type inspect INSIDE_TO_INTERNET
!
interface GigabitEthernet0/0/0
ip address 10.2.2.1 255.255.255.252
zone-member security INTERNET
negotiation auto
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 21 of 22 www.netacad.com
Lab - Configure ZPFs
!
interface GigabitEthernet0/0/1
no ip address
negotiation auto
!
interface GigabitEthernet0/0/1.3
encapsulation dot1Q 3
ip address 192.168.3.1 255.255.255.0
zone-member security INSIDE
!
interface GigabitEthernet0/0/1.33
encapsulation dot1Q 33
ip address 192.168.33.1 255.255.255.0
zone-member security CONFROOM
!
ip forward-protocol nd
no ip http server
ip http secure-server
ip route 0.0.0.0 0.0.0.0 10.2.2.2
!
control-plane
!
line con 0
exec-timeout 5 0
logging synchronous
login local
transport input none
stopbits 1
line aux 0
exec-timeout 5 0
logging synchronous
login local
stopbits 1
line vty 0 4
exec-timeout 5 0
logging synchronous
login local
!
end
end of document
2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 22 of 22 www.netacad.com