Lab - Implement Site To Site Ipsec Vpns
Lab - Implement Site To Site Ipsec Vpns
Topology
Addressing Table
Device Interface IPv4 Address Default Gateway
R1
G0/0/1 10.10.0.1/29
R2 G0/0/0 64.100.0.1/30 N/A
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
N/A
R2
G0/0/1 64.100.1.1/30
N/A
R2
Lo0 209.165.200.225
R3 G0/0/0 64.100.1.2/30 N/A
N/A
R3
G0/0/1 10.10.4.1/30
D1 G1/0/11 10.10.0.2/29 N/A
N/A
D1
G1/0/23 10.10.1.1/24
N/A
D1
Lo2 10.10.2.1/24
N/A
D1
Lo3 10.10.3.1/24
D3 G1/0/11 10.10.0.3/29 N/A
N/A
D3
G1/0/23 10.10.5.1/24
N/A
D3
Lo16 10.10.16.1/24
N/A
D3
Lo17 10.10.17.1/24
N/A
D3
Lo18 10.10.18.1/24
N/A
D3
Lo19 10.10.19.1/24
N/A
D3
Lo20 10.10.20.1/24
N/A
D3
Lo21 10.10.21.1/24
N/A
D3
Lo22 10.10.22.1/24
N/A
D3
Lo23 10.10.23.1/24
PC1 NIC 10.10.1.10/24 10.10.1.1
PC3 NIC 10.10.5.10/24 10.10.5.1
Objectives
Part 1: Build the Network, Configure Basic Device Settings and Static Routing
Part 2: Configure a Site-to-Site VPN using Crypto Maps Between R1 and R3
Part 3: Verify a Site-to-Site VPN Between R1 and R3
Background / Scenario
VPNs provide a secure method of transmitting data over a public network, such as the internet. VPN
connections help reduce the costs associated with leased lines. Site-to-site VPNs typically provide a secure
(IPsec or other) tunnel between a branch office and a central office. Another common implementation of VPN
technology is remote access to a corporate office from a telecommuter location, such as a small office or
home office.
In this lab, you will establish a site-to-site IPsec VPN tunnel between R1 to R3 via R2. R2 is the ISP router,
and it will have no knowledge of the VPN. IPsec provides secure transmission of sensitive information over
unprotected networks, such as the internet. IPsec works at the network layer and protects and authenticates
IP packets between participating IPsec devices (peers), such as Cisco routers.
Note: This lab is an exercise in developing, deploying, and verifying how VPNs operate and does not reflect
networking best practices.
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
Note: The routers used with this CCNP hands-on lab are three Cisco 4221 and the two Layer 3 switches are
Catalyst 3650 switches. Other routers and Layer 3 switches and Cisco IOS versions can be used. Depending
on the model and Cisco IOS version, the commands available and the output produced might vary from what
is shown in the labs.
Note: Ensure that the routers and switches have been erased and have no startup configurations. If you are
unsure contact your instructor.
Required Resources
• 3 Routers (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
• 2 Switches (Cisco 4221 with Cisco IOS XE Release 16.9.4 universal image or comparable)
• 2 PCs (Choice of operating system with a terminal emulation program installed)
• Console cables to configure the Cisco IOS devices via the console ports
• Ethernet cables as shown in the topology
Instructions
Part 1: Build the Network, Configure Basic Device Settings and Static Routing
In Part 1, you will set up the network topology, configure basic settings, interface addressing, and single-area
OSPFv2 on the routers.
hostname R1
no ip domain lookup
line con 0
logging sync
exec-time 0 0
exit
banner motd # This is R1, Implement IPsec Site-to-Site VPNs #
interface g0/0/0
description Connection to R2
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
line con 0
logging sync
exec-time 0 0
exit
banner motd # This is R3, Implement IPsec Site-to-Site VPNs #
interface g0/0/0
description Connection to R2
ip add 64.100.1.2 255.255.255.252
no shut
exit
interface GigabitEthernet0/0/1
description Connection to D3
ip address 10.10.4.1 255.255.255.252
no shut
exit
ip route 0.0.0.0 0.0.0.0 64.100.1.1
router ospf 123
router-id 3.3.3.1
auto-cost reference-bandwidth 1000
network 10.10.4.0 0.0.0.3 area 0
default-information originate
exit
Switch D1
hostname D1
no ip domain lookup
line con 0
exec-timeout 0 0
logging synchronous
exit
banner motd # This is D1, Implement IPsec Site-to-Site VPNs #
interface G1/0/11
description Connection to R1
no switchport
ip address 10.10.0.2 255.255.255.252
no shut
exit
interface G1/0/23
description Connection to PC1
no switchport
ip address 10.10.1.1 255.255.255.0
no shut
exit
int Lo2
description Loopback to simulate an OSPF network
ip add 10.10.2.1 255.255.255.0
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
exit
int Lo18
description Loopback to simulate an OSPF network
ip add 10.10.18.1 255.255.255.0
ip ospf network point-to-point
exit
int Lo19
description Loopback to simulate an OSPF network
ip add 10.10.19.1 255.255.255.0
ip ospf network point-to-point
exit
int Lo20
description Loopback to simulate an OSPF network
ip add 10.10.20.1 255.255.255.0
ip ospf network point-to-point
exit
int Lo21
description Loopback to simulate an OSPF network
ip add 10.10.21.1 255.255.255.0
ip ospf network point-to-point
exit
int Lo22
description Loopback to simulate an OSPF network
ip add 10.10.22.1 255.255.255.0
ip ospf network point-to-point
exit
int Lo23
description Loopback to simulate an OSPF network
ip add 10.10.23.1 255.255.255.0
ip ospf network point-to-point
exit
ip routing
router ospf 123
router-id 3.3.3.2
auto-cost reference-bandwidth 1000
network 10.10.4.0 0.0.1.255 area 0
network 10.10.16.0 0.0.7.255 area 0
exit
int range G1/0/1 - 10, G1/0/12 - 22, G1/0/24
shut
exit
b. Save the running configuration to startup-config.
Close configuration window
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
The routing table confirms that R1 has knowledge of the networks connected to D1. Notice however, that
R1 has no knowledge of the routes connected to the R3 OSPF domain. The reason why PC1 can still
reach PC3 is because R1 has a default static route to R2. R1 forwarded the traffic to R2 because it did
not know where the 10.10.5.0 network was. R2 has a static route to this network and therefore forwarded
it to R3.
Close configuration window
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
<Output omitted>
These are default policies that are available if no custom ISAKMP policy is configured. The policies are
listed in order of priority with policy 65507 providing the most secure settings and policy 65514 offering
the least secure.
Default policies may not provide the required settings for your VPNs. And although default policies exist, it
is recommended that you define specific custom policies.
b. To create a custom ISAKMP policy, enter ISAKMP configuration mode using the crypto isakmp policy
number global configuration mode command. The policy number uniquely identifies the IKE policy and
assigns a priority to the policy, where 1 is the highest priority.
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
The output highlights the default parameters automatically assigned to the new policy. For security
reason, most of these should be updated to the recommended minimum listed in the table.
Your choice of an encryption algorithm determines how confidential the control channel between the
endpoints is. The hash algorithm controls data integrity, ensuring that the data received from a peer has
not been tampered with in transit. The authentication type ensures that the packet was sent and signed
by the remote peer. The Diffie-Hellman group is used to create a secret key shared by the peers that has
not been sent across the network.
e. In this lab, we will use the following parameters for the ISAKMP policy 10 on R1 and R3:
o Encryption: aes 256
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
o Hash: sha256
o Authentication method: pre-share key
o Diffie-Hellman group: 14
o Lifetime: 3600 seconds (60 minutes / 1 hour)
Note: Older versions of Cisco IOS do not support AES 256 encryption and SHA as a hash algorithm.
Substitute whatever encryption and hashing algorithm your router supports. Ensure that the same
changes are made on R3 in order to be in sync.
R1(config-isakmp)# encryption aes 256
R1(config-isakmp)# hash sha256
R1(config-isakmp)# authentication pre-share
R1(config-isakmp)# group 14
R1(config-isakmp)# lifetime 3600
R1(config-isakmp)# exit
close configuration window
f.
Open configuration window
Configure the same policy on R3.
R3(config)# crypto isakmp policy 10
R3(config-isakmp)# encryption aes 256
R3(config-isakmp)# hash sha256
R3(config-isakmp)# authentication pre-share
R3(config-isakmp)# group 14
R3(config-isakmp)# lifetime 3600
close configuration window
g. Verify the IKE policy with the show crypto isakmp policy command on R1 and R3.
Open configuration window
The policies must match. Troubleshoot and verify that the configurations were done correctly on both
routers.
close configuration window
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
Which IP addresses should you use to configure the IKE peers, given the topology diagram and IP
addressing table?
Type your answer here.
a. Each IP address that is used to configure the IKE peers is also referred to as the IP address of the
remote VPN endpoint. Configure the pre-shared key of cisco123 on R1. This command points to the
remote peer R3 G0/0/0 IP address.
Open configuration window
Note: Production networks should use longer and more complex keys.
R1(config)# crypto isakmp key cisco123 address 64.100.1.2
close configuration window
b. Configure the pre-shared key cisco123 on router R3. The command for R3 points to the R1 G0/0/0 IP
address.
Open configuration window
Step 3: On R1 and R3, configure the IPsec transform set and lifetime.
The IPsec transform set is another crypto configuration parameter that routers negotiate to form a security
association. To create an IPsec transform set, use the crypto ipsec transform-set transform-set-name
transform1 [transform2 [transform3]] command.
a. On R1 and R3, create a transform set with the name S2S-VPN and use ? to see which parameters are
available.
Open configuration window
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
c. You can also change the IPsec security association lifetime from the default of 3600 seconds. On R1 and
R3, set the IPsec security association lifetime to 30 minutes, or 1800 seconds.
Open configuration window
b. Configure the IPsec VPN interesting traffic named extended ACL on R1.
R3(config)# ip access extended S2S-VPN-ACL
R3(config-ext-nacl)# remark ACL identifies interesting traffic going to R1
R3(config-ext-nacl)# permit ip 10.10.4.0 0.0.3.255 10.10.0.0 0.0.3.255
R3(config-ext-nacl)# permit ip 10.10.16.0 0.0.7.255 10.10.0.0 0.0.3.255
R3(config-ext-nacl)# exit
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
Does IPsec evaluate whether the access lists are mirrored as a requirement to negotiate its security
association?
Type your answers here
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 15 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
Note: The output of these show commands does not change when the VPN tunnel is enabled.
close configuration window
interface: GigabitEthernet0/0/0
Crypto map tag: S2S-CMAP, local addr 64.100.0.2
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 16 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
inbound ah sas:
outbound ah sas:
Note: The output lists the current status for each ACE in the S2S-VPN-ACL.
Question:
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 17 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
c. Next, we will generate some “uninteresting” test traffic and observe the results. From R1, ping the R3
G0/0/0 interface IP address (i.e., 64.100.1.2) and then ping the R3 G0/0/1 interface IP address (i.e.,
10.10.4.1). These pings should be successful.
d. Issue the show crypto isakmp sa command again.
Question:
Step 3: Generate some interesting test traffic and observe the results.
A VPN is initiated when interesting traffic is generated. Typically, inside users connecting to the remote
network can initiate a VPN connection.
a. From PC1, ping PC3 to generate interesting traffic.
PC1> ping 10.10.5.10
Notice how the first ping reply timed out. The reason is because, the first echo request triggered the S2S-
VPN-ACL which made R1 negotiate and establish the IPsec VPN tunnel with R3.
b. An alternate method to initiate interesting traffic would be to use an extended ping on R1. An extended
ping allows you to control the source address of the packets.
R1# ping 10.10.16.1 source g0/0/1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.16.1, timeout is 2 seconds:
Packet sent with a source address of 10.10.0.1
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 2/3/4 ms
Like the previous ping, the first echo reply timed out. The reason was to establish an SA for the
10.10.16.0/23 networks.
c. Re-issue the show crypto isakmp sa command.
Open configuration window
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 18 of 19 www.netacad.com
Lab - Implement IPsec Site-to-Site VPNs
Question:
c. Verify the IPsec traffic statistics using the show crypto ipsec sa command.
Question:
What other types of traffic would result in an SA forming and tunnel establishment?
Type your answers here.
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many
interfaces the router has. There is no way to effectively list all the combinations of configurations for each router
class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device.
The table does not include any other type of interface, even though a specific router may contain one. An
example of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be
used in Cisco IOS commands to represent the interface.
End of document
© 2020 - 2020 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 19 of 19 www.netacad.com