IPSec VPN LAB
IPSec VPN LAB
To help make this an easy-to-follow exercise, we have split it into two steps that are required to get
Our example setup is between two branches of a small company, these are Site 1 and Site 2. Both
the branch routers connect to the Internet and have a static IP Address assigned by their ISP as
Site 1 is configured with an internal network of 10.10.10.0/24, while Site 2 is configured with
network 20.20.20.0/24. The goal is to securely connect both LAN networks and allow full
IKE exists only to establish SAs (Security Association) for IPsec. Before it can do this, IKE must
R1(config-isakmp)# encr 3des
R1(config-isakmp)# hash md5
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 2
R1(config-isakmp)# lifetime 86400
86400 – Session key lifetime. Expressed in either kilobytes (after x-amount of traffic, change the
We should note that ISAKMP Phase 1 policy is defined globally. This means that if we have five
different remote sites and configured five different ISAKMP Phase 1 policies (one for each remote
router), when our router tries to negotiate a VPN tunnel with each site it will send all five policies and
Next we are going to define a pre shared key for authentication with our peer (R2 router) by using the
following command:
The peer’s pre shared key is set to firewallcx and its public IP Address is 1.1.1.2. Every time R1 tries
to establish a VPN tunnel with R2 (1.1.1.2), this pre shared key will be used.
Configure IPSec
To configure IPSec we need to setup the following in order:
Next step is to create an access-list and define the traffic we would like the router to pass through the
VPN tunnel. In this example, it would be traffic from one network to the other, 10.10.10.0/24 to
20.20.20.0/24. Access-lists that define VPN traffic are sometimes called crypto access-
Create IPSec Transform (ISAKMP Phase 2 policy)
Next step is to create the transform set used to protect our data. We’ve named this TS:
The Crypto map is the last step of our setup and connects the previously defined ISAKMP and IPSec
configuration together:
R1(config)# crypto map CMAP 10 ipsec-isakmp
R1(config-crypto-map)# set transform-set TS
We’ve named our crypto map CMAP. The ipsec-isakmp tag tells the router that this crypto map is an
IPsec crypto map. Although there is only one peer declared in this crypto map (1.1.1.2), it is possible
The final step is to apply the crypto map to the outgoing interface of the router. Here, the outgoing
R1(config)# interface FastEthernet0/1
Note that you can assign only one crypto map to an interface.
As soon as we apply crypto map on the interface, we receive a message from the router that confirms
At this point, we have completed the IPSec VPN configuration on the Site 1 router.
We now move to the Site 2 router to complete the VPN configuration. The settings for Router 2 are
identical, with the only difference being the peer IP Addresses and access lists:
R2(config-isakmp)# encr 3des
R2(config-isakmp)# hash md5
R2(config-isakmp)# authentication pre-share
R2(config-isakmp)# group 2
R2(config-isakmp)# lifetime 86400
R2(config-crypto-map)# set transform-set TS
R2(config)# interface FastEthernet0/1
Network Address Translation (NAT) and IPSec VPN Tunnels
Network Address Translation (NAT) is most likely to be configured to provide Internet access to
internal hosts. When configuring a Site-to-Site VPN tunnel, it is imperative to instruct the router not
This is easily done by inserting a deny statement at the beginning of the NAT access lists as shown
below:
Bringing Up and Verifying the VPN Tunnel
At this point, we’ve completed our configuration and the VPN Tunnel is ready to be brought up. To
initiate the VPN Tunnel, we need to force one packet to traverse the VPN and this can be achieved by
.!!!!
The first ping received a timeout, but the rest received a reply, as expected. The time required to
bring up the VPN Tunnel is sometimes slightly more than 2 seconds, causing the first ping to timeout.
To verify the VPN Tunnel, use the show crypto session command:
Interface: FastEthernet0/1
Session status: UP-ACTIVE