21.7.6 Lab Configure ASA Network Services Routing and DMZ With ACLs Using CLI
21.7.6 Lab Configure ASA Network Services Routing and DMZ With ACLs Using CLI
Topology
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
Addressing Table
Default
Device Interface IP Address Subnet Mask Gateway Switch Port
R1
G0/0/0 209.165.200.225 255.255.255.248 ASA G1/0
ASA G1/1 (OUTSIDE) 209.165.200.226 255.255.255.248 N/A R1 G0/0/0
ASA N/A
Objectives
Part 1: Configure Basic Device Settings
Part 2: Configure Routing, Address Translation, and Inspection Policy
Part 3: Configure DHCP, AAA, and SSH
Part 4: Configure the DMZ, Static NAT, and ACLs
Background / Scenario
The Cisco Adaptive Security Appliance (ASA) is an advanced network security device that integrates a
stateful firewall, VPN, and FirePOWER services. This lab employs an ASA 5506-X to create a firewall and
protect an internal corporate network from external intruders while allowing internal hosts access to the
Internet. The ASA creates three security interfaces: OUTSIDE, INSIDE, and DMZ. It provides outside users
limited access to the DMZ and no access to inside resources. Inside users can access the DMZ and outside
resources.
The focus of this lab is to configure basic ASA as a basic firewall. Other devices will receive minimal
configuration to support the ASA portion of this lab. This lab uses the ASA CLI, which is similar to the IOS
CLI, to configure basic device and security settings.
In Part 1 of this lab, you will configure the topology and non-ASA devices. This part can be skipped if your
topology is still configured from the previous lab, Configure ASA 5506-X Basic Settings and Firewall Using
CLI. In Part 2, you will configure routing, NAT, and the firewall between the inside and outside networks. In
Part 3, you will configure the ASA for additional services, such as DHCP, AAA, and SSH. In Part 4, you will
configure a DMZ on the ASA and provide access to a server in the DMZ.
Note: The routers used with hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.6 (universalk9
image). The switches used in the labs are Cisco Catalyst 2960+ with Cisco IOS Release 15.2(7) (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.
The ASA used with this lab is a Cisco model 5506-X with an 8-port integrated switch, running OS version
9.15(1), Adaptive Security Device Manager (ASDM) version 7.15(1).
Note: Before you begin, ensure that the devices have been erased and have no startup configurations.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
Instructions
Part 1: Configure Basic Device Settings
In this part, you will set up the network topology and configure basic settings on the routers, such as interface
IP addresses and static routing.
ciscoasa(config)#
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
were blocked by the firewall policy. You will configure the default inspection policy to allow ICMP in the
next step.
Note: Depending on the processes and daemons running on the particular computer used as PC-B, you
may see more translated and untranslated hits than the four echo requests and echo replies.
NETSEC-ASA# show nat
e. Ping from PC-B to R1 again and quickly issue the show xlate command to see the addresses being
translated. However, ICMP is denied, by default, be the firewall inspection policy
NETSEC-ASA# show xlate
1 in use, 1 most used
Flags: D - DNS, e - extended, I - identity, i - dynamic, r - portmap,
s - static, T - twice, N - net-to-net
Note: The flags (r and i) indicate that the translation was based on a port map (r) and was done
dynamically (i).
f. Open a browser on PC-B and enter the IP address of R1 G0/0/0 (https://209.165.200.225). The
connection will fail, but you will see a secure connection error message. These means PC-B received a
replay from R1.The connection was denied because PC-B does not have a certificate for a Secure Socket
Layer (SSL) connection. However, TCP-based HTTP traffic was permitted to egress the OUTSIDE
interface on the ASA, by default, by the firewall inspection policy.
g. On the ASA, reissue the show nat and show xlate commands to see the hits and addresses being
translated for the HTTP connection.
NETSEC-ASA# show nat
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
Step 3: Modify the default MPF application inspection global service policy.
For application layer inspection, as well as other advanced options, the Cisco Modular Policy Framework
(MPF) is available on ASAs. Cisco MPF uses three configuration objects to define modular, object-oriented,
and hierarchical policies:
Class maps - Define a match criterion.
Policy maps - Associate actions to the match criteria.
Service policies - Attach the policy map to an interface, or globally to all interfaces of the appliance.
a. Display the default MPF policy map that performs the inspection on inside-to-outside traffic. Only traffic
that was initiated from the inside is allowed back in to the OUTSIDE interface. Notice that the ICMP
protocol is missing.
NETSEC-ASA# show run | begin class
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
message-length maximum 512
no tcp-inspection
policy-map global_policy
class inspection_default
inspect snmp
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect ip-options
inspect netbios
inspect rsh
inspect rtsp
inspect skinny
inspect esmtp
inspect sqlnet
inspect sunrpc
inspect tftp
inspect sip
!
service-policy global_policy global
<output omitted>
b. Add the inspection of ICMP traffic to the policy map list using the following commands:
NETSEC-ASA# configure terminal
NETSEC-ASA(config)# policy-map global_policy
NETSEC-ASA(config-pmap)# class inspection_default
NETSEC-ASA(config-pmap-c)# inspect icmp
c. Display the default MPF polich map to verify ICMP is now listed in the inspection rules.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
d. From PC-B, attempt to ping the R1 G0/0/0 interface at IP address 209.165.200.225. The pings should be
successful this time because ICMP traffic is now being inspected and legitimate return traffic is being
allowed.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
configure it. However, to manually configure the default gateway, or set it to a different networking
device’s IP address, use the following command:
NETSEC-ASA(config)# dhcpd option 3 ip 192.168.1.1
c. Enable the DHCP daemon within the ASA to listen for DHCP client requests on the enabled interface
(INSIDE).
NETSEC-ASA(config)# dhcpd enable INSIDE
d. Verify the DHCP daemon configuration by using the show run dhcpd command.
NETSEC-ASA(config)# show run dhcpd
dhcpd dns 209.165.201.2
dhcpd option 3 ip 192.168.1.1
!
dhcpd address 192.168.1.5-192.168.1.100 INSIDE
dhcpd enable INSIDE
e. Access the Network Connection IP Properties for PC-B, and change it from a static IP address to a DHCP
client so that it obtains an IP address automatically from the ASA DHCP server. The procedure to do this
varies depending on the PC operating system. It may be necessary to issue the ipconfig /renew
command on PC-B to force it to obtain a new IP address from the ASA.
Verify that PC-B was assigned an IP address from 192.168.1.5 to 192.168.1.100, which will most likely be
192.168.1.5. PC-B should still be able to ping the G0/0/1 interface for R1 at 209.165.200.225.
Note: You may receive a message that a RSA key pair is already defined. To replace the RSA key pair
enter yes at the prompt.
b. Save the RSA keys to persistent flash memory using the write mem command. Your "Cryptochecksum"
values will be different
NETSEC-ASA(config)# write mem
Building configuration...
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
c. Configure the ASA to allow SSH connections from any host on the inside network (192.168.1.0/24) and
from the remote management host at the branch office (172.16.3.3) on the outside network. Set the SSH
timeout to 10 minutes (the default is 5 minutes).
NETSEC-ASA(config)# ssh 192.168.1.0 255.255.255.0 INSIDE
NETSEC-ASA(config)# ssh 172.16.3.3 255.255.255.255 OUTSIDE
NETSEC-ASA(config)# ssh timeout 10
d. On PC-C, use an SSH client (such as TeraTerm) to connect to the ASA OUTSIDE interface at the IP
address 209.165.200.226. The first time you connect you may be prompted by the SSH client to accept
the RSA host key of the ASA SSH server. Log in as user admin and provide the password cisco12345.
e. You can also connect to the ASA INSIDE interface from a PC-B SSH client using the IP address
192.168.1.1.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
c. Display the information for the interfaces using the show ip address command.
NETSEC-ASA # show ip address
System IP Addresses:
Interface Name IP address Subnet mask Method
GigabitEthernet1/1 OUTSIDE 209.165.200.226 255.255.255.248 manual
GigabitEthernet1/2 INSIDE 192.168.1.1 255.255.255.0 manual
GigabitEthernet1/4 DMZ 192.168.2.1 255.255.255.0 manual
Current IP Addresses:
Interface Name IP address Subnet mask Method
GigabitEthernet1/1 OUTSIDE 209.165.200.226 255.255.255.248 manual
GigabitEthernet1/2 INSIDE 192.168.1.1 255.255.255.0 manual
GigabitEthernet1/4 DMZ 192.168.2.1 255.255.255.0 manual
Step 2: Configure static NAT to the DMZ server using a network object.
Configure a network object named DMZ-SERVER and assign it the static IP address of the DMZ server
(192.168.2.3). While in object definition mode, use the nat command to specify that this object is used to
translate a DMZ address to an outside address using static NAT, and specify a public translated address of
209.165.200.227.
NETSEC-ASA# configure terminal
NETSEC-ASA(config)# object network DMZ-SERVER
NETSEC-ASA(config-network-object)# host 192.168.2.3
NETSEC-ASA(config-network-object)# nat (DMZ,OUTSIDE) static 209.165.200.227
NETSEC-ASA(config-network-object)# exit
NETSEC-ASA(config)#
Step 3: Configure an ACL to allow access to the DMZ server from the Internet.
Configure a named access list (OUTSIDE-DMZ) that permits any IP protocol from any external host to the
internal IP address of the DMZ server. Apply the access list to the ASA OUTSIDE interface in the IN direction.
NETSEC-ASA(config)# access-list OUTSIDE-DMZ permit ip any host 192.168.2.3
NETSEC-ASA(config)# access-group OUTSIDE-DMZ in interface OUTSIDE
Note: Unlike IOS ACLs, the ASA ACL permit statement must permit access to the internal private DMZ
address. External hosts access the server using its public static NAT address, the ASA translates it to the
internal host IP address, and then applies the ACL.
You can modify this ACL to allow only services that you want to be exposed to external hosts, such as web
(HTTP) or file transfer (FTP).
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
Note: Pings from inside to outside are translated hits. Pings from outside host PC-C to the DMZ are
considered untranslated hits.
NETSEC-ASA# show xlate
1 in use, 3 most used
Flags: D - DNS, i - dynamic, r - portmap, s - static, I - identity, T - twice
NAT from DMZ:192.168.2.3 to OUTSIDE:209.165.200.227
flags s idle 0:22:58 timeout 0:00:00
Note: This time the flag is “s”, which indicates a static translation.
e. You can also access the DMZ server from a host on the inside network because the ASA INSIDE
interface (G1/2) is set to a security level of 100 (the highest) and the DMZ interface (G1/4) is set to 70.
The ASA acts like a router between the two networks. Ping the DMZ server (PC-A) internal address
(192.168.2.3) from inside network host PC-B (192.168.1.X). The pings should be successful because of
the interface security level and the fact that ICMP is being inspected on the INSIDE interface by the
global inspection policy. The pings from PC-B to PC-A will not affect the NAT translation counts because
both PC-B and PC-A are behind the firewall, and no translation takes place.
The DMZ server cannot ping PC-B on the inside network because the DMZ interface has a lower security
level. Try to ping from the DMZ server PC-A to PC-B at IP address 192.168.1.3. The pings should not be
successful.
Use the show run command to display the configuration for G1/4.
NETSEC-ASA# show run interface g1/4
!
interface g1/4
nameif DMZ
security-level 70
ip address 192.168.2.1 255.255.255.0
Note: An access list can be applied to the INSIDE interface to control the type of access to be permitted
or denied to the DMZ server from inside hosts.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 14 www.netacad.com
Lab 21.7.6 - Configure ASA Network Services, Routing, and DMZ with ACLs Using CLI
Reflection Questions
1. How does the configuration of the ASA firewall differ from that of an ISR?
Type your answers here.
2. What does the ASA use to define address translation and what is the benefit?
Type your answers here.
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.
2019 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 14 www.netacad.com