Pix ASA
Pix ASA
Copyright Information
Copyright © 2003 - 2007 Internetwork Expert, Inc. All rights reserved.
The following publication, CCIE Security Lab Workbook Volume I, was developed by
Internetwork Expert, Inc. All rights reserved. No part of this publication may be
reproduced or distributed in any form or by any means without the prior written
permission of Internetwork Expert, Inc.
Cisco®, Cisco® Systems, CCIE, and Cisco Certified Internetwork Expert, are registered
trademarks of Cisco® Systems, Inc. and/or its affiliates in the U.S. and certain countries.
All other products and company names are the trademarks, registered trademarks, and service
marks of the respective owners. Throughout this manual, Internetwork Expert, Inc. has used its
best efforts to distinguish proprietary trademarks from descriptive names by following the
capitalization styles used by the manufacturer.
Disclaimer
The following publication, CCIE Security Lab Workbook Volume I, is designed to assist
candidates in the preparation for Cisco Systems ’CCIERout i
ng&Swi t
chingLabexam.Whi l
e
every effort has been made to ensure that all material is as complete and accurate as
possible, the enclosed material is presented onan“ asis”basi s .Nei t
hertheaut hor snor
Internetwork Expert, Inc. assume any liability or responsibility to any person or entity with
respect to loss or damages incurred from the information contained in this workbook.
This workbook was developed by Internetwork Expert, Inc. and is an original work of the
aforementioned authors. Any similarities between material presented in this workbook and
TM
actual CCIE lab material is completely coincidental.
Table of Contents
PIX/ASA FIREWALL.......................................................................... 1
BASIC CONFIGURATION ........................................................................................1
Configuring VLANs and IP Addressing ..........................................................1
Configuring and Authenticating RIP...............................................................7
Configuring and Authenticating OSPF .........................................................10
Redistribution, Summarization and Route Filtering......................................14
ACCESS CONTROL.............................................................................................19
Common Configuration................................................................................19
Filtering with IP Access Lists .......................................................................22
Using Object Groups ...................................................................................26
Administrative Access Management............................................................31
ICMP Traffic Management ...........................................................................34
Configuring Filtering Services ......................................................................37
CONFIGURING NAT ...........................................................................................39
Dynamic NAT and PAT................................................................................39
Static NAT and PAT.....................................................................................43
Dynamic Policy NAT ....................................................................................46
Static Policy NAT and PAT ..........................................................................48
Identity NAT and NAT Exemption ................................................................51
Outside Dynamic NAT .................................................................................53
DNS Doctoring with Alias.............................................................................56
DNS Doctoring with Static............................................................................60
Same Security Traffic and NAT ...................................................................64
ADVANCED FIREWALL ........................................................................................69
Firewall Contexts Configuration ...................................................................69
Administrative Context and Resource Management....................................79
Active Stateful Failover with Failover Interface ............................................83
Active Stateful Failover with Failover Interface ............................................89
Monitoring Interfaces with Active/Active Failover.........................................99
Filtering with L2 Transparent Firewall ........................................................104
ARP Inspection with Transparent Firewall .................................................107
Filtering Non-IP Traffic with L2 Transparent FW........................................109
Handling Fragmented Traffic .....................................................................111
Handling Some Application Issues ............................................................113
BGP Through the PIX/ASA Firewall...........................................................115
Multicast Routing across the PIX/ASA Firewall..........................................118
System Monitoring .....................................................................................123
DHCP Server .............................................................................................126
MODULAR POLICY FRAMEWORK .......................................................................129
HTTP Inspection with MPF ........................................................................129
Advanced FTP Inspection..........................................................................133
Advanced ESMTP Inspection ....................................................................138
PIX/ASA Firewall
Basic Configuration
Directions
o Configure the switchports for the E0/1 (inside) and E0/0 (outside)
interfaces of the ASA1 into respective VLANs.
o Configure the switchport for the E0/2 interface of the ASA1 as
802.1q trunk.
o Usernamei f“ out
si de”.
o Use security-level 0.
o Usernamei f“ i
nside”.
o Use security-level 100.
Final Configuration
SW1:
vlan 100,120,121,124
!
interface Fa 0/1
switchport host
switchport access vlan 121
!
interface Fa 0/2
switchport host
switchport access vlan 100
!
interface Fa 0/3
switchport host
switchport access vlan 100
!
interface Fa 0/4
switchport host
switchport access vlan 124
!
interface Fa 0/13
switchport host
switchport access vlan 121
!
interface Fa 0/20
switchport host
switchport access vlan 120
!
! trunks
!
interface range fa 0/21 - 23
switchport trunk encapsulation dot1q
switchport mode dynamic desirable
SW2:
vlan 100,120,121,124
!
interface Fa 0/12
switchport host
switchport access vlan 100
!
interface Fa 0/13
switchport trunk encapsulation dot1q
switchport mode trunk
!
! trunks
!
interface range fa 0/21 - 23
switchport trunk encapsulation dot1q
switchport mode dynamic auto
ASA1:
interface Ethernet0/0
nameif outside
security-level 0
ip address 136.1.0.12 255.255.255.0
no shutdown
!
interface Ethernet0/1
nameif inside
security-level 100
ip address 136.1.121.12 255.255.255.0
no shutdown
!
interface Ethernet0/2
no nameif
no security-level
no ip address
no shutdown
!
interface Ethernet0/2.120
vlan 120
nameif dmz1
security-level 75
ip address 10.0.0.12 255.255.255.0
no shutdown
!
interface Ethernet0/2.124
vlan 124
nameif dmz2
security-level 50
ip address 136.1.124.12 255.255.255.0
no shutdown
R1:
interface Eth 0/0
no shutdown
ip address 136.1.121.1 255.255.255.0
!
R2:
interface Eth 0/0
no shutdown
ip address 136.1.0.2 255.255.255.0
R3:
interface Eth 0/0
no shutdown
ip address 136.1.0.3 255.255.255.0
R4:
interface Eth 0/0
no shutdown
ip address 136.1.124.4 255.255.255.0
Verification
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms
Further Reading
Configuring VLANs: Configuring VLAN Trunks
Configuring Interface Parameters
Configuring Ethernet Settings and Subinterfaces
AAA/CA
Server
RIPv2
DMZ1 E 0/0 R2
Inside Outside
ASA1
R1 RIPv2
E 0/0
DMZ2 E 0/0
R3
E 0/0
R4
Directions
Final Configuration
ASA1:
!
! RIP process configuration
!
router rip
network 10.0.0.0
network 136.1.0.0
passive-interface default
no passive-interface inside
no passive-interface dmz1
version 2
no auto-summary
!
! MD5 Authentication on Inside
!
interface Ethernet0/1
rip authentication mode md5
rip authentication key CISCO key_id 1
R1:
router rip
version 2
no auto-summary
network 136.1.0.0
!
! MD5 Authentication
!
key chain RIP
key 1
key-string CISCO
!
interface Ethernet 0/0
ip rip authentication mode md5
ip rip authentication key-chain RIP
!
Verification
R1#show ip protocols
Routing Protocol is "rip"
Sending updates every 30 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 2, receive version 2
Interface Send Recv Triggered RIP Key-chain
Ethernet0/0 2 2 RIP
Automatic network summarization is not in effect
Maximum path: 4
Routing for Networks:
136.1.0.0
Routing Information Sources:
Gateway Distance Last Update
Distance: (default is 120)
R1#debug ip rip
RIP protocol debugging is on
R1#
*Mar 21 11:59:08.454: RIP: sending v2 update to 224.0.0.9 via Ethernet0/0
(136.1.121.1)
*Mar 21 11:59:08.454: RIP: build update entries - suppressing null update
*Mar 21 11:59:11.215: RIP: received packet with MD5 authentication
*Mar 21 11:59:11.215: RIP: received v2 update from 136.1.121.12 on Ethernet0/0
*Mar 21 11:59:11.215: 10.0.0.0/24 via 0.0.0.0 in 1 hops
*Mar 21 11:59:11.215: 136.1.0.0/24 via 0.0.0.0 in 1 hops
*Mar 21 11:59:11.219: 136.1.124.0/24 via 0.0.0.0 in 1 hops
Further Reading
ASA Command Line Configuration Guide: Configuring RIP
AAA/CA
Server
DMZ1 E 0/0 R2
Inside Outside
ASA1
R1
OSPF
E 0/0 Area 0
DMZ2 E 0/0
R3
OSPF
Area 1
E 0/0
R4
Directions
o Use process-id 1.
o Use router-id 150.1.12.12.
Final Configuration
ASA1:
!
! OSPF routing process
!
router ospf 1
network 136.1.0.0 255.255.255.0 area 0
network 136.1.124.0 255.255.255.0 area 1
router-id 150.1.12.12
area 0 authentication
!
! Authentication for area 1 is configured solely on interface
!
interface Ethernet0/2.124
ospf message-digest-key 1 md5 CISCO
ospf authentication message-digest
ospf priority 0
!
! Only the auth key is configured at interface level
!
interface Ethernet0/0
ospf authentication-key CISCO
ospf priority 0
R2:
router ospf 1
router-id 150.1.2.2
network 136.1.0.0 0.0.0.255 area 0
area 0 authentication
!
interface Ethernet 0/0
ip ospf authentication-key CISCO
R3:
router ospf 1
router-id 150.1.3.3
network 136.1.0.0 0.0.0.255 area 0
area 0 authentication
!
interface Ethernet 0/0
ip ospf authentication-key CISCO
R4:
router ospf 1
router-id 150.1.4.4
network 136.1.124.0 0.0.0.255 area 1
!
interface Ethernet 0/0
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 CISCO
Verification
Further Reading
ASA Command Line Configuration Guide: Configuring OSPF
Objective: Redistribute between OSPF and RIP. Summarize and filter routes on
redistribution.
AAA/CA
Server Lo0: 150.X.2.2/24
RIPv2 Lo1: 192.168.1.2/24
Lo2: 192.168.3.2/24
DMZ1 E 0/0 R2 Lo3: 192.168.5.2/24
Inside Outside
Lo0: 150.X.1.1/24
Lo1: 192.168.10.1/27 ASA1
Lo2: 192.168.10.33/27 R1 RIPv2 OSPF
Lo3: 192.168.10.65/27 E 0/0 Area 0
DMZ2 E 0/0
Lo0: 150.X.3.3/24
R3
OSPF
Area 1
E 0/0
Lo0: 150.X.4.4/24
R4
Directions
Make sure that R2, R3 and R4 receive only summary prefix for the
192.168.10.0/27, 192.168.10.32/27, 192.168.10.64/27 networks.
Final Configuration
R1:
!
! Create the Loopbacks
!
interface Loopback0
ip address 150.1.1.1 255.255.255.0
!
interface Loopback1
ip address 192.168.10.1 255.255.255.224
!
interface Loopback2
ip address 192.168.10.33 255.255.255.224
!
interface Loopback3
ip address 192.168.10.65 255.255.255.224
!
! Advertise the Loopbacks
!
router rip
network 150.1.0.0
network 192.168.10.0
R2:
!
! Create the Loopbacks
!
interface Loopback0
ip address 150.1.2.2 255.255.255.0
ip ospf network point-to-point
!
interface Loopback1
ip address 192.168.1.2 255.255.255.0
ip ospf network point-to-point
!
interface Loopback2
ip address 192.168.3.2 255.255.255.0
ip ospf network point-to-point
!
interface Loopback3
ip address 192.168.5.2 255.255.255.0
ip ospf network point-to-point
!
! Advertise the Loopbacks
!
router ospf 1
network 150.1.2.2 0.0.0.0 area 0
network 192.168.1.2 0.0.0.0 area 0
network 192.168.3.2 0.0.0.0 area 0
network 192.168.5.2 0.0.0.0 area 0
R3:
!
! Create and advertise the Loopback
!
interface Loopback0
ip address 150.1.3.3 255.255.255.0
R4:
!
! Create and advertise the Loopback
!
interface Loopback0
ip address 150.1.4.4 255.255.255.0
ip ospf network point-to-point
!
router ospf 1
network 150.1.4.4 0.0.0.0 area 1
ASA1:
!
! Summarize Inter-Area routes for R2 Loopbacks 1-3
!
router ospf 1
area 0 range 192.168.0.0 255.255.248.0
!
! Prefix-list to block the loopbacks of R2 and R3
!
prefix-list R2_R3_LOOPBACKS seq 5 deny 150.1.2.0/24
prefix-list R2_R3_LOOPBACKS seq 10 deny 150.1.3.0/24
prefix-list R2_R3_LOOPBACKS seq 15 permit 0.0.0.0/0 le 32
!
! OSPF:
! Apply area-filter
!
router ospf 1
area 1 filter-list prefix R2_R3_LOOPBACKS in
!
! Redistribute RIP subnets and apply summarization
!
router ospf 1
redistribute rip subnets
summary-address 192.168.10.0 255.255.255.128
!
! RIP:
! Redistribute OSPF
!
router rip
redistribute ospf 1 metric 1
Verification
Further Reading
ASA Command Line Configuration Guide: Configuring IP Routing
Access Control
Common Configuration
Directions
Create the necessary VLANs and configure the switch ports respectively
as per the diagram.
Configure IP addressing as per the diagram.
Configure RIP as routing protocol on all devices.
Final Configuration
ASA1:
!
! IP addressing
!
interface Ethernet0/0
no shut
nameif outside
security-level 0
ip address 136.1.122.12 255.255.255.0
!
interface Ethernet0/1
no shut
nameif inside
security-level 100
ip address 136.1.121.12 255.255.255.0
!
interface Ethernet0/2
no shut
nameif dmz
security-level 50
ip address 10.0.0.12 255.255.255.0
!
! RIP configuration
!
router rip
version 2
no auto-summary
network 10.0.0.0
network 136.1.0.0
SW1:
!
! Configure switchports
!
interface Fa 0/1
switchport host
switchport access vlan 121
!
interface Fa 0/2
switchport host
switchport access vlan 122
!
interface Fa 0/13
switchport host
switchport access vlan 121
!
interface Fa 0/20
switchport host
switchport access vlan 120
SW2:
!
! Configure switchports
!
interface Fa 0/12
switchport host
switchport access vlan 122
!
interface Fa 0/13
switchport host
switchport access vlan 120
R1:
interface E 0/0
no shut
ip add 136.1.121.1 255.255.255.0
!
router rip
ver 2
no auto
network 136.1.0.0
R2:
interface E 0/0
no shut
ip add 136.1.122.2 255.255.255.0
!
router rip
ver 2
no auto
network 136.1.0.0
Verification
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
!
! Access-Lists definition
!
access-list OUTSIDE_IN extended permit tcp any host 10.0.0.100 eq www
access-list OUTSIDE_IN extended permit tcp any host 10.0.0.100 eq ftp
access-list OUTSIDE_IN extended permit udp any host 10.0.0.100 eq ntp
access-list OUTSIDE_IN extended permit icmp any any echo
access-list OUTSIDE_IN extended permit icmp any any echo-reply
access-list OUTSIDE_IN extended permit icmp any any time-exceeded
access-list OUTSIDE_IN extended permit icmp any any unreachable
!
access-list OUTSIDE_OUT extended permit icmp any any echo
access-list OUTSIDE_OUT extended permit icmp any any echo-reply
access-list OUTSIDE_OUT extended permit udp any any range 33434 33464
access-list OUTSIDE_OUT extended permit tcp any any eq ftp
access-list OUTSIDE_OUT extended permit tcp any any eq telnet
access-list OUTSIDE_OUT extended permit tcp any any eq www
!
! Apply the access-lists
!
access-group OUTSIDE_IN in interface outside
access-group OUTSIDE_OUT out interface outside
Verification
R2#ping 10.0.0.100
R2#ping 136.1.121.1
R2#telnet 10.0.0.100 80
Trying 10.0.0.100, 80 ... Open
get / http/1.1
R2#telnet 10.0.0.100 21
Trying 10.0.0.100, 21 ... Open
R2#disc 1
Closing connection to 10.0.0.100 [confirm]
R2#telnet 10.0.0.100 80
Trying 10.0.0.100, 80 ... Open
get / http/1.1
R2#disc 1
Closing connection to 10.0.0.100 [confirm]
R2#telnet 10.0.0.100 25
Trying 10.0.0.100, 25 ...
% Connection timed out; remote host not responding
R1#telnet 136.1.122.2
Trying 136.1.122.2 ... Open
Password:
R2>
R1#ping 136.1.122.2
R1#ping 10.0.0.100
R1#telnet 10.0.0.100 80
Trying 10.0.0.100, 80 ... Open
get / http/1.1.
</body></html>
[Connection to 10.0.0.100 closed by foreign host]
R1#traceroute 136.1.122.2
Further Reading
Identifying Traffic with Access Lists
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
o “
echo”and“echor
epl
y”
o “
ti
meexceeded”and“
unreac
habl
e”
Final Configuration
ASA1:
!
! Define object groups
!
object-group network ROUTERS
network-object 136.1.121.0 255.255.255.0
!
object-group network SERVERS
network-object host 10.0.0.100
!
object-group icmp-type COMMON_ICMP
icmp-object echo
icmp-object echo-reply
icmp-object time-exceeded
icmp-object unreachable
!
object-group service TRC_PORTS udp
port-object range 33434 33464
!
object-group service SERVER_PORTS tcp
port-object eq www
port-object eq ftp
!
object-group service ROUTER_PORTS tcp
port-object eq telnet
port-object eq ssh
port-object eq 7001
!
! Define access-lists
!
access-list OUTSIDE_IN ext permit icmp any any obj COMMON_ICMP
access-list OUTSIDE_IN ext permit udp any any obj TRC_PORTS
access-list OUTSIDE_IN ext permit tcp any obj SERVERS obj SERVER_PORTS
access-list OUTSIDE_IN ext permit tcp any obj ROUTERS obj ROUTER_PORTS
!
access-list OUTSIDE_OUT ext permit icmp any any obj COMMON_ICMP
access-list OUTSIDE_OUT ext permit udp any any obj TRC_PORTS
Verification
R1#ping 136.1.122.2
R1#trace 136.1.122.2
R2#trace 136.1.121.1
R2#ping 136.1.121.1
R2#ping 10.0.0.100
R2#telnet 136.1.121.1
Trying 136.1.121.1 ... Open
R2#telnet 10.0.0.100 80
Trying 10.0.0.100, 80 ... Open
get / http/1.1
R2#telnet 10.0.0.100 21
Trying 10.0.0.100, 21 ... Open
220 IESERVER1 Microsoft FTP Service (Version 5.0).
quit
221
Further Reading
Simplifying Access Lists with Object Grouping
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
SW1:
!
! Generate RSA key to enable SSH
!
domain-name internetworkexpert.com
crypto key generate rsa general-keys modulus 512
!
! Control telnet/ssh access
!
telnet 136.1.121.0 255.255.255.0 inside
ssh 136.1.122.0 255.255.255.0 outside
!
Verification
AAA/CA Server:
Use your browser to connet to the ASA firewall. Enter enable password on
authentication, if it’s set.
R1>telnet 136.1.121.12
Trying 136.1.121.12 ... Open
Password: cisco
Type help or '?' for a list of available commands.
ASA1>
Password: cisco
Type help or '?' for a list of available commands.
ASA1> en
Password:
ASA1# who
0: 136.1.121.1
Further Reading
Managing System Access
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
icmp permit any echo-reply outside
icmp permit any echo-reply inside
icmp permit any echo-reply dmz
!
icmp permit any time-exceeded outside
Verification
R2#ping 136.1.121.12
R1#ping 136.1.121.12
.....
Success rate is 0 percent (0/5)
Further Reading
Command Reference: ICMP
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
SW1:
url-server (dmz) host 10.0.0.100
!
filter activex 80 0 0 0 0
filter java 80 0 0 0 0
filter ftp 21 136.1.121.0 255.255.255.0 0 0 allow interact-block
filter url 8080 136.1.121.0 255.255.255.0 0 0 allow proxy-block
filter url http 136.1.121.0 255.255.255.0 0 0 allow
Verification
You can install a trial version of Websense filtering server. Use your Test PC
to send a few HTTP requests from inside after that:
Global Statistics:
--------------------
URLs total/allowed/denied 2/2/0
URLs allowed by cache/server 0/2
URLs denied by cache/server 0/0
HTTPSs total/allowed/denied 0/0/0
HTTPSs allowed by cache/server 0/0
HTTPSs denied by cache/server 0/0
FTPs total/allowed/denied 0/0/0
FTPs allowed by cache/server 0/0
FTPs denied by cache/server 0/0
Requests dropped 0
Server timeouts/retries 0/0
Processed rate average 60s/300s 0/0 requests/second
Denied rate average 60s/300s 0/0 requests/second
Dropped rate average 60s/300s 0/0 requests/second
Server Statistics:
--------------------
10.0.0.100 UP
Vendor websense
Port 15868
Requests total/allowed/denied 2/2/0
Server timeouts/retries 0/0
Responses received 2
Response time average 60s/300s 0/0
Errors:
-------
RFC noncompliant GET method 0
URL buffer update failure 0
Further Reading
Applying Filtering Services
Configuring NAT
Directions
Final Configuration
ASA1:
nat-control
!
! Configure global address pools
!
!
! Outside Pool for inside hosts
!
global (outside) 1 136.1.122.100-136.1.122.110
global (outside) 1 interface
!
! DMZ pool for inside hosts
!
global (dmz) 1 interface
!
! Outside pool for DMZ hosts
!
global (outside) 2 136.1.122.200-136.1.122.209
global (outside) 2 136.1.122.210
!
! NAT rules
!
nat (inside) 1 136.1.121.0 255.255.255.0
nat (dmz) 2 10.0.0.0 255.255.255.0
Verification
translate_hits = 0, untranslate_hits = 0
match ip dmz any outside any
no translation group, implicit deny
policy_hits = 0
R1#telnet 136.1.122.2
Trying 136.1.122.2 ... Open
Password:
R2>
Rack1AS>12
[Resuming connection 12 to asa1 ... ]
R1#telnet 10.0.0.100 80
Trying 10.0.0.100, 80 ... Open
ASA1(config)# show x
2 in use, 2 most used
PAT Global 10.0.0.12(1024) Local 136.1.121.1(11006)
Global 136.1.122.100 Local 136.1.121.1
AAA/CA Server:
ASA1(config)# show x
3 in use, 3 most used
Global 136.1.122.200 Local 10.0.0.100
PAT Global 10.0.0.12(1024) Local 136.1.121.1(11006)
Global 136.1.122.100 Local 136.1.121.1
Further Reading
Applying NAT
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
nat-control
!
! Prevent R2 from learning inside/DMZ IP addresses
!
router rip
passive-interface outside
!
! DMZ host
!
static (dmz,outside) 136.1.122.100 10.0.0.100
!
! Telnet redirection
!
static (inside,outside) tcp interface 23 136.1.121.1 23
!
! DNS redirection
!
static (outside,inside) udp interface 53 136.1.122.2 53
!
! Translate inside->outside for DNS requests
!
nat (inside) 1 0 0
global (outside) 1 interface
!
! Access-list/Group to permit inbound connections
!
access-list OUTSIDE_IN extended permit ip any host 136.1.122.100
access-list OUTSIDE_IN extended permit tcp any host 136.1.122.12 eq telnet
!
access-group OUTSIDE_IN in interface outside
Verification
R2#telnet 136.1.122.100 80
Trying 136.1.122.100, 80 ... Open
R2#disc 1
Closing connection to 136.1.122.100 [confirm]
R2#telnet 136.1.122.12
Trying 136.1.122.12 ... Open
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#ip dns server
R2(config)#ip host TEST 136.1.122.2
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip name-server 136.1.121.12
R1(config)#ip domain-lookup
R1#ping TEST
Translating "TEST"...domain server (136.1.121.12) [OK]
Further Reading
Applying NAT
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
nat-control
!
! Prevent R2 from learning inside/DMZ IP addresses
!
router rip
passive-interface outside
!
access-list ICMP extended permit icmp any any
access-list TELNET extended permit tcp any any eq telnet
!
nat (inside) 1 access-list ICMP
nat (inside) 2 access-list TELNET
nat (inside) 3 0 0
!
global (outside) 1 136.1.122.100
global (outside) 2 136.1.122.101
global (outside) 3 interface
!
! Permit the returning ping responses
!
access-list OUTSIDE_IN extended permit icmp any any
access-group OUTSIDE_IN in interface outside
Verification
R1#telnet 136.1.122.2
Trying 136.1.122.2 ... Open
Password:
R2>
R1#ping 136.1.122.2
R1#
ASA1# show x
5 in use, 10 most used
PAT Global 136.1.122.100(10) Local 136.1.121.1 ICMP id 1842
PAT Global 136.1.122.100(9) Local 136.1.121.1 ICMP id 1841
PAT Global 136.1.122.100(8) Local 136.1.121.1 ICMP id 1840
PAT Global 136.1.122.100(7) Local 136.1.121.1 ICMP id 1839
PAT Global 136.1.122.100(6) Local 136.1.121.1 ICMP id 1838
Further Reading
Policy NAT
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
R2:
interface Loopback0
ip address 150.1.2.2 255.255.255.0
!
router rip
version 2
no auto-summary
network 150.1.0.0
ASA1:
nat-control
!
! Prevent R2 from learning inside/DMZ IP addresses
!
router rip
passive-interface outside
!
! Access-list to match Telnet traffic from VLAN122
!
access-list VLAN122 ext per tcp h 136.1.121.1 eq 23 136.1.122.0 255.255.255.0
!
! Accesslist to match HTTP traffic from R2’s Lo0
!
access-list LO0 ext permit tcp h 10.0.0.100 eq 80 150.1.2.0 255.255.255.0
!
! Static Policy PAT for VLAN122 Telnet
!
static (i,o) tcp interface 23 access-list VLAN122
!
! Static Policy PAT for LO0 HTTP
!
static (dmz,o) tcp interface 80 access-list LO0
!
! Outside ACL
!
access-list OUTSIDE_IN permit tcp any host 136.1.122.12 eq 80
access-list OUTSIDE_IN permit tcp any host 136.1.122.12 eq 23
!
access-group OUTSIDE_IN in interface outside
Verification
R2#telnet 136.1.122.12
Trying 136.1.122.12 ... Open
Further Reading
Policy NAT
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
nat-control
!
! Identity NAT
!
nat (inside) 0 136.1.121.0 255.255.255.0
!
! Access-List to match traffic from AAA/CA server
!
access-list SERVER extended permit ip host 10.0.0.100 any
!
! NAT Exemption
!
nat (dmz) 0 access-list SERVER
!
! Access-List to perform some basic testing
!
access-list OUTSIDE_IN ext permit ip any any
access-group OUTSIDE_IN in interface outside
Verification
R2#ping 10.0.0.100
R2#ping 136.1.121.1
R1#ping 136.1.122.2
R2#ping 136.1.121.1
ASA1(config)# show x
1 in use, 10 most used
Global 136.1.121.1 Local 136.1.121.1
Further Reading
Bypassing NAT
Objective: Configure address translation for hosts from lower security level
interface.
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
nat-control
!
router rip
passive-interface inside
!
! Outside NAT config
!
nat (outside) 1 136.1.122.0 255.255.255.0 outside
global (inside) 1 interface
!
! Fixup for DMZ server
!
static (dmz,inside) 136.1.121.100 10.0.0.100
!
! Dynamic NAT to access DMZ from inside.
! Required to reach the static mapping for AAA/CA server.
!
nat (inside) 1 0 0
global (dmz) 1 interface
!
! Access-List to perform some basic testing from outside
!
access-list OUTSIDE_IN ext permit ip any any
access-group OUTSIDE_IN in interface outside
Verification
R2#ping 136.1.121.1
ASA1(config)# show x
7 in use, 10 most used
Global 136.1.121.100 Local 10.0.0.100
PAT Global 136.1.121.12(5) Local 136.1.122.2 ICMP id 3200
PAT Global 136.1.121.12(4) Local 136.1.122.2 ICMP id 3199
PAT Global 136.1.121.12(3) Local 136.1.122.2 ICMP id 3198
PAT Global 136.1.121.12(2) Local 136.1.122.2 ICMP id 3197
PAT Global 136.1.121.12(1) Local 136.1.122.2 ICMP id 3196
R1#ping 136.1.121.100
R1#telnet 136.1.121.100 80
Trying 136.1.121.100, 80 ... Open
Further Reading
Using Dynamic NAT and PAT
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
nat-control
!
! The following NAT rules are required for DNS
! request to flow to R2
!
nat (dmz) 1 0 0
global (outside) 1 interface
R2:
ip dns server
ip host WWW 136.1.122.100
Verification
Further Reading
Command Reference: Alias
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
nat-control
!
! DNS doctoring with “static”
!
static (dmz,outside) 136.1.122.100 10.0.0.100 dns
!
! The following NAT rules are required for DNS
! request to flow to R2
!
nat (dmz) 1 0 0
global (outside) 1 interface
R2:
ip dns server
ip host WWW 136.1.122.100
Verification
Configure Test PC in VLAN120:
Further Reading
DNS and NAT
R3
E0/0 .3
136.X.123.0/24 VLAN123
136.X.122.0/24 VLAN122
E0/0
.12
E0/0
.12 .12 R2
R3 .2
.1
ASA1 E0/2
E0/1
R1
E0/0
136.X.121.0/24 VLAN121
Directions
The goal is to observe how NAT works with same-security level interfaces.
By default, you do not need to do NAT between same-security level
interfaces, even if nat-control is enabled.
However, you do need to configure NAT rules if you define dynamic NAT
for either of the same-security level interfaces.
Pre-configure as follows:
Enable NAT control on the firewall and enalbe the same-security traffic to
pass between interfaces.
Copyright © 2007 Internetwork Expert www.InternetworkExpert.com
- 64 -
CCIE Security Lab Workbook Volume I Version 3.0
Final Configuration
ASA1:
!
! Inspect ICMP globally
!
policy-map global_policy
class inspection_default
inspect icmp
!
! IP addressing
!
interface E 0/1
nameif inside1
security-level 100
ip address 136.1.121.12 255.255.255.0
no shutdown
!
interface E 0/2
nameif inside2
security-level 100
ip address 136.1.122.12 255.255.255.0
no shutdown
!
interface E 0/0
nameif outside
security-level 0
ip address 136.1.123.12 255.255.255.0
no shutdown
!
route outside 0 0 136.1.123.3
!
! Test you connectivity right after you apply these commands
!
same-security-traffic permit inter-interface
nat-control
!
! Configure the dynamic NAT rules for the inside->outside direction
! See how it affects same-security level interfaces interaction
!
nat (inside1) 1 0 0
global (outside) 1 interface
R1:
interface Ethernet 0/0
no shut
ip address 136.1.121.1 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 136.1.121.12
R2:
interface Ethernet 0/0
no shut
ip address 136.1.122.2 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 136.1.122.12
R3:
interface Ethernet 0/0
no shut
ip address 136.1.123.3 255.255.255.0
!
ip route 136.1.122.0 255.255.255.0 136.1.123.12
ip route 136.1.121.0 255.255.255.0 136.1.123.12
SW1:
!
! Configure switchports
!
interface Fa 0/1
switchport host
switchport access vlan 121
!
interface Fa 0/2
switchport host
switchport access vlan 122
!
interface Fa 0/3
switchport host
switchport access vlan 123
!
interface Fa 0/13
switchport host
switchport access vlan 121
SW2:
!
! Configure switchports
!
interface Fa 0/12
switchport host
switchport access vlan 123
!
interface Fa 0/13
switchport host
switchport access vlan 122
Verification
R1#ping 136.1.123.3
R1#ping 136.1.122.2
R1#ping 136.1.123.3
R1#ping 136.1.122.2
R1#ping 136.1.123.3
R1#ping 136.1.122.2
R1#ping 136.1.123.3
R1#ping 136.1.122.2
ASA1(config)# show x
5 in use, 5 most used
PAT Global 136.1.123.12(5) Local 136.1.121.1 ICMP id 5733
PAT Global 136.1.123.12(4) Local 136.1.121.1 ICMP id 5732
PAT Global 136.1.123.12(3) Local 136.1.121.1 ICMP id 5731
PAT Global 136.1.123.12(2) Local 136.1.121.1 ICMP id 5730
PAT Global 136.1.123.12(1) Local 136.1.121.1 ICMP id 5729
R1#ping 136.1.123.3
R1#ping 136.1.122.2
ASA1(config)# show x
10 in use, 10 most used
PAT Global 136.1.122.12(25) Local 136.1.121.1 ICMP id 1475
PAT Global 136.1.122.12(24) Local 136.1.121.1 ICMP id 1474
PAT Global 136.1.122.12(23) Local 136.1.121.1 ICMP id 1473
PAT Global 136.1.122.12(22) Local 136.1.121.1 ICMP id 1472
PAT Global 136.1.122.12(21) Local 136.1.121.1 ICMP id 1471
PAT Global 136.1.123.12(15) Local 136.1.121.1 ICMP id 4417
PAT Global 136.1.123.12(14) Local 136.1.121.1 ICMP id 4416
PAT Global 136.1.123.12(13) Local 136.1.121.1 ICMP id 4415
Further Reading
Configuring Interface Parameters
NAT and Same Security Level Interfaces
Advanced Firewall
R1 R2
.1 .2
InsideB InsideA
.12 .12
136.1.124.0/24 VLAN124
R3 DMZ
A: .121
ASA1
Lo0: 150.1.4.4/24 B: .122 A: .121
R4 .4
B: .122
Outside
136.1.123.0/24 VLAN123
.3
R3
Directions
The goal of this task is to create two virtual contexts, and configure shared
interfaces. The NAT mappings will be used as tie-breakers for context
selection.
Pre-configuration:
o Cr
eat
econt
extnamed“
Cust
omer
B”asf
oll
ows:
Changet
ocont
ext“
Cust
omer
A”andconf
i
gur
easf
oll
ows
:
o Us ec onfi
gurl“disk0:/Cust omer A.cfg”
o Configure IP addressing as per the diagram, use security levels
100,50,0f orthe“ inside” ,“dmz”and“ out si
de”int
erf
ac es
respect ively.Conf i
gur e“ namei fs”respec ti
vely.
o Configure static default route to R3.
o Configute static route for 150.1.4.0/24 to R4.
o Configure static PAT to translate 136.X.123.100 port 80 to
136.X.0.1 (R1) port 80.
o Configure dynamic PAT for all insi deuser son“ dmz”interfaceus i
ng
interface IP address.
o Configure dynamic PAT for all insi deus erson“ out
side”int er
face
using interface IP address.
o Create access-list OUTSIDE_IN as follows:
o Appl
yacc
ess
groupDMZ_I
Ntoi
nter
face“
dmz”
.
Changet
ocont
ext“
Cust
omer
B”andconf
i
gur
easf
oll
ows
:
o Appl
yacc
ess
groupDMZ_I
Ntoi
nter
face“
dmz”
.
Final Configuration
Pre-configuration:
SW1:
vlan 121,122,123,124
!
interface Fa0/1
switchport host
switchport access vlan 121
!
interface Fa0/2
switchport host
switchport access vlan 122
!
interface Fa0/3
switchport host
SW2:
vlan 121,122,123,124
!
interface Fa0/12
switchport host
switchport access vlan 123
!
interface Fa0/13
switchport host
switchport access vlan 124
!
interface Fa0/23
switchport trunk encaps dot1q
switchport mode trunk
R1:
interface E0/0
ip address 136.1.0.1 255.255.255.0
no shut
!
ip route 0.0.0.0 0.0.0.0 136.1.0.12
R2:
interface E0/0
ip address 136.1.0.2 255.255.255.0
no shut
!
ip route 0.0.0.0 0.0.0.0 136.1.0.12
R3:
interface E0/0
ip address 136.1.123.3 255.255.255.0
no shut
R4:
interface E0/0
ip address 136.1.124.4 255.255.255.0
no shut
!
interface Loopback0
ip address 150.1.4.4 255.255.255.0
ASA1:
!
! Configure physical interfaces
!
interface Ethernet0/0
no shutdown
!
interface Ethernet0/1
no shutdown
!
interface Ethernet0/1.121
vlan 121
no shutdown
!
interface Ethernet0/1.122
vlan 122
no shutdown
!
interface Ethernet0/2
no shutdown
!
! Identify admin context first
!
admin-context admin
context admin
config-url disk0:/admin.cfg
!
! Create context CustomerA and add interface
! Map interfaces to their “inner” names
!
context CustomerA
description == CustomerA
allocate-interface Ethernet0/0 outside
allocate-interface Ethernet0/1.121 insideA
allocate-interface Ethernet0/2 dmz
config-url disk0:/CustomerA.cfg
!
! Create context CustomerB
!
context CustomerB
description == CustomerB
allocate-interface Ethernet0/0 outside
allocate-interface Ethernet0/1.122 insideB
allocate-interface Ethernet0/2 dmz
config-url disk0:/CustomerB.cfg
!
! Change to context CustomerA
!
changeto context CustomerA
!
! Configure sec-leves & IP addressing for interfaces
! IP addresses you use at shared interfaces should not overlap
! between contexts
!
interface insideA
nameif inside
security-level 100
ip address 136.1.0.12 255.255.255.0
!
interface dmz
nameif dmz
security-level 50
ip address 136.1.124.121 255.255.255.0
!
interface outside
nameif outside
security-level 0
ip address 136.1.123.121 255.255.255.0
!
! Configure static PAT on outside interface, again no overlaps
! between contexts
!
static (inside,outside) tcp 136.1.123.100 www 136.1.0.1 www
!
! Dynamic PAT on shared interface
!
nat (inside) 1 0 0
global (dmz) 1 interface
global (outside) 1 interface
!
! Static routes since no dynamic routing is possible with contexts
!
route outside 0.0.0.0 0.0.0.0 136.1.123.3 1
route dmz 150.1.4.0 255.255.255.0 136.1.124.4 1
!
! Basic access-list to permit mapped service
!
access-list OUTSIDE_IN permit tcp any host 136.1.123.100 eq 80
access-list OUTSIDE_IN permit icmp any any echo-reply
access-group OUTSIDE_IN in interface outside
!
! Basic access-list to permit pings across shared interface
!
access-list DMZ_IN permit icmp any any echo-reply
access-group DMZ_IN in interface dmz
!
! Change to context “CustomerB” and configure similarly
!
changeto context CustomerB
!
interface insideB
nameif inside
security-level 100
ip address 136.1.0.12 255.255.255.0
!
interface dmz
nameif dmz
security-level 50
ip address 136.1.124.122 255.255.255.0
!
interface outside
nameif outside
security-level 0
ip address 136.1.123.122 255.255.255.0
!
! NAT configs
!
static (inside,outside) tcp 136.1.123.101 23 136.1.0.2 23
nat (inside) 1 0 0
global (dmz) 1 interface
global (outside) 1 interface
!
! Routing
!
route outside 0.0.0.0 0.0.0.0 136.1.123.3 1
route dmz 150.1.4.0 255.255.255.0 136.1.124.4 1
!
! Access-control
!
access-list OUTSIDE_IN permit tcp any host 136.1.123.101 eq 23
access-list OUTSIDE_IN permit icmp any any echo-reply
access-group OUTSIDE_IN in interface outside
!
access-list DMZ_IN permit icmp any any echo-reply
access-group DMZ_IN in interface dmz
Verification
R1#ping 150.1.4.4
ASA1/CustomerA(config)# show x
6 in use, 6 most used
PAT Global 136.1.123.100(80) Local 136.1.0.1(80)
PAT Global 136.1.124.121(10) Local 136.1.0.1 ICMP id 5122
PAT Global 136.1.124.121(9) Local 136.1.0.1 ICMP id 5121
PAT Global 136.1.124.121(8) Local 136.1.0.1 ICMP id 5120
PAT Global 136.1.124.121(7) Local 136.1.0.1 ICMP id 5119
PAT Global 136.1.124.121(6) Local 136.1.0.1 ICMP id 5118
R3#ping 136.1.123.121
R1#ping 136.1.123.3
ASA1/CustomerA# show x
6 in use, 6 most used
PAT Global 136.1.123.100(80) Local 136.1.0.1(80)
PAT Global 136.1.123.121(5) Local 136.1.0.1 ICMP id 5743
PAT Global 136.1.123.121(4) Local 136.1.0.1 ICMP id 5742
PAT Global 136.1.123.121(3) Local 136.1.0.1 ICMP id 5741
PAT Global 136.1.123.121(2) Local 136.1.0.1 ICMP id 5740
PAT Global 136.1.123.121(1) Local 136.1.0.1 ICMP id 5739
R3#telnet 136.1.123.100 80
Trying 136.1.123.100, 80 ... Open
GET /
<HTML><HEAD><TITLE>R1 Home Page</TITLE></HEAD>
<BODY BGCOLOR=#FFFFFF><H1>Cisco Systems</H1><H2>Accessing Cisco 2610 "R1"</H2>
R2#ping 150.1.4.4
ASA1/CustomerB(config)# show x
6 in use, 6 most used
PAT Global 136.1.123.100(23) Local 136.1.0.1(23)
PAT Global 136.1.124.122(5) Local 136.1.0.2 ICMP id 5691
PAT Global 136.1.124.122(4) Local 136.1.0.2 ICMP id 5690
PAT Global 136.1.124.122(3) Local 136.1.0.2 ICMP id 5689
PAT Global 136.1.124.122(2) Local 136.1.0.2 ICMP id 5688
PAT Global 136.1.124.122(1) Local 136.1.0.2 ICMP id 5687
R2#ping 136.1.123.3
ASA1/CustomerB# show x
6 in use, 6 most used
PAT Global 136.1.123.101(23) Local 136.1.0.2(23)
PAT Global 136.1.123.122(5) Local 136.1.0.2 ICMP id 9825
PAT Global 136.1.123.122(4) Local 136.1.0.2 ICMP id 9824
PAT Global 136.1.123.122(3) Local 136.1.0.2 ICMP id 9823
PAT Global 136.1.123.122(2) Local 136.1.0.2 ICMP id 9822
PAT Global 136.1.123.122(1) Local 136.1.0.2 ICMP id 9821
R3#ping 136.1.123.122
R3#telnet 136.1.123.101
Trying 136.1.123.101 ... Open
R2>
Further Reading
Enabling Multiple Context Mode
Adding and Managing Security Contexts
R1 R2
.1 .2
136.1.123.0/24 VLAN123
.3
R3
Directions
o Cr
eat
eres
our
cec
las
snamed“
Sil
ver
”asf
oll
ows
:
Changet
ocont
ext“
admi
n”andconf
i
gur
easf
oll
ows
:
Final Configuration
SW1:
vlan 120
!
interface Fa0/12
switchport host
switchport access vlan 120
!
interface Fa0/20
switchport host
switchport access vlan 120
ASA1:
admin-context admin
context admin
allocate-interface Management0/0 management
config-url disk0:/admin.cfg
!
class Gold
limit-resource Hosts 1000
limit-resource Xlates 1000
limit-resource Conns 10000
!
class Silver
limit-resource Hosts 500
limit-resource Conns 5000
limit-resource Xlates 500
!
context admin
member default
!
context CustomerA
member Gold
!
context CustomerB
member Silver
!
! Configure admin context
!
changeto context admin
interface management
nameif management
security-level 100
ip address 10.0.0.12 255.255.255.0
management-only
!
username ADMIN password CISCO encrypted
!
aaa authentication ssh console LOCAL
aaa authentication telnet console LOCAL
!
telnet 0 0 management
ssh 0 0 management
Verification
Further Reading
Enabling Multiple Context Mode
Adding and Managing Security Contexts
RIPv2
136.1.120.0/24 VLAN120
Inside ASA1
.254 .254
.1 .2
E0/2
R1 R2
.254 E0/2 .254 Outside
136.1.110.0/24 VLAN110
ASA2
Directions
Final Configuration
Pre-Configuration:
SW1:
vlan 110,120,999
!
interface Fa0/1
switchport host
switchport access vlan 110
!
interface Fa0/2
switchport host
switchport access vlan 120
!
interface Fa0/13
switchport host
switchport access vlan 110
!
interface Fa0/15
switchport host
switchport access vlan 110
!
interface Fa0/23
switchport trunk encaps dot1q
switchport mode trunk
SW2:
vlan 110,120,999
!
interface Fa0/12
switchport host
switchport access vlan 120
!
interface Fa0/13
switchport host
switchport access vlan 999
!
interface Fa0/14
switchport host
switchport access vlan 120
!
interface Fa0/15
switchport host
switchport access vlan 999
!
interface Fa0/23
switchport trunk encaps dot1q
switchport mode trunk
R1:
interface Ethernet 0/0
no shut
ip address 136.1.110.1 255.255.255.0
!
router rip
ver 2
no auto
network 136.1.0.0
R2:
interface Ethernet 0/0
no shut
ip address 136.1.120.2 255.255.255.0
!
router rip
ver 2
no auto
network 136.1.0.0
ASA1:
!
! Configure basic interface settings
!
interface Ethernet0/1
nameif inside
ip address 136.1.110.254 255.255.255.0
no shutdown
!
interface Ethernet0/0
nameif outside
ip address 136.1.120.254 255.255.255.0
no shutdown
!
router rip
version 2
no auto-summary
network 136.1.0.0
!
nat-control
nat (inside) 1 0 0
global (outside) 1 interface
!
! Access-control
!
access-list OUTSIDE_IN permit icmp any any echo-reply
access-group OUTSIDE_IN in interface outside
!
! Enable the failover interface
!
interface Ethernet0/2
no shut
!
! Configure failover settings
!
failover lan unit primary
failover lan interface failover Ethernet0/2
failover link failover Ethernet0/2
failover int ip failover 100.100.100.12 255.255.255.0 st 100.100.100.13
failover
!
! Configure interface monitoring and failover policy
!
monitor-interface outside
monitor-interface inside
!
! Unit & interface polling
!
failover polltime unit msec 200 holdtime msec 800
failover polltime interface msec 500 holdtime 5
!
failover interface-policy 1
ASA2:
interface Ethernet0/2
no shut
!
failover lan unit secondary
failover lan interface failover Ethernet0/2
failover link failover Ethernet0/2
failover int ip failover 100.100.100.12 255.255.255.0 st 100.100.100.13
failover
Verification
Check the primary unit:
R1#telnet 136.1.120.2
Trying 136.1.120.2 ... Open
R2>show clock
*06:26:10.444 UTC Fri Mar 5 1993
SW2#conf t
SW2(config)#int fa 0/12
SW2(config-if)#shut
SW2(config-if)#
Rack1AS>12
[Resuming connection 12 to asa1 ... ]
Switching to Standby
ASA(config)#
Rack1AS>1
[Resuming connection 1 to r1 ... ]
R2>show clock
*06:26:33.706 UTC Fri Mar 5 1993
Further Reading
Configuring Failover
.254 A: .253
10.0.0.0/24 VLAN122 B: .254
136.1.130.0/24 VLAN130
InsideB ASA1
.2
E0/2 .3
R2
Outside R3
E0/2
R1 .1
Directions
The goal of this task is to create two virtual contexts, and configure each
ASA unit to be active unit for a context, and standby for the other.
The key idea of Active/Active failover ist hatone‘ phy si
cal’f
irewallunitcan
act as primary device for a group of contexts (virtual firewalls) and
secondary for another group.
Each firewall unit may have priority configured for a group, along with
preemption property. As soon as firewall detects a unit with a higher
priority for a group, and preemption is enabl ed–t hehi gherpr ior
it
yf i
rewall
takes the active role.
Pre-configuration:
Cr
eat
econt
extnamed“
Cust
omer
A”asf
oll
ows
:
Useconf igur l“
disk0:/Customer A.cfg”
Allocate interfaces Ethernet0/1.121, Ethernet0/0 to
this context.
Cr
eat
econt
extnamed“
Cust
omer
B”asf
oll
ows
:
Useconf igur l“
disk0:/Customer B.cfg”
Allocate interfaces Ethernet0/1.122, Ethernet0/0 to
this context.
Final Configuration
Pre-Configuration:
SW1:
vlan 121,122,130
!
interface Fa0/1
switchport host
switchport access vlan 121
!
interface Fa0/2
switchport host
switchport access vlan 122
!
interface Fa0/3
switchport host
switchport access vlan 130
!
interface Fa0/13
desc == ASA1 Inside
switchport trunk encaps dot1q
switchport mode trunk
!
interface Fa0/15
desc == ASA2 Inside
switchport trunk encaps dot1q
switchport mode trunk
!
interface Fa0/23
switchport trunk encaps dot1q
switchport mode trunk
SW2:
vlan 121,122,130
!
interface Fa0/12
desc == ASA1 Outside
switchport host
switchport access vlan 130
!
interface Fa0/14
desc == ASA2 Outside
switchport host
switchport access vlan 130
!
interface Fa0/13
desc == ASA1 DMZ
switchport host
switchport access vlan 999
!
interface Fa0/15
desc == ASA2 DMZ
switchport host
R1:
interface E0/0
ip address 10.0.0.1 255.255.255.0
no shut
!
ip route 0.0.0.0 0.0.0.0 10.0.0.254
R2:
interface E0/0
ip address 10.0.0.2 255.255.255.0
no shut
!
ip route 0.0.0.0 0.0.0.0 10.0.0.254
R3:
interface E0/0
ip address 136.1.130.3 255.255.255.0
Failover configuration:
ASA1:
hostname ASA
!
! Configure physical interfaces
!
interface Ethernet0/0
no shutdown
!
interface Ethernet0/1
no shutdown
!
interface Ethernet0/1.121
vlan 121
no shutdown
!
interface Ethernet0/1.122
vlan 122
no shutdown
!
! Identify admin context first
!
admin-context admin
context admin
config-url disk0:/admin.cfg
!
! Create context CustomerA and add interface
!
context CustomerA
description == CustomerA
allocate-interface Ethernet0/0
allocate-interface Ethernet0/1.121
config-url disk0:/CustomerA.cfg
!
! Create context CustomerB
!
context CustomerB
description == CustomerB
allocate-interface Ethernet0/0
allocate-interface Ethernet0/1.122
config-url disk0:/CustomerB.cfg
!
! Change to context CustomerA
!
changeto context CustomerA
!
! Configure sec-leves & IP addressing for interfaces
! IP addresses you use at shared interfaces should
! not overlap between contexts
!
interface Ethernet0/1.121
nameif inside
security-level 100
ip address 10.0.0.254 255.255.255.0
!
interface Ethernet0/0
nameif outside
security-level 0
ip address 136.1.130.253 255.255.255.0
!
! Configure static PAT on outside interface,
! again no overlaps between contexts
!
!
! Dynamic PAT on shared interface
!
nat (inside) 1 0 0
global (outside) 1 interface
!
! Basic access-list to permit pings from inside
!
access-list OUTSIDE_IN permit icmp any any echo-reply
access-group OUTSIDE_IN in interface outside
!
! Change to context “CustomerB” and configure similarly
!
changeto context CustomerB
!
interface Ethernet0/1.122
nameif inside
security-level 100
ip address 10.0.0.254 255.255.255.0
!
interface Ethernet0/0
nameif outside
security-level 0
ip address 136.1.130.254 255.255.255.0
!
! NAT configs
!
nat (inside) 1 0 0
global (outside) 1 interface
!
! Access-control rules to permit pings
!
access-list OUTSIDE_IN permit icmp any any echo-reply
access-group OUTSIDE_IN in interface outside
!
! Failover configs follow
!
changeto system
!
! Enable the failover interface
!
interface Ethernet0/2
no shutdown
!
! Configure failover settings
!
failover lan unit primary
failover lan interface failover Ethernet0/2
failover link failover Ethernet0/2
failover int ip failover 100.100.100.12 255.255.255.0 st 100.100.100.13
!
failover group 1
primary
preempt
!
failover group 2
secondary
preempt
!
context CustomerA
join-failover-group 1
!
context CustomerB
join-failover-group 2
!
failover
ASA2:
!
! Enable failover interface
!
interface Ethernet0/2
no shut
!
failover lan unit secondary
failover lan interface failover Ethernet0/2
Verification
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#int fa 0/12
SW2(config-if)#shut
UDP conn 0 0 0 0
ARP tbl 0 0 0 0
Xlate_Timeout 0 0 0 0
Test connectivity:
R3#ping 136.1.130.253
R3#ping 136.1.130.254
R1#ping 136.1.130.3
R2#ping 136.1.130.3
Further Reading
Configuring Failover
.254 A: .253
10.0.0.0/24 VLAN122 B: .254
136.1.130.0/24 VLAN130
InsideB ASA1
.2
E0/2 .3
R2
Outside R3
E0/2
R1 .1
Directions
Conf i
gur edevi cesaspert he“PI X/ASAFi rewal l
/AdvancedFi r
ewal l
”
scenario “Act i
ve/ Acti
veSt atef
ul Fai l
overwi thFai l
overI nt
erf
ace”
The goal of this task is to tune individual interface/unit monitoring
parameters for failover groups.
Pick up the primary firewall unit forc ontext“ Customer A”and“ Cus t
omer
B”
respectively, and configure as follows:
Final Configuration
Primary unit for CustomerA:
changeto context CustomerA
!
monitor-interface inside
monitor-interface outside
failover group 1
interface-policy 2
polltime interface msec 500 holdtime 5
!
failover group 2
interface-policy 2
polltime interface msec 500 holdtime 5
Verification
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#interface fastEthernet 0/13
SW1(config-if)#shutdown
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#int fa 0/12
SW2(config-if)#shut
SW2(config-if)#
Further Reading
Configuring Failover
AAA/CA
Server
.100
Mgmt
10.0.0.0/24 VLAN120
136.X.12.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
136.X.12.0/24 VLAN121
Directions
Pre-Configuration:
Final Configuration
ASA1:
firewall transparent
ip address 136.1.12.12 255.255.255.0
!
interface Management 0/0
no shutdown
ip address 10.0.0.12 255.255.255.0
!
interface Ethernet 0/0
no shut
nameif outside
!
interface Ethernet 0/1
no shut
nameif inside
!
! Access-List to apply to outside
!
access-list OUTSIDE_IN extended permit icmp any any echo
access-list OUTSIDE_IN extended permit icmp any any echo-reply
access-list OUTSIDE_IN extended permit tcp any any eq telnet
!
! Apply the ACLs
!
access-group OUTSIDE_IN in interface outside
SW1:
!
! Configure switchports
!
interface Fa 0/1
switchport host
switchport access vlan 121
!
interface Fa 0/2
switchport host
switchport access vlan 122
!
interface Fa 0/12
description == ASA Management
switchport host
switchport access vlan 120
!
interface Fa 0/13
switchport host
switchport access vlan 121
!
interface Fa 0/20
switchport host
switchport access vlan 120
SW2:
!
! Configure switchports
!
interface Fa 0/12
switchport host
switchport access vlan 122
R1:
interface Ethernet 0/0
no shut
ip address 136.1.12.1 255.255.255.0
R2:
Verification
R1#ping 136.1.12.2
R1#show ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 136.1.12.1 - 0050.73f7.c0c0 ARPA Ethernet0/0
Internet 136.1.12.2 71 0003.e335.1240 ARPA Ethernet0/0
R2#telnet 136.1.12.1
Trying 136.1.12.1 ... Open
R2#ping 136.1.12.12
Further Reading
Firewall Mode Overview
AAA/CA
Server
.100
Mgmt
10.0.0.0/24 VLAN120
136.X.12.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
136.X.12.0/24 VLAN121
Directions
Final Configuration
ASA1:
arp outside 136.1.12.2 0003.e335.1240
arp inside 136.1.12.1 0050.73f7.c0c0
!
arp-inspection outside enable no-flood
arp-inspection inside enable no-flood
Verification
R1#show ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 136.1.12.1 - 0050.73f7.c0c0 ARPA Ethernet0/0
Internet 136.1.12.2 82 0003.e335.1240 ARPA Ethernet0/0
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int e 0/0
R2(config-if)#mac-address 0003.e335.1241
R1#ping 136.1.12.2
R2(config-if)#mac-address 0003.e335.1240
R2(config-if)#
R1#ping 136.1.12.2
Further Reading
Configuring ARP Inspection
AAA/CA
Server
.100
Mgmt
10.0.0.0/24 VLAN120
136.X.12.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
136.X.12.0/24 VLAN121
Directions
Note that every SSTP BPDU has embedded TLV that carries SSTP VLAN
number, so that a VLAN mismatch could be detected.
Create Ethertype acess-list BPDU and permit BPDUs with it.
Apply access-group BPDU to the inside and outside interfaces.
Configure Fa0/13 of SW1 as 802.1q trunk with native VLAN 121.
Configure Fa0/12 of SW2 as 802.1q trunk with native VLAN 122.
Final Configuration
SW1:
inter Fa0/13
switchport trunk encaps dot1q
switchport mode trunk
switchport trunk native 121
SW2:
inter Fa0/12
switchport trunk encaps dot1q
switchport mode trunk
switchport trunk native 122
ASA1:
access-list BPDU ethertype permit bpdu
Verification
SW2:
1d13h: %SPANTREE-2-RECV_PVID_ERR: Received BPDU with inconsistent peer vlan id
121 on FastEthernet0/12 VLAN122.
1d13h: %SPANTREE-2-BLOCK_PVID_LOCAL: Blocking FastEthernet0/12 on VLAN0122.
Inconsistent local vlan.
SW1:
1d13h: %SPANTREE-2-BLOCK_PVID_PEER: Blocking FastEthernet0/13 on VLAN0122.
Inconsistent peer vlan.
1d13h: %SPANTREE-2-BLOCK_PVID_LOCAL: Blocking FastEthernet0/13 on VLAN0121.
Inconsistent local vlan.
Further Reading
Configuring ARP Inspection
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
access-list OUTSIDE_IN permit icmp any any
!
access-group OUTSIDE_IN in interface outside
!
! Disable Fragment reassebly on all interfaces
!
fragment chain 1 inside
fragment chain 1 outside
fragment chain 1 dmz
Verification
R2#ping 136.1.121.1
Further Reading
Configuring Fragment Size
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
The second issue commonly arise when inside users try to send e-mail
through the PIX/ASA firewall or connect to external FTP servers. Some
SMTP/FTP servers may send back the IDENT query over new TCP
connection, which is blackholed at the firewall outside interface by default.
This may cause very long wating on connection startup. To remedy such
situation you should do the following:
Final Configuration
ASA1:
static (i,o) 136.1.122.100 136.1.121.100
!
! DNS doctoring with alias
!
alias (inside) 136.1.121.100 136.1.122.100
!
! Disable proxy-ARP on inside
!
sysopt noproxyarp inside
!
! Reset TCP connections denied on outside interface
! or denied inbound.
!
service resetinbound
service resetoutside
Further Reading
PIX Performance Issues Caused by IDENT Protocol
Understanding the alias Command for the Cisco Secure PIX Firewall
AAA/CA
Server
.100
DMZ BGP
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
AS 2
.12
.12 .12 R2
R3 .2
BGP .1
ASA1
Inside Outside
AS 1
R1
Lo1: 192.168.1.1/24 RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
R1:
interface Loopback 1
ip address 192.168.1.1 255.255.255.0
!
! BGP configuration
!
router bgp 1
neighbor 136.1.122.2 remote-as 2
neighbor 136.1.122.2 ebgp
network 192.168.1.0 mask 255.255.255.0
!
! Advertise loopback into RIP
!
router rip
network 192.168.1.0
R2:
!
! route-map to change next-hop
!
route-map NEXT_HOP
set ip next-hop 136.1.122.1
!
router bgp 2
neighbor 136.1.122.1 remote-as 1
neighbor 136.1.122.1 ebgp
neighbor 136.1.122.1 route-map NEXT_HOP in
ASA1:
!
! Static & ACL to permit inbound pings
!
static (inside,outside) 136.1.122.1 136.1.121.1
access-list OUTSIDE_IN permit icmp any 192.168.1.0 255.255.255.0
access-group OUTSIDE_IN in interface outside
!
! Prevent R2 from learning routes from the ASA
!
router rip
passive-interface outside
Verification
R2#sh ip bgp
BGP table version is 2, local router ID is 192.168.5.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Further Reading
Sample Configurations of BGP Across a PIX Firewall
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Configure R2 as follows:
Final Configuration
ASA1:
!
! Enable multicast routing and PIM
!
multicast-routing
!
interface E 0/0
pim
!
! Configure IGMP on the inside
!
interface E0/1
igmp version 2
igmp limit 100
!
! Configure the RP
!
pim rp-address 150.1.2.2
!
! Permit ICMP traffic from R2
!
access-list OUTSIDE_IN permit icmp any any
!
access-group OUTSIDE_IN in interface outside
R2:
ip multicat-routing
!
! Enable PIM on ethernet interface
!
interface Ethernet0/0
ip pim sparse-mode
!
interface Loopback0
ip address 150.1.2.2 255.255.255.0
ip pim sparse-mode
!
ip pim rp-address 150.1.2.2
!
router rip
network 150.1.0.0
R1:
interface Ethernet 0/0
ip igmp join 239.0.0.1
Verification
R2#show ip mroute
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report, Z - Multicast Tunnel
Y - Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
R2#ping 239.0.0.1
There are two response since we have configured two PIM interfaces.
R2#show ip mroute
IP Multicast Routing Table
Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected,
L - Local, P - Pruned, R - RP-bit set, F - Register flag,
T - SPT-bit set, J - Join SPT, M - MSDP created entry,
X - Proxy Join Timer Running, A - Candidate for MSDP Advertisement,
U - URD, I - Received Source Specific Host Report, Z - Multicast Tunnel
Y - Joined MDT-data group, y - Sending to MDT-data group
Outgoing interface flags: H - Hardware switched
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode
R2#
Further Reading
Configuring Multicast Routing
System Monitoring
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
!
! Logging Config
!
logging timestamp
logging buffer-size 65536
logging console alerts
logging monitor critical
logging buffered debugging
logging trap informational
logging facility 23
logging host dmz 10.0.0.100
!
logging ftp-bufferwrap
logging ftp-server 10.0.0.100 / anonymous [email protected]
!
logging on
!
! Configure SNMP
!
snmp-server host dmz 10.0.0.100 trap community CISCO
snmp-server location Reno,NV
snmp-server community CISCO
snmp-server enable traps all
!
! Create snmp-map to deny SNMP version 1
!
snmp-map asa_snmp_map
deny version 1
!
! Apply the map to the global policy
!
policy-map global_policy
class inspection_default
inspect snmp asa_snmp_map
!
! Configure NTP
!
ntp authentication-key 1 md5 CISCO
ntp authenticate
ntp server 136.1.121.1 key 1
R1:
ntp master
ntp authentication-key 1 md5 CISCO
Verification
AAA/CA Server:
Further Reading
Monitoring the Security Appliance
DHCP Server
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
dhcpd address 136.1.121.100-136.1.121.254 inside
dhcpd domain internetworkexpert.com
dhcpd lease 1800
dhcpd enable inside
R1:
interface E0/0
ip address dhcp
Verification
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#interface E0/0
R1(config-if)# ip address dhcp
R1(config-if)#
*Mar 1 00:13:34.241: DHCP: DHCP client process started: 10
*Mar 1 00:13:34.241: RAC: Starting DHCP discover on Ethernet0/0
*Mar 1 00:13:34.241: DHCP: Try 1 to acquire address for Ethernet0/0
*Mar 1 00:13:39.266: DHCP: allocate request
*Mar 1 00:13:39.266: DHCP: new entry. add to queue
*Mar 1 00:13:39.266: DHCP: SDiscover attempt # 1 for entry:
*Mar 1 00:13:39.266: Temp IP addr: 0.0.0.0 for peer on Interface: Ethernet0/0
*Mar 1 00:13:39.266: Temp sub net mask: 0.0.0.0
*Mar 1 00:13:39.266: DHCP Lease server: 0.0.0.0, state: 1 Selecting
*Mar 1 00:13:39.266: DHCP transaction id: C8B29
*Mar 1 00:13:39.270: Lease: 0 secs, Renewal: 0 secs, Rebind: 0 secs
*Mar 1 00:13:39.270: Next timer fires after: 00:00:02
*Mar 1 00:13:39.270: Retry count: 1 Client-ID: cisco-0050.73f7.c0c0-Et0/0
*Mar 1 00:13:39.270: Hostname: R1
*Mar 1 00:13:39.270: DHCP: SDiscover: sending 294 byte length DHCP packet
*Mar 1 00:13:39.270: DHCP: SDiscover 294 bytes
*Mar 1 00:13:39.270: B'cast on Ethernet0/0 interface from 0.0.0.0
*Mar 1 00:13:39.370: DHCP: Received a BOOTREP pkt
*Mar 1 00:13:39.370: DHCP: Scan: Message type: DHCP Offer
*Mar 1 00:13:39.370: DHCP: Scan: Server ID Option: 136.1.121.12 = 8801790C
*Mar 1 00:13:39.374: DHCP: Scan: Lease Time: 1800
*Mar 1 00:13:39.374: DHCP: Scan: Renewal time: 900
*Mar 1 00:13:39.374: DHCP: Scan: Rebind time: 1575
*Mar 1 00:13:39.374: DHCP: Scan: Subnet Address Option: 255.255.255.0
*Mar 1 00:13:39.374: DHCP: Scan: Domain Name: internetworkexpert.com
*Mar 1 00:13:39.374: DHCP: Scan: Router Option: 136.1.121.12
*Mar 1 00:13:39.374: DHCP: rcvd pkt source: 136.1.121.12, destination:
255.255.255.255
*Mar 1 00:13:39.374: UDP sport: 43, dport: 44, length: 312
*Mar 1 00:13:39.378: DHCP op: 2, htype: 1, hlen: 6, hops: 0
*Mar 1 00:13:39.378: DHCP server identifier: 136.1.121.12
*Mar 1 00:13:39.378: xid: C8B29, secs: 0, flags: 0
*Mar 1 00:13:39.378: client: 0.0.0.0, your: 136.1.121.100
*Mar 1 00:13:39.378: srvr: 0.0.0.0, gw: 0.0.0.0
*Mar 1 00:13:39.378: options block length: 64
Further Reading
Configuring DHCP, DDNS, and WCCP Services
Objective: Configure different inspection policies for HTTP traffic on outside and
inside interfaces.
Directions
Name it HTTP_INSPECT.
Reset on protocol violations.
Spoof server header with the“ Apac
he/
2.2.
0(Uni
x)”
.
Create policy-map for outside interface, name it OUTSIDE. For the class
HTTP_FROM_INSIDE configure the following:
Create policy-map for inside interface, name it INSIDE. For the class
HTTP_FROM_OUTSIDE configure the following:
Final Configuration
ASA1:
!
! Static mapping
!
static (dmz,outside) 136.1.122.100 10.0.0.100 netmask 255.255.255.255
!
! Define Access-Lists
!
access-list OUTSIDE_IN permit tcp any host 136.1.122.100 eq www
!
! Apply outside ACL
!
access-group OUTSIDE_IN in interface outside
!
! Define class-maps
!
class-map HTTP_FROM_INSIDE
match access-list HTTP_FROM_INSIDE
class-map HTTP_FROM_OUTSIDE
match access-list HTTP_FROM_OUTSIDE
!
! Define HTTP inspection policy
!
policy-map type inspect http HTTP_INSPECT
parameters
spoof-server "Apache/2.2.0 (Unix)"
protocol-violation action reset
!
! Create policy maps
!
policy-map OUTSIDE
class HTTP_FROM_OUTSIDE
inspect http HTTP_INSPECT
set connection conn-max 100 embryonic-conn-max 50
policy-map INSIDE
class HTTP_FROM_INSIDE
inspect http HTTP_INSPECT
set connection conn-max 200 embryonic-conn-max 100
!
! Apply the policies
!
service-policy OUTSIDE interface outside
service-policy INSIDE interface inside
Verification
R1#telnet 10.0.0.100 80
Trying 10.0.0.100, 80 ... Open
GET / HTTP/1.1
Content-Length: 4009
Content-Type: text/html
R2#telnet 136.1.122.100 80
Trying 136.1.122.100, 80 ... Open
GET / HTTP/1.1
Further Reading
Using Modular Policy Framework
Configuring Application Layer Protocol Inspection
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.124.0/24 VLAN124
.12
.12 .12 R4
R3 .4
.3
Inside ASA1 Outside
R3
RIPv2
136.X.123.0/24 VLAN123
Directions
o REG_26XXt
omat
ch“
^c26.
*”
o REG_36XXt
omat
ch“
^c36.
*”
o REG_28XXt
omat
ch“
^c28.
*”
Cr eateclass
mapt
ype“
inspec
tFTP”namedDENI
ED_COMMANDS as
follows:
o mat
chr
equest
command“
DELE”.
o mat
chr
equest
command“
SITE”.
o mat
chr
equest
command“
RMD” .
Cr
eat
epol
i
cy
mapt
ype“
inspectFTP”namedFTP_I
NSPECTasf
oll
ows
:
Final Configuration
ASA1:
!
! Regexps
!
regex REG_26XX "^c26.*"
regex REG_36XX "^c36.*"
regex REG_28XX "^c28.*"
!
! Class-map to group regexps
!
class-map type regex match-any DENIED_FILES
match regex REG_26XX
match regex REG_28XX
match regex REG_36XX
!
! Class-map to group together the denied commands
!
class-map type inspect ftp match-all DENIED_COMMANDS
match request-command site dele rmd
!
! FTP inspection policy, not the obfuscation options
!
policy-map type inspect ftp FTP_INSPECT
parameters
mask-banner
mask-syst-reply
match filename regex class DENIED_FILES
reset
class DENIED_COMMANDS
reset
!
! Class to match FTP port (L3/L4)
!
class-map FTP
match port tcp eq 21
!
! Policy map to apply to outside interface
!
policy-map OUTSIDE
class FTP
inspect ftp strict FTP_INSPECT
!
! Apply policy to outside interface
!
service-policy OUTSIDE interface outside
!
! Static Mapping to simplify routing
!
static (dmz,o) 136.1.122.100 10.0.0.100
!
! Outside ACL to permit FTP traffic
!
access-list OUTSIDE_IN permit tcp any host 136.1.122.100 eq 21
access-group OUTSIDE_IN in interface outside
Verification
Test PC:
Further Reading
Using Modular Policy Framework
Configuring Application Layer Protocol Inspection
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.124.0/24 VLAN124
.12
.12 .12 R4
R3 .4
.3
Inside ASA1 Outside
R3
RIPv2
136.X.123.0/24 VLAN123
Directions
Final Configuration
SW1:
!
! Static mapping and access-list to permit SMTP
!
static (dmz,o) 136.1.122.100 10.0.0.100
access-list OUTSIDE_IN permit tcp any host 136.1.122.100 eq 25
access-group OUTSIDE_IN in interface outside
!
! Access-list and L3/4 class-map
!
access-list SMTP_SERVER permit tcp any host 136.1.122.100 eq 25
class-map SMTP_SERVER
match access-list SMTP_SERVER
!
! Regexps to catch possible spammers
!
regex SPAMMERS “(cable|dsl|dialup)”
!
! SMTP Inspection Policy
!
policy-map type inspect esmtp SMTP_INSPECT
parameters
mask-banner
mail-relay cisco.com action drop-connection
exit
match invalid-recipients count gt 3
reset
match sender-address regex SPAMMERS
reset
Verification
Interface outside:
Service-policy: OUTSIDE
Class-map: SMTP_SERVER
Set connection policy: conn-max 100 embryonic-conn-max 50
current embryonic conns 0, current conns 0, drop 0
Inspect: esmtp SMTP_INSPECT, packet 0, drop 0, reset-drop 0
R2#telnet 136.1.122.100 25
Trying 136.1.122.100, 25 ... Open
220
********************************************************************************
*************************
EHLO
500 5.3.3 Unrecognized command
EHLO
250-IESERVER1 Hello [136.1.122.2]
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-TURN
250-ATRN
250-SIZE 2097152
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250 OK
Further Reading
Using Modular Policy Framework
Configuring Application Layer Protocol Inspection
AAA/CA
Server
.100
DMZ BGP
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
AS 2
.12
.12 .12 R2
R3 .2
BGP .1
ASA1
Inside Outside
AS 1
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
R1:
router bgp 1
neighbor 136.1.122.2 remote-as 2
neighbor 136.1.122.2 ebgp
neighbor 136.1.122.2 password CISCO
R2:
router bgp 2
neighbor 136.1.121.1 remote-as 1
neighbor 136.1.121.1 ebgp
neighbor 136.1.121.1 password CISCO
ASA1:
!
! TCP options
!
tcp-map AUTH_OPTION
tcp-options range 19 19 allow
!
! Class to match BGP
!
class-map BGP
match port tcp eq bgp
!
! Global policy config
!
policy-map global_policy
class BGP
set connection random-sequence-number disable
set connection advanced-options AUTH_OPTION
Verification
Further Reading
Guide for Cisco PIX 6.2 and 6.3 Users Upgrading to Cisco Security Appliance
Software Version 7.0
Objective: Police ingress and egress ICMP traffic on the outside interface.
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
SW1:
access-list ICMP permit icmp any any
!
class-map ICMP
match access-list ICMP
!
policy-map OUTSIDE
class ICMP
police input 64000
police output 64000
!
service-policy OUTSIDE interface outside
!
! Access-list to permit ICMP in/out
!
access-list OUTSIDE_IN permit icmp any any
access-group OUTSIDE_IN in interface outside
Verification
Interface outside:
Service-policy: OUTSIDE
Class-map: ICMP
Input police Interface outside:
cir 64000 bps, bc 2000 bytes
conformed 0 packets, 0 bytes; actions: transmit
exceeded 0 packets, 0 bytes; actions: drop
conformed 0 bps, exceed 0 bps
Output police Interface outside:
cir 64000 bps, bc 2000 bytes
conformed 45 packets, 62530 bytes; actions: transmit
exceeded 5 packets, 7570 bytes; actions: drop
conformed 24 bps, exceed 0 bps
Further Reading
Using Modular Policy Framework
Applying QoS Policies
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
!
! Class-map to match voice traffic
!
class-map VOICE
match rtp 16384 16383
!
! LLQ policy-map
!
policy-map LLQ
class VOICE
priority
!
service-policy LLQ interface inside
!
! Tune PQ
!
priority-queue inside
queue-limit 5
Verification
Queue Type = BE
Packets Dropped = 0
Packets Transmit = 26
Packets Enqueued = 0
Current Q Length = 0
Max Q Length = 0
Queue Type = BE
Packets Dropped = 0
Packets Transmit = 23
Packets Enqueued = 0
Current Q Length = 0
Max Q Length = 0
Further Reading
Using Modular Policy Framework
Applying QoS Policies
TCP Normalization
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
tcp-map TCP
check-retransmission
checksum-verification
reserved-bits clear
!
class-map TELNET
match port tcp eq 23
!
policy-map global_policy
class TELNET
set connection advanced TCP
Verification
Global policy:
Service-policy: global_policy
Class-map: inspection_default
Inspect: dns preset_dns_map, packet 0, drop 0, reset-drop 0
Inspect: ftp, packet 0, drop 0, reset-drop 0
Inspect: h323 h225 _default_h323_map, packet 0, drop 0, reset-drop 0
Inspect: h323 ras _default_h323_map, packet 0, drop 0, reset-drop 0
Inspect: rsh, packet 0, drop 0, reset-drop 0
Inspect: rtsp, packet 0, drop 0, reset-drop 0
Inspect: sqlnet, packet 0, drop 0, reset-drop 0
Inspect: skinny, packet 0, drop 0, reset-drop 0
Inspect: sunrpc, packet 0, drop 0, reset-drop 0
Inspect: xdmcp, packet 0, drop 0, reset-drop 0
Inspect: sip, packet 0, drop 0, reset-drop 0
Inspect: netbios, packet 0, drop 0, reset-drop 0
Inspect: tftp, packet 0, drop 0, reset-drop 0
Inspect: icmp, packet 10, drop 0, reset-drop 0
Class-map: TELNET
Set connection policy:
Set connection advanced-options: TCP
Retransmission drops: 0 TCP checksum drops : 0
Exceeded MSS drops : 0 SYN with data drops: 0
Out-of-order packets: 0 No buffer drops : 0
Reserved bit cleared: 0 Reserved bit drops : 0
IP TTL modified : 0 Urgent flag cleared: 0
Window varied resets: 0
TCP-options:
Selective ACK cleared: 0 Timestamp cleared : 0
Window scale cleared : 0
Other options cleared: 0
Other options drops: 0
Further Reading
Using Modular Policy Framework
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
!
! Configure AAA server
!
aaa-server RADIUS protocol radius
aaa-server RADIUS (dmz) host 10.0.0.100 CISCO
!
! Configure management class-map to match RADIUS ACC packets
!
class-map type management RADIUS
match port udp eqradius-acct
!
! RADIUS inspection policy
!
policy-map type inspect radius-accounting RADIUS_INSPECT
parameters
send response
validate-attribute 26
host 10.0.0.100 key CISCO
!
policy-map global_policy
class RADIUS
inspect radius-accounting RADIUS_INSPECT
Verification
Global policy:
Service-policy: global_policy
Class-map: inspection_default
Inspect: dns preset_dns_map, packet 0, drop 0, reset-drop 0
Inspect: ftp, packet 0, drop 0, reset-drop 0
Inspect: h323 h225 _default_h323_map, packet 0, drop 0, reset-drop 0
Inspect: h323 ras _default_h323_map, packet 0, drop 0, reset-drop 0
Inspect: rsh, packet 0, drop 0, reset-drop 0
Inspect: rtsp, packet 0, drop 0, reset-drop 0
Inspect: esmtp _default_esmtp_map, packet 0, drop 0, reset-drop 0
Inspect: sqlnet, packet 0, drop 0, reset-drop 0
Inspect: skinny, packet 0, drop 0, reset-drop 0
Inspect: sunrpc, packet 0, drop 0, reset-drop 0
Inspect: xdmcp, packet 0, drop 0, reset-drop 0
Inspect: sip, packet 0, drop 0, reset-drop 0
Inspect: netbios, packet 0, drop 0, reset-drop 0
Inspect: tftp, packet 0, drop 0, reset-drop 0
Class-map: RADIUS
Inspect: radius-accounting RADIUS_INSPECT, packet 0
Further Reading
RADIUS Accounting Inspection
Objective: Configure the firewall for ICMP traffic inspection with NAT.
AAA/CA
Server
.100
DMZ
10.0.0.0/24 VLAN120
136.X.122.0/24 VLAN122
.12
.12 .12 R2
Lo0: 150.X.1.1/24
R3 .2
.1
Inside ASA1 Outside
R1
RIPv2
136.X.121.0/24 VLAN121
Directions
Final Configuration
ASA1:
!
! Static mapping
!
static (inside,outside) 136.1.122.1 136.1.121.1
!
! Apply ICMP inspection
!
policy-map global_policy
class inspection_default
inspect icmp error
inspect icmp
Verification
R1#ping 136.1.122.2
R2#traceroute 150.1.1.1
After:
R1#ping 136.1.122.2
R2#traceroute 150.1.1.1
Further Reading
ICMP Inspection