Task 2: Configure IKE for Preshared Keys
The next major task in configuring PIX Firewall IPSec is to configure IKE parameters gathered earlier. Note that, in PIX configuration commands, ISAKMP is synonymous with IKE. Configuring IKE consists of the following essential steps and commands, which are covered in subsequent sections in more detail:
Step 1 |
Enable or disable IKE with the isakmp enable command. |
Step 2 |
Create IKE policies with the isakmp policy commands. |
Step 3 |
Configure preshared keys with the isakmp key and associated commands. |
Step 4 |
Verify the IKE configuration with the show isakmp [policy] command. |
The following sections describe these steps in detail.
Step 1: Enable or Disable IKE
The first step in configuring IKE is to enable or disable IKE on interfaces used to terminate IPSec tunnels. You enable and disable IKE on individual interfaces by using the isakmp enable command. IKE is enabled by default, and you use the no form of the command to disable IKE. The command syntax is as follows:
isakmp enable interface-name
The command parameter has the following meaning:
Command Parameter |
Description |
interface-name |
Specifies the name of the interface on which to enable IKE negotiation |
Step 2: Create IKE Policies
The next major step in configuring PIX Firewall IKE support is to define a suite of IKE policies. The goal of defining a suite of IKE policies is to establish IKE peering between two IPSec endpoints. Use the IKE policy details gathered during the planning task.
Table 17-1 summarizes IKE policy details that are configured in examples in this chapter.
Table 17-1 IKE Policy Example for Peer PIX Firewalls
Parameter |
Peer A Value |
Peer B Value |
Message encryption algorithm |
DES |
DES |
Message integrity (hash) algorithm |
MD5 |
MD5 |
Peer authentication method |
Preshared key |
Preshared key |
Key exchange parameters (Diffie-Hellman group identifier) |
768-bit Diffie-Hellman group 1 |
768-bit Diffie-Hellman group 1 |
IKE-established security association's lifetime |
86,400 (default) |
86,400 (default) |
IP address of IPSec peer |
192.168.2.2 |
192.168.1.2 |
You use the isakmp policy command to define an IKE policy. IKE policies define a set of parameters to be used during the IKE negotiation. Use the no form of this command to delete an IKE policy. The command syntax is as follows:
isakmp policy priority authentication {pre-share | rsa-sig} isakmp policy priority encryption {des | 3des} isakmp policy priority {group1 | group2} isakmp policy priority hash {md5 | sha} isakmp policy priority lifetime seconds
The command parameters and syntax have the following meanings:
Command Parameter |
Description |
policy priority |
Uniquely identifies the IKE policy and assigns it a priority. Use an integer from 1 to 65,534, with 1 being the highest priority and 65,534 the lowest. |
authentication pre-share |
Specifies preshared keys as the authentication method. |
authentication rsa-sig |
Specifies RSA signatures as the authentication method. |
encryption des |
Specifies 56-bit DES-CBC as the encryption algorithm to be used in the IKE policy. This is the default value. |
encryption 3des |
Specifies that the Triple DES encryption algorithm is to be used in the IKE policy. |
group1 |
Specifies that the 768-bit Diffie-Hellman group is to be used in the IKE policy. This is the default value. |
group2 |
Specifies that the 1024-bit Diffie-Hellman group is to be used in the IKE policy. |
hash md5 |
Specifies MD5 (HMAC variant) as the hash algorithm to be used in the IKE policy. |
hash sha |
Specifies SHA-1 (HMAC variant) as the hash algorithm to be used in the IKE policy. This is the default hash algorithm. |
lifetime seconds |
Specifies how many seconds each security association should exist before expiring. Use an integer from 60 to 86,400 seconds (one day). You can usually leave this value at the default of 86,400. |
If you do not specify one of these commands for a policy, the default value is used for that parameter. You can reset a value to its default by using the no form of the command. For example, to reset to des the encryption method previously set to 3des, use the command no isakmp policy 100 encryption.
For more details on how IKE policies work, see the section "Internet Key Exchange" in Chapter 15, "Understanding Cisco IPSec Support."
IKE Configuration Example for Two Peers
Examples 17-1 and 17-2 show sample IKE policies for PIX 1 and PIX 2. Note that policy 300 on PIX 1 matches policy 100 on PIX 2. Default values are not shown.
Example 17-1 Sample IKE Policies for PIX 1
crypto isakmp policy 100 authentication rsa-sig crypto isakmp policy 200 authentication pre-share crypto isakmp policy 300 hash md5 authentication pre-share
Example 17-2 Sample IKE Policies for PIX 2
crypto isakmp policy 100 hash md5 authentication pre-share crypto isakmp policy 200 authentication rsa-sig group2 lifetime 5000 crypto isakmp policy 300 authentication rsa-sig lifetime 10000
Step 3: Configure Preshared Keys
The next major step in configuring PIX Firewall IKE support is to optionally set the identity mode and to configure the preshared keys, as discussed in the following sections.
Setting the Identity Mode
IPSec peers authenticate each other during IKE negotiations using the preshared key and the IKE identity. The identity can be either the peer's IP address or its host name. The PIX Firewall uses the IP address identity method by default. If you choose to use the host name identity method, you must specify the method with the isakmp identity configuration command. Use the no form of this command to reset the IKE identity to the default value (address). The command syntax is as follows:
isakmp identity {address | hostname}
The command parameters have the following meanings:
Command Parameter |
Description |
address |
Sets the IKE identity to the IP address of the interface that is used to communicate with the remote peer during IKE negotiations for preshared keys. This keyword is typically used when only one interface will be used by the peer for IKE negotiations and the IP address is known. |
hostname |
Sets the IKE identity to the host name concatenated with the domain name (for example, myhost.domain.com). This keyword should be used if more than one interface on the peer might be used for IKE negotiations or if the interface's IP address is unknown (such as with dynamically assigned IP addresses). |
If you use the host name identity method, you might need to specify the host name for the remote peer if a domain name server (DNS) is not available for name resolution using the name command. The command syntax is as follows:
name ip_address name
The command parameters and syntax have the following meanings:
Command Parameter |
Description |
ip_address |
Specifies the IP address of the host being named. |
name |
Specifies the name assigned to the IP address. Allowable characters are a to z, A to Z, 0 to 9, and the underscore. The name cannot start with a number. If the name is more than 16 characters long, the name command fails. |
Example 17-3 shows PIX 1 configuring a name for PIX 2.
Example 17-3 PIX 1 Configuring a Name for PIX 2
Pix1(config)# name PIX2.domain.com 192.168.2.2
Configuring Preshared Keys
You configure a preshared authentication key with the isakmp key configuration command. You must configure this key whenever you specify preshared keys in an IKE policy. Use the no form of this command to delete a preshared authentication key. The command syntax is as follows:
isakmp key keystring address peer-address [netmask mask] isakmp key keystring hostname peer-hostname
The command parameters and syntax have the following meanings:
Command Parameter |
Description |
keystring |
Specifies the preshared key. Use any combination of alphanumeric characters up to 128 bytes. This preshared key must be identical at both peers. |
address |
Specifies that the remote peer IKE identity was set with its IP address. |
peer-address |
Specifies the IP address of the remote peer. The address of 0.0.0.0 can be entered as a wildcard, indicating that the key could be used by any IPSec peer with a matching key. |
hostname |
Specifies that the remote IKE identity was set with its host name. |
peer-hostname |
Specifies the host name of the remote peer. This is the peer's host name concatenated with its domain name (for example, myhost.domain.com). |
netmask mask |
(Optional) Specifies the netmask. The netmask 0.0.0.0 can be entered as a wildcard along with an address of 0.0.0.0, indicating that the key could be used for any peer that does not have a key associated with its specific IP address. |
A wildcard peer address and netmask of 0.0.0.0 0.0.0.0 may be configured to share the preshared key among many peers. However, Cisco strongly recommends using a unique key for each peer.
NOTE
As with any IPSec peer using preshared keys, the same preshared key must be configured on each pair of IPSec peers when using preshared keys for IKE authentication. It is highly recommended that a different preshared key be configured on each pair of IPSec peers. Using the same preshared key for more than one pair of IPSec peers presents a security risk and is not recommended.
Step 4: Verify the IKE Configuration
You can use the show isakmp [policy] command to display configured and default policies. The resultant IKE policy for PIX 1 is shown in Example 17-4 (PIX 2's configuration is identical).
Example 17-4 IKE Policy for PIX 1
Pix1# show isakmp policy Protection suite of priority 100 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
The show isakmp command displays configured policies much as they would appear with the write terminal command, as shown in Example 17-5.
Example 17-5 Policies Configured with show isakmp
Pix1# show isakmp isakmp enable outside isakmp policy 100 authentication rsa-sig isakmp policy 100 encryption 3des isakmp policy 100 hash sha isakmp policy 100 group 1 isakmp policy 10 lifetime 86400
The write terminal command displays configured policies. Example 17-6 is a concatenated example.
Example 17-6 Policies Configured with write terminal
Pix1# write terminal hostname Pix1 isakmp enable outside isakmp key cisco1234 address 192.168.2.2 netmask 255.255.255.255 isakmp policy 100 authentication pre-share isakmp policy 100 encryption des isakmp policy 100 hash sha isakmp policy 100 group 1 isakmp policy 100 lifetime 86400
Here the preshared key is cisco1234, and the peer is PIX 2 at 192.168.2.2.