Free tech learning for everyone, from basics to pro

Network SecurityNetworking SecurityAdvanced

Cisco ASA firewall commands: interfaces, NAT, ACLs and VPN

In short: A quick reference of the Cisco ASA commands used to configure a perimeter firewall. Commands only.

Commands only. Replace values in angle brackets such as <ip> with your own. Only run commands on systems you own or are authorised to manage.

Interfaces and security levels

interface gigabitEthernet 0/0
 nameif outside
 security-level 0
 ip address <public-ip> <mask>
 no shutdown
interface gigabitEthernet 0/1
 nameif inside
 security-level 100
 ip address 192.168.1.1 255.255.255.0
 no shutdown
interface gigabitEthernet 0/2
 nameif dmz
 security-level 50
 ip address 172.16.1.1 255.255.255.0
 no shutdown
route outside 0.0.0.0 0.0.0.0 <isp-gateway>

Management access

hostname ASA1
enable password <strong-secret>
username admin password <strong-secret> privilege 15
aaa authentication ssh console LOCAL
crypto key generate rsa modulus 2048
ssh 192.168.1.0 255.255.255.0 inside
ssh version 2
ssh timeout 10
http server enable
http 192.168.1.0 255.255.255.0 inside
ntp server <ntp-ip>
logging enable
logging host inside <syslog-ip>
logging trap warnings

NAT

object network INSIDE-NET
 subnet 192.168.1.0 255.255.255.0
 nat (inside,outside) dynamic interface
object network WEB-SERVER
 host 172.16.1.10
 nat (dmz,outside) static <public-ip-2>

Access rules

access-list OUTSIDE-IN extended permit tcp any object WEB-SERVER eq https
access-list OUTSIDE-IN extended deny ip any any log
access-group OUTSIDE-IN in interface outside
policy-map global_policy
 class inspection_default
  inspect icmp

Site-to-site IPsec VPN (IKEv2)

object network LOCAL-LAN
 subnet 192.168.1.0 255.255.255.0
object network REMOTE-LAN
 subnet 10.10.0.0 255.255.0.0
access-list VPN-TRAFFIC extended permit ip object LOCAL-LAN object REMOTE-LAN
nat (inside,outside) source static LOCAL-LAN LOCAL-LAN destination static REMOTE-LAN REMOTE-LAN no-proxy-arp route-lookup
crypto ikev2 policy 10
 encryption aes-256
 integrity sha256
 group 14
 prf sha256
 lifetime seconds 86400
crypto ikev2 enable outside
crypto ipsec ikev2 ipsec-proposal AES256
 protocol esp encryption aes-256
 protocol esp integrity sha-256
tunnel-group <peer-ip> type ipsec-l2l
tunnel-group <peer-ip> ipsec-attributes
 ikev2 remote-authentication pre-shared-key <psk>
 ikev2 local-authentication pre-shared-key <psk>
crypto map OUTSIDE-MAP 10 match address VPN-TRAFFIC
crypto map OUTSIDE-MAP 10 set peer <peer-ip>
crypto map OUTSIDE-MAP 10 set ikev2 ipsec-proposal AES256
crypto map OUTSIDE-MAP interface outside

Verification commands

CommandPurpose
show interface ip briefInterfaces and addresses
show nameifInterface names and security levels
show routeRouting table
show connActive connections through the firewall
show xlateActive NAT translations
show access-listAccess rules with hit counts
show crypto ikev2 saIKEv2 tunnels (phase 1)
show crypto ipsec saIPsec security associations and counters (phase 2)
packet-tracer input outside tcp 8.8.8.8 1025 <public-ip-2> 443Simulate a packet through NAT and rules
show running-configCurrent configuration
write memorySave the configuration

Real-world example: putting a web server in the DMZ

A three-interface ASACisco ASAstateful firewallinsidelevel 100, staff LANdmzlevel 50, web serveroutsidelevel 0, internet
Figure 1. A typical ASA layout. Traffic from a higher security level to a lower one is allowed by default; anything else needs an access rule.

A small software company used a Cisco ASA with three interfaces: inside for staff, dmz for a public web server and outside for the internet. Staff could browse because traffic from the inside (level 100) to the outside (level 0) is allowed by default, with dynamic interface NAT sharing the public address. To publish the web server, the engineer created a network object with static NAT to a second public address and an access rule on the outside interface that permitted only HTTPS to that object.

No rule allowed new connections from the DMZ to the inside. When the web application later had a vulnerability, the attacker could not reach the staff network from the compromised server. The engineer used packet-tracer to prove each rule before going live and saved the configuration after every change.

Key takeaways

  • Traffic from higher to lower security levels is allowed by default; the reverse needs an access rule.
  • Object NAT keeps NAT next to the object it translates.
  • Exempt VPN traffic from NAT with an identity (twice) NAT rule.
  • packet-tracer shows exactly which rule or NAT step allows or drops a flow.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.