Sunteți pe pagina 1din 118

Chapter 9

Building IPSEC VPNS Using Cisco Routers

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-1


Objectives

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-2


Objectives

Upon completion of this chapter, you will be


able to perform the following tasks:
Define two types Cisco router VPN solutions.
Describe the Cisco VPN router product family.
Identify the IPSec and other open standards
supported by Cisco VPN routers.
Identify the component technologies of IPSec.
Explain how IPSec works.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-3


Objectives (cont.)

Configure a Cisco router for IKE using


pre-shared keys.
Configure a Cisco router for IPSec using
pre-shared keys.
Verify the IKE and IPSec configuration.
Explain the issues regarding configuring IPSec
manually and using RSA encrypted nonces.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-4


Cisco Routers Enable Secure
VPNs

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-5


VPN Definition
Mobile
user

Central site Analog Remote


ISDN
Cable site
Server DSL

Internet Remote
site

VPNAn encrypted connection between private


networks over a public network such as the
Internet
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-6
Remote Access VPNs

Central site
Remote access client

DSL
cable POP
Telecommuter Internet
Router

POP

Mobile
Extranet
Consumer-to-business

Remote access VPNExtension/evolution of dial


2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-7
Site-to-Site VPNs

Remote
office
1700/2600
Series Main office
7100/7200/7400
Series
Regional
office
3600/3700 Internet
Series

Small office/
home office
800/900 Series

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-8


Cisco VPN Router Portfolio

Cisco 3745

Cisco 3725

Cisco 3600

Cisco 2600XM/2691

Cisco 1760

Cisco 1700

Cisco 800

Teleworker/SOHO SMB/Small Branch Enterprise Branch Large Branch Enterprise HQ


And Beyond
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-9
Cisco VPN Router
PortfolioLarge Enterprise

Cat 6500

Cisco 7200/400

Cisco 7400

Cisco 7204/225

Cisco 7140

Cisco 7120

Large Enterprise
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-10
Small to Mid-SizeCisco VPN
Routers

800 925 1700 2621 2651 3620 3640 3660

Maximum tunnels 10 20 100 300 800 800 800 1300

Performance
0.384 6 4 12 15 10 18 40
(Mbps)

Hardware VPN AIM- AIM- NM- NM- AIM-


None Yes
encryption module VPN/BP VPN/BP VPN/MP VPN/MP VPN/BP

Hardware accelerators deliver enhanced encryption


performance

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-11


Enterprise SizeCisco VPN Routers

CAT
7120 7140 7140 7200 7400 7200
6500

Maximum tunnels 2000 2000 3000 2000 5000 5000 8000

Performance
50 85 145 90 120 145 1.9G
(Mbps)

Hardware
ISM ISM VAM ISA VAM VAM Yes
encryption

Hardware accelerators deliver enhanced encryption performance

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-12


IPSec Overview

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-13


What Is IPSec?

Main site

Business partner
with a Cisco router
IPSec Perimeter
router

Concentrator PIX
POP Firewall
Regional office with
a PIX Firewall
Mobile worker with a
Cisco VPN Client
SOHO with a Cisco on a laptop computer Corporate
ISDN/DSL router

IPSec acts at the network layer protecting and authenticating IP packets


Framework of open standards - algorithm independent
Provides data confidentiality, data integrity, and origin authentication

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-14


IPSec Security Services

Confidentiality
Data integrity
Origin authentication
Anti-replay protection

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-15


Confidentiality (Encryption)

This quarterly report


does not look so
good. Hmmm . . . .

15%
by
s off
ing
Server Ea
rn

Internet

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-16


Types of Encryption

Hmmm . . . .
Pay to Terry Smith $100.00 I cannot Pay to Terry Smith $100.00

One Hundred and xx/100 Dollars


Encryption read a One Hundred and xx/100 Dollars
Encryption
algorithm thing.
algorithm

4ehIDx67NMop9eR Internet 4ehIDx67NMop9eR


U78IOPotVBn45TR U78IOPotVBn45TR

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-17


DH Key Exchange

Terry Alex
public key B public key A
+ private key A + private key B
shared secret shared secret
key (BA)
Key = Key
key (AB)

Protocol Messages Protocol Messages


Data Traffic Data Traffic
Pay to Terry Smith $100.00 Pay to Terry Smith $100.00
One Hundred and xx/100 Dollars
Decrypt Decrypt One Hundred and xx/100 Dollars

4ehIDx67NMop9eR 4ehIDx67NMop9eR
U78IOPotVBn45TR
Internet U78IOPotVBn45TR

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-18


DH Key Exchange

Peer A Peer B

1. Generate large integer p. 1. Generate large integer q.


Send p to Peer B. Send q to Peer A.
Receive q. Receive p.
Generate g. Generate g.
2. Generate private key XA 2. Generate private key XB
3. Generate public key 3. Generate public key
YA = g ^ XA mod p YB = g ^ XB mod p
4. Send public key YA 4. Send public key YB
5. Generate shared secret 5. Generate shared secret
number ZZ = YB^ XA mod p number ZZ = YA^ XB mod p

6. Generate shared secret key 6. Generate shared secret key


from ZZ (DES, 3DES, or AES) from ZZ (DES, 3DES, or AES)

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-19


RSA Encryption

Local Remote
Key Key
Remotes Remotes
public key private key

Pay to Terry Smith $100.00


Pay to Terry Smith $100.00
Encrypt Decrypt One Hundred and xx/100 Dollars
One Hundred and xx/100 Dollars

KJklzeAidJfdlwiej47
DlItfd578MNSbXoE

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-20


Encryption Algorithms
Key Key

Encryption key Decryption key

Pay to Terry Smith $100.00


Encrypt Decrypt Pay to Terry Smith $100.00

One Hundred and xx/100 Dollars One Hundred and xx/100 Dollars

4ehIDx67NMop9eR
U78IOPotVBn45TR

Encryption algorithms
DES
3DES
AES
RSA

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-21


Data Integrity

Yes, I am
Alex Jones

Internet

Pay to Terry Smith $100.00 Pay to Alex Jones $1000.00


One Hundred and xx/100 Dollars One Thousand and xx/100 Dollars

4ehIDx67NMop9 12ehqPx67NMoX

Match = No changes
No match = Alterations

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-22


HMAC

Local Remote
Shared
Variable-length Received
secret key
input message message
Pay to Terry Smith $100.00
Shared Pay to Terry Smith $100.00
One Hundred and xx/100 Dollars One Hundred and xx/100 Dollars
secret key
1

Hash Hash
function function

Pay to Terry Smith $100.00


One Hundred and xx/100 Dollars
2
4ehIDx67NMop9 4ehIDx67NMop9 4ehIDx67NMop9
Message + hash

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-23


HMAC Algorithms

Pay to Terry Smith $100.00


One Hundred and xx/100 Dollars

Hash
HMAC algorithms
function
HMAC-MD5
HMAC-SHA-1
Pay to Terry Smith $100.00
One Hundred and xx/100 Dollars

4ehIDx67NMop9 4ehIDx67NMop9

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-24


Digital Signatures
Local Remote

Pay to Terry Smith $100.00


Internet Pay to Terry Smith $100.00
Hash
One Hundred and xx/100 Dollars One Hundred and xx/100 Dollars

4ehIDx67NMop9 4ehIDx67NMop9
Match

Encryption Decryption
algorithm Hash
algorithm
Private
key Public
Hash
key

Hash
algorithm

Pay to Terry Smith $100.00


One Hundred and xx/100 Dollars

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-25


Peer Authentication

Remote office
Corporate Office

Internet
HR
servers
Peer
authentication

Peer authentication methods:


Pre-shared keys
RSA signatures
RSA encrypted nonces

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-26


Pre-Shared Keys

Local Peer Remote Router


Auth. Key + ID
Information
Auth. Key
+ ID
Information
Hash

Internet Hash
Authenticating hash
(Hash_L)
Computed
hash
(Hash)
=
Received
hash
(Hash_L)
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-27
RSA Signatures
Local Remote
Auth. key + ID
Information
Auth. key + ID
Information

Hash
Hash
Digital
2
Hash_I signature
Private
Hash
key
1
Encryption Internet =
algorithm Decryption
algorithm Hash_I

Public Digital
Digital Digital
cert + signature
key cert

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-28


RSA Encrypted Nonces

Local Remote
Auth. key
+ ID
Information
Auth. key + ID
Information
Hash

Internet Hash
Authenticating hash
(Hash_I)
Computed
hash
(Hash_I)
=
Received
hash
(Hash_I)

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-29


IPSec Protocol Framework

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-30


IPSec Security Protocols
Authentication Header
Router A Router B
All data in clear text

The Authentication Header


provides the following:
Authentication
Integrity
Encapsulating Security Payload
Router A Router B
Data payload is encrypted

The Encapsulating Security Payload


provides the following:
Encryption
Authentication
2003, Cisco Systems, Inc. All rights reserved.
Integrity SECUR 1.09-31
Authentication Header

Router A Router B
All data in clear text

Ensures data integrity


Provides origin authentication (ensures
packets definitely came from peer router)
Uses keyed-hash mechanism
Does not provide confidentiality (no encryption)
Provides anti-replay protection

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-32


AH Authentication and Integrity

IP header + data + key


Router B
Hash

Authentication data IP HDR AH Data


(00ABCDEF)
Internet IP header + data + key

IP HDR AH Data Hash

Received Re-computed
hash hash
Router A (00ABCDEF) = (00ABCDEF)

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-33


ESP

Router A Router B
Data payload is encrypted

Data confidentiality (encryption)


Data integrity
Data origin authentication
Anti-replay protection

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-34


ESP Protocol

Internet

Router Router
IP HDR Data IP HDR Data

ESP ESP
New IP HDR ESP HDR IP HDR Data Trailer Auth
Encrypted
Authenticated

Provides confidentiality with encryption


Provides integrity with authentication
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-35
Modes of UseTunnel versus
Transport Mode

IP HDR Data

Transport mode
ESP ESP
IP HDR ESP HDR Data Trailer Auth

Encrypted
Authenticated

Tunnel mode
ESP ESP
New IP HDR ESP HDR IP HDR Data Trailer Auth
Encrypted
Authenticated

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-36


Tunnel Mode
Remote office
Corporate office

Internet

HR
servers

Tunnel mode

Home office Corporate office

Internet
HR
servers

Tunnel mode

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-37


IPSec ProtocolFramework

IPSec
Framework
Choices:

IPSec Protocol ESP AH

Encryption 3
DES AES
DES

Authentication MD5 SHA

Diffie-Hellman DH1 DH2

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-38


How IPSec Works

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-39


Five Steps of IPSec
Host A Host B
Router A Router B

Interesting TrafficThe VPN devices recognize the traffic


to protect.
IKE Phase 1The VPN devices negotiate an IKE security
policy and establish a secure channel.
IKE Phase 2The VPN devices negotiate an IPSec
security policy used to protect IPSec data.
Data transferThe VPN devices apply security services
to traffic and then transmit the traffic.
Tunnel terminatedThe tunnel is torn down.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-40


Step 1Interesting Traffic

Host A Host B
Router A Router B

10.0.1.3 10.0.2.3
Apply IPSec
Bypass IPSec

Send in cleartext

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-41


Step 2IKE Phase 1

Host A Host B
Router A Router B

IKE Phase 1:
10.0.1.3 10.0.2.3
main mode exchange

Negotiate the Negotiate the


policy policy

DH exchange DH exchange

Verify the peer Verify the peer


identity identity

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-42


IKE Transform Sets

Host A Host B
Router A Router B

Negotiate IKE Proposals


10.0.1.3 10.0.2.3

Transform 10 Transform 15
DES DES
MD5 MD5
pre-share IKE Policy Sets pre-share
DH1 DH1
lifetime lifetime

Transform 20
3DES
SHA
pre-share
DH1
lifetime

Negotiates matching IKE transform sets to protect IKE exchange

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-43


DH Key Exchange

Terry Alex
public key B public key A
+ private key A + private key B
shared secret shared secret
key (BA)
Key = Key
key (AB)

Pay to Terry Smith $100.00 Pay to Terry Smith $100.00


One Hundred and xx/100 Dollars
Encrypt Decrypt One Hundred and xx/100 Dollars

4ehIDx67NMop9eR 4ehIDx67NMop9eR
U78IOPotVBn45TR Internet U78IOPotVBn45TR

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-44


Authenticate Peer
Identity

Remote office
Corporate office

Internet
HR
servers
Peer
authentication

Peer authentication methods


Pre-shared keys
RSA signatures
RSA encrypted nonces
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-45
Step 3IKE Phase 2

Host A Host B
Router A Router B

10.0.1.3 Negotiate IPSec 10.0.2.3


security parameters

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-46


IPSec Transform Sets

Host A Host B
Router A Router B

Negotiate transform sets


10.0.1.3 10.0.2.3

Transform set 30 Transform set 55


ESP ESP
3DES 3DES
SHA IPSec Transform Sets SHA
Tunnel Tunnel
Lifetime Lifetime

Transform set 40
ESP
A transform set is a
DES
MD5
combination of algorithms
Tunnel
Lifetime
and protocols that enact a
security policy for traffic.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-47


Security Associations (SA)

BAN K
SA
SA Db
Destination IP address

192.168.2.1
SPI
SPI12 Protocol (ESP or AH)
ESP/3DES/SHA
tunnel Security Policy Db
28800 Encryption Algorithm
Authentication Algorithm
Internet
Mode
Key lifetime
192.168.12.1
SPI39
ESP/DES/MD5
tunnel
28800

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-48


SA Lifetime

Data-based Time-based

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-49


Step 4IPSec Session

Host A Host B
Router A Router B

IPSec session

SAs are exchanged between peers.


The negotiated security services are applied to
the traffic.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-50


Step 5Tunnel
Termination
Host A Host B
Router A Router B

IPSec tunnel

A tunnel is terminated
By an SA lifetime timeout
If the packet counter is
exceeded
Removes IPSec SA
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-51
Configuring IPSec Encryption

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-52


Tasks to Configure IPSec Encryption

Task 1Prepare for IKE and IPSec.


Task 2Configure IKE.
Task 3Configure IPSec.
Task 4Test and Verify IPSec.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-53


Task 1Prepare for IKE
and IPSec

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-54


Task 1Prepare for IKE and IPSec

Step 1Determine IKE (IKE phase one) policy.


Step 2Determine IPSec (IKE phase two) policy.
Step 3Check the current configuration.
show running-configuration
show crypto isakmp policy
show crypto map
Step 4Ensure the network works without encryption.
ping
Step 5Ensure access lists are compatible with IPSec.
show access-lists

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-55


Step 1Determine IKE
(IKE Phase One) Policy

Determine the following policy details:


Key distribution method
Authentication method
IPSec peer IP addresses and hostnames
IKE phase 1 policies for all peers
Encryption algorithm
Hash algorithm
IKE SA lifetime
Goal: Minimize misconfiguration.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-56


IKE Phase One Policy Parameters

Parameter Strong Stronger

Encryption algorithm DES 3-DES

Hash algorithm MD5 SHA-1

Authentication RSA encryption


Pre-shared
method RSA signature

Key exchange DH Group 1 DH Group 2

IKE SA lifetime 86400 seconds < 86400 seconds

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-57


IKE Policy Example
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2

Parameter Site 1 Site 2

Encryption algorithm DES DES

Hash algorithm MD5 MD5

Authentication method Pre-shared keys Pre-shared keys

Key exchange DH Group 1 DH Group 1

IKE SA lifetime 86400 seconds 86400 seconds

Peer IP address 172.30.2.2 172.30.1.2

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-58


Step 2Determine IPSec
(IKE Phase Two) Policy

Determine the following policy details:


IPSec algorithms and parameters for optimal
security and performance
Transforms and, if necessary, transform sets
IPSec peer details
IP address and applications of hosts to be
protected
Manual or IKE-initiated SAs
Goal: Minimize misconfiguration.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-59


IPSec Transforms Supported in
Cisco IOS Software

Cisco IOS software supports the following


IPSec transforms:
RouterA(config)# crypto ipsec transform-set
transform-set-name ?
ah-md5-hmac AH-HMAC-MD5 transform
ah-sha-hmac AH-HMAC-SHA transform
esp-3des ESP transform using 3DES(EDE) cipher (168
bits)
esp-des ESP transform using DES cipher (56 bits)
esp-md5-hmac ESP transform using HMAC-MD5 auth
esp-sha-hmac ESP transform using HMAC-SHA auth
esp-null ESP transform w/o cipher

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-60


IPSec Policy Example
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2

Policy Site 1 Site 2

Transform set ESP-DES, tunnel ESP-DES, tunnel

Peer hostname RouterB RouterA

Peer IP address 172.30.2.2 172.30.1.2

Hosts to be encrypted 10.0.1.3 10.0.2.3


Traffic (packet) type to
TCP TCP
be encrypted

SA establishment Ipsec-isakmp Ipsec-isakmp

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-61


Identify IPSec Peers

Cisco router

Remote user with


Cisco VPN Client
Cisco
PIX Firewall
Cisco router

Other vendors
CA server
IPSec peers

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-62


Step 3Check Current Configuration
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
172.30.1.2 172.30.2.2
router#
show running-config
View router configuration for existing IPSec policies.
router#
show crypto isakmp policy
View default and any configured IKE phase one policies.
RouterA# show crypto isakmp policy
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys)
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman Group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-63


Step 3Check Current Configuration
(cont.)
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
172.30.1.2 172.30.2.2

router#
show crypto map
View any configured crypto maps.
RouterA# show crypto map
Crypto Map "mymap" 10 ipsec-isakmp
Peer = 172.30.2.2
Extended IP access list 102
access-list 102 permit ip host 172.30.1.2 host 172.30.2.2
Current peer: 172.30.2.2
Security association lifetime: 4608000 kilobytes/3600 seconds
PFS (Y/N): N
Transform sets={ mine, }

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-64


Step 3Check Current Configuration
(cont.)
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
172.30.1.2 172.30.2.2

router#
show crypto ipsec transform-set
View any configured transform sets.

RouterA# show crypto ipsec transform-set mine


Transform set mine: { esp-des }
will negotiate = { Tunnel, },

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-65


Step 4Ensure the Network Works

Cisco RouterB
172.30.2.2

Remote user with


Cisco Unified Cisco
VPN client PIX Firewall
Cisco router

Cisco RouterA
172.30.1.2
Other vendors
CA server
IPSec peers

RouterA# ping 172.30.2.2

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-66


Step 5Ensure Access Lists are
Compatible with IPSec

IKE
AH
ESP
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2

RouterA# show access-lists


access-list 102 permit ahp host 172.30.2.2 host 172.30.1.2
access-list 102 permit esp host 172.30.2.2 host 172.30.1.2
access-list 102 permit udp host 172.30.2.2 host 172.30.1.2 eq
isakmp

Ensure protocols 50 and 51, and UDP port 500 traffic are
not blocked at interfaces used by IPSec.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-67


Task 2Configure IKE

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-68


Task 2Configure IKE

Step 1Enable or disable IKE.


crypto isakmp enable
Step 2Create IKE policies.
crypto isakmp policy
Step 3Configure pre-shared keys.
crypto isakmp key
Step 4Verify the IKE configuration.
show crypto isakmp policy

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-69


Step 1Enable or Disable IKE
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
172.30.1.2 172.30.2.2

router(config)#
[no] crypto isakmp enable

RouterA(config)# no crypto isakmp enable


RouterA(config)# crypto isakmp enable
Globally enables or disables IKE at your router.
IKE is enabled by default.
IKE is enabled globally for all interfaces at the router.
Use the no form of the command to disable IKE.
An ACL can be used to block IKE on a particular interface.
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-70
Step 2Create IKE Policies

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
172.30.1.2 172.30.2.2

router(config)#
crypto isakmp policy priority
Defines an IKE policy, which is a set of parameters used
during IKE negotiation.
Invokes the config-isakmp command mode.

RouterA(config)# crypto isakmp policy 110

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-71


Create IKE Policies with the
crypto isakmp Command
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
Policy 110 172.30.2.2
DES
MD5 Tunnel
Pre-Share
86400

router(config)#
crypto isakmp policy priority
Defines the parameters within the IKE policy 110.
RouterA(config)# crypto isakmp policy 110
RouterA(config-isakmp)# authentication pre-share
RouterA(config-isakmp)# encryption des
RouterA(config-isakmp)# group 1
RouterA(config-isakmp)# hash md5
RouterA(config-isakmp)# lifetime 86400
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-72
IKE Policy Negotiation

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3

RouterA(config)# RouterB(config)#
crypto isakmp policy 100 crypto isakmp policy 100
hash md5 hash md5
authentication pre-share authentication pre-share
crypto isakmp policy 200 crypto isakmp policy 200
authentication rsa-sig authentication rsa-sig
hash sha hash sha
crypto isakmp policy 300 crypto isakmp policy 300
authentication pre-share authentication rsa-sig
hash md5 hash md5

The first two policies in each router can be successfully


negotiated while the last one can not.
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-73
Step 3Configure ISAKMP Identity

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
172.30.1.2 172.30.2.2

router(config)#
crypto isakmp identity {address | hostname}
Defines whether ISAKMP identity is done by IP address
or hostname.
Use consistently across ISAKMP peers.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-74


Step 3Configure Pre-Shared Keys
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
Pre-shared key
Cisco1234 172.30.2.2
router(config)#
crypto isakmp key keystring address peer-address

router(config)#
crypto isakmp key keystring hostname hostname

RouterA(config)# crypto isakmp key cisco1234


address 172.30.2.2
Assigns a keystring and the peer address.
The peers IP address or host name can be used.
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-75
Step 4Verify the IKE Configuration
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3

RouterA# show crypto isakmp policy


Protection suite of priority 110
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Message Digest 5
authentication method: Pre-Shared Key
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
Displays configured and default IKE policies.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-76


Task 3Configure IPSec

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-77


Task 3Configure IPSec

Step 1Configure transform set suites.


crypto ipsec transform-set

Step 2Configure global IPSec SA


lifetimes.
crypto ipsec security-association
lifetime

Step 3Create crypto access lists.


access-list
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-78
Task 3Configure IPSec (cont.)

Step 4Create crypto maps.


crypto map
Step 5Apply crypto maps to interfaces.
interface serial0
crypto map

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-79


Step 1Configure Transform
Set Suites

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-80


Configure Transform Sets
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
Mine
esp-des
Tunnel
router(config)#
crypto ipsec transform-set transform-set-name
transform1 [transform2 [transform3]]
router(cfg-crypto-trans)#

RouterA(config)# crypto ipsec transform-set mine des


A transform set is a combination of IPSec transforms that enact a
security policy for traffic.
Sets are limited to up to one AH and up to two ESP transforms.
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-81
Transform Set Negotiation
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3

transform-set 10 transform-set 40
esp-3des esp-des
tunnel tunnel

transform-set 20 transform-set 50
esp-des, esp-md5-hmac esp-des, ah-sha-hmac
tunnel tunnel

transform-set 30 transform-set 60
esp-3des, esp-sha-hmac Match esp-3des, esp-sha-hmac
tunnel tunnel

Transform sets are negotiated during IKE phase two.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-82


Step 2Configure Global
IPSec Security Association
Lifetimes

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-83


crypto ipsec security-association lifetime
Command
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
router(config)#
crypto ipsec security-association lifetime
{seconds seconds | kilobytes kilobytes}

RouterA(config)# crypto ipsec security-association


lifetime 86400
Configures global IPSec SA lifetime values used when negotiating IPSec
security associations.
IPSec SA lifetimes are negotiated during IKE phase two.
Can optionally configure interface specific IPSec SA lifetimes in crypto
maps.
IPSec SA lifetimes in crypto maps override global IPSec SA lifetimes.
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-84
Global Security Association Lifetime
Examples

RouterA(config)# crypto ipsec security-association lifetime


kilobytes 1382400

RouterA(config)# crypto ipsec security-association lifetime


seconds 2700

When a security association


expires, a new one is negotiated
without interrupting the data flow.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-85


Step 3Create Crypto ACLs

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-86


Purpose of Crypto Access Lists
Site 1
RouterA
Internet
A

Outbound
Encrypt
traffic
Bypass (clear text)

Permit Inbound
Bypass (clear text) traffic

OutboundIndicate the data flow to be protected by IPSec.


Inboundfilter out and discard traffic that should have been
protected by IPSec.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-87


Extended IP Access Lists for Crypto
Access Lists
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
10.0.1.0 Encrypt 10.0.2.0

router(config)#
access-list access-list-number [dynamic dynamic-name
[timeout minutes]] {deny | permit} protocol source
source-wildcard destination destination-wildcard
[precedence precedence][tos tos] [log]

RouterA(config)# access-list 110 permit tcp 10.0.1.0


0.0.0.255 10.0.2.0 0.0.0.255
Define which IP traffic will be protected by crypto.
Permit = encrypt / Deny = do not encrypt.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-88


Configure Symmetrical Peer Crypto
Access Lists
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2

RouterA(config)# RouterB(config)#
access-list 110 access-list 101
permit tcp permit tcp
10.0.1.0 10.0.2.0
0.0.0.255 0.0.0.255
10.0.2.0 10.0.1.0
0.0.0.255 0.0.0.255
You must configure mirror image ACLs.
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-89
Step 4Create Crypto Maps

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-90


Purpose of Crypto Maps

Crypto maps pull together the various parts


configured for IPSec, including
Which traffic should be protected by IPSec.
The granularity of the traffic to be protected by a set of SAs.
Where IPSec-protected traffic should be sent.
The local address to be used for the IPSec traffic.
What IPSec type should be applied to this traffic.
Whether SAs are established (manually or via IKE).
Other parameters needed to define an IPSec SA.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-91


Crypto Map Parameters
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3

Crypto maps define the following:


The access list to be used.
Remote VPN peers.
Transform-set to be used. Crypto Encrypted traffic
Key management method. map
Security-association lifetimes. Router
interface

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-92


Configure IPSec Crypto Maps
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3

router(config)#
crypto map map-name seq-num ipsec-manual

crypto map map-name seq-num ipsec-isakmp


[dynamic dynamic-map-name]

RouterA(config)# crypto map mymap 110 ipsec-isakmp


Use a different sequence number for each peer.
Multiple peers can be specified in a single crypto map for
redundancy.
One crypto map per interface
2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-93
Example Crypto Map Commands
Site 1 Site 2
RouterA RouterB

A B
10.0.1.3 10.0.2.3
Internet 172.30.2.2

RouterC

172.30.3.2
RouterA(config)# crypto map mymap 110 ipsec-isakmp
RouterA(config-crypto-map)# match address 110
RouterA(config-crypto-map)# set peer 172.30.2.2
RouterA(config-crypto-map)# set peer 172.30.3.2
RouterA(config-crypto-map)# set pfs group1
RouterA(config-crypto-map)# set transform-set mine
RouterA(config-crypto-map)# set security-association lifetime 86400
Multiple peers can be specified for redundancy.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-94


Step 5Apply Crypto Maps to
Interfaces

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-95


Applying Crypto Maps to Interfaces

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2

mymap

router(config-if)#
crypto map map-name
RouterA(config)# interface ethernet0/1
RouterA(config-if)# crypto map mymap
Apply the crypto map to outgoing interface
Activates the IPSec policy

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-96


IPSec Configuration Examples

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2

RouterA# show running config RouterB# show running config


crypto ipsec transform-set mine esp-des crypto ipsec transform-set mine esp-des
! !
crypto map mymap 10 ipsec-isakmp crypto map mymap 10 ipsec-isakmp
set peer 172.30.2.2 set peer 172.30.1.2
set transform-set mine set transform-set mine
match address 110 match address 101
! !
interface Ethernet 0/1 interface Ethernet 0/1
ip address 172.30.1.2 255.255.255.0 ip address 172.30.2.2 255.255.255.0
no ip directed-broadcast no ip directed-broadcast
crypto map mymap crypto map mymap
! !
access-list 110 permit tcp 10.0.1.0 access-list 101 permit tcp 10.0.2.0
0.0.0.255 10.0.2.0 0.0.0.255 0.0.0.255 10.0.1.0 0.0.0.255

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-97


Task 4Test and Verify IPSec

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-98


Task 4Test and Verify IPSec

Display your configured IKE policies.


show crypto isakmp policy
Display your configured transform sets.
show crypto ipsec transform set
Display the current state of your IPSec
SAs.
show crypto ipsec sa

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-99


Task 4Test and Verify IPSec (cont.)

Display your configured crypto maps.


show crypto map
Enable debug output for IPSec events.
debug crypto ipsec
Enable debug output for ISAKMP events.
debug crypto isakmp

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-100


show crypto isakmp policy Command

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
router#
show crypto isakmp policy
RouterA# show crypto isakmp policy
Protection suite of priority 110
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Message Digest 5
authentication method: Rivest-Shamir-Adleman Encryption
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit
Default protection suite
encryption algorithm: DES - Data Encryption Standard (56 bit keys).
hash algorithm: Secure Hash Standard
authentication method: Rivest-Shamir-Adleman Signature
Diffie-Hellman group: #1 (768 bit)
lifetime: 86400 seconds, no volume limit

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-101


show crypto ipsec transform-set
Command

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2

router#
show crypto ipsec transform-set

RouterA# show crypto ipsec transform-set


Transform set mine: { esp-des }
will negotiate = { Tunnel, },
View the currently defined transform sets.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-102


show crypto ipsec sa Command
Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2
router#
show crypto ipsec sa
RouterA# show crypto ipsec sa
interface: Ethernet0/1
Crypto map tag: mymap, local addr. 172.30.1.2
local ident (addr/mask/prot/port): (172.30.1.2/255.255.255.255/0/0)
remote ident (addr/mask/prot/port): (172.30.2.2/255.255.255.255/0/0)
current_peer: 172.30.2.2
PERMIT, flags={origin_is_acl,}
#pkts encaps: 21, #pkts encrypt: 21, #pkts digest 0
#pkts decaps: 21, #pkts decrypt: 21, #pkts verify 0
#send errors 0, #recv errors 0
local crypto endpt.: 172.30.1.2, remote crypto endpt.: 172.30.2.2
path mtu 1500, media mtu 1500
current outbound spi: 8AE1C9C

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-103


show crypto map Command

Site 1 Site 2
RouterA RouterB
Internet
A B
10.0.1.3 10.0.2.3
E0/1 172.30.1.2 E0/1 172.30.2.2
router#
show crypto map
View the currently configured crypto maps.
RouterA# show crypto map
Crypto Map "mymap" 10 ipsec-isakmp
Peer = 172.30.2.2
Extended IP access list 102
access-list 102 permit ip host 172.30.1.2 host
172.30.2.2
Current peer: 172.30.2.2
Security association lifetime: 4608000 kilobytes/3600 seconds
PFS (Y/N): N
Transform sets={ mine, }

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-104


debug crypto Commands

router#
debug crypto ipsec

Displays debug messages about all IPSec actions.

router#
debug crypto isakmp

Displays debug messages about all ISAKMP actions.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-105


Crypto System Error Messages for ISAKMP

%CRYPTO-6-IKMP_SA_NOT_AUTH: Cannot accept Quick Mode exchange


from %15i if SA is not authenticated!
ISAKMP SA with the remote peer was not authenticated.

%CRYPTO-6-IKMP_SA_NOT_OFFERED: Remote peer %15i responded with


attribute [chars] not offered or changed
ISAKMP peers failed protection suite negotiation for ISAKMP.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-106


Overview of Configuring IPSec
Manually

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-107


Setting Manual Keys with
security-association Commands

router(config-crypto-map)#
set security-association inbound|outbound ah spi
hex-key-string

set security-association inbound|outbound esp spi cipher


hex-key-string [authenticator hex-key-string]

Specifies inbound or outbound SA.


Sets Security Parameter Index (SPI) for the SA.
Sets manual AH and ESP keys:
ESP key length is 56 bits with DES, 168 with 3DES.
AH HMAC key length is 128 bits with MD5, 160 bits with SHA .
SPIs should be reciprocal for IPsec peer.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-108


Overview of Configuring IPSec
for RSA Encrypted Nonces

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-109


Tasks to Configure IPSec for
RSA Encryption

Task 1Prepare for IPSec.


Task 2Configure RSA keys.
Task 3Configure IKE.
Task 4Configure IPSec.
Task 5Test and verify IPSec.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-110


Task 2Configure RSA Keys

Step 1Plan for RSA keys.


Step 2Configure the routers host name and
domain name.
hostname name
ip domain-name name
Step 3Generate RSA keys.
crypto key generate rsa usage keys

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-111


Task 2Configure RSA Keys (cont.)

Step 4Enter peer RSA public keys.


crypto key pubkey-chain
crypto key pubkey-chain rsa
addressed-key key address
named-key key name
key-string

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-112


Task 2Configure RSA Keys (cont.)

Step 5Verify key configuration.


show crypto key mypubkey rsa
show crypto key pubkey-chain rsa
Step 6Manage RSA keys.
crypto key zeroize rsa

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-113


Summary

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-114


Summary

Cisco supports the following IPSec standards: AH, ESP,


DES, 3DES, MD5, SHA, RSA signatures, IKE (also known
as ISAKMP), DH, and CAs.
There are five steps to IPSec: interesting traffic, IKE
phase 1, IKE phase 2, IPSec encrypted traffic, and tunnel
termination.
IPSec SAs consist of a destination address, SPI, IPSec
transform, mode, and SA lifetime value.
Define the detailed crypto IKE and IPSec security policy
before beginning configuration.
Ensure router access lists permit IPSec traffic.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-115


Summary (cont.)

IKE policies define the set of parameters used during IKE


negotiation.
Transform sets determine IPSec transform and mode.
Crypto access lists determine traffic to be encrypted.
Crypto maps pull together all IPSec details and are
applied to interfaces.
Use show and debug commands to test and troubleshoot.
IPSec can also be configured manually or using
encrypted nonces.

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-116


Lab Exercise

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-117


Lab Visual Objective
WEB
FTP

.50
172.26.26.0
.150
PODS 1-5 .1 .1 PODS 6-10
RBB
172.30.P.0 172.30.Q.0

.2 .2
ROUTER ROUTER

.2 .2
RTS RTS
.100 10.0.P.0 10.0.Q.0 .100
.10 .10
WEB WEB
FTP FTP

WEB/FTP WEB/FTP
CSACS CSACS

STUDENT PC STUDENT PC
REMOTE: 10.1.P.12 REMOTE: 10.1.Q.12
LOCAL: 10.0.P.12 LOCAL: 10.0.Q.12

2003, Cisco Systems, Inc. All rights reserved. SECUR 1.09-118

S-ar putea să vă placă și