19.5.6 Lab - Configure A Site-to-Site VPN
19.5.6 Lab - Configure A Site-to-Site VPN
19.5.6 Lab - Configure A Site-to-Site VPN
Addressing Table
Device Interface IP Address Subnet Mask Default Gateway Switch Port
R1
G0/0/0 10.1.1.1 255.255.255.252 N/A N/A
R2 G0/0/0 10.1.1.2 255.255.255.252 N/A N/A
R2
G0/0/1 10.2.2.2 255.255.255.252 N/A N/A
R3 G0/0/1 192.168.3.1 255.255.255.0 N/A S3 F0/5
R3
G0/0/0 10.2.2.1 255.255.255.252 N/A N/A
PC-A NIC 192.168.1.3 255.255.255.0 192.168.1.1 S1 F0/6
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
Objectives
Part 1: Configure Basic Device Settings
Configure hostnames, interface IP addresses, and access passwords.
Configure the OSPF dynamic routing protocol.
Part 2: Configure a Site-to-Site VPN Using Cisco IOS
Configure IPsec VPN settings on R1 and R3.
Verify site-to-site IPsec VPN configuration.
Test IPsec VPN operation.
Background / Scenario
VPNs can provide a secure method of transmitting data over a public network, such as the Internet. VPN
connections can 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 build and configure a multi-router network, use Cisco IOS to configure a site-to-site IPsec
VPN, and then test the VPN. The IPsec VPN tunnel is from R1 to R3 via R2. R2 acts as a pass-through and
has no knowledge of the VPN. IPsec provides secure transmission of sensitive information over unprotected
networks, such as the Internet. IPsec acts at the network layer and protecting and authenticating IP packets
between participating IPsec devices (peers), such as Cisco routers.
Note: The routers used with hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.6 (universalk9
image). The switches used in the labs are Cisco Catalyst 2960+ with Cisco IOS Release 15.2(7) (lanbasek9
image). Other routers, 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.
Refer to the Router Interface Summary Table at the end of the lab for the correct interface identifiers.
Note: Before you begin, ensure that the routers and the switches have been erased and have no startup
configurations.
Required Resources
3 Routers (Cisco 4221 with Cisco XE Release 16.9.6 universal image or comparable with a Security
Technology Package license)
2 Switches (Cisco 2960+ with Cisco IOS Release 15.2(7) lanbasek9 image or comparable)
2 PCs (Windows OS with a terminal emulation program, such as PuTTY or Tera Term installed)
Console cables to configure Cisco networking devices
Ethernet cables as shown in the topology
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
Step 4: Configure the OSPF routing protocol on R1, R2, and R3.
a. On R1, use the following commands:
R1(config)# router ospf 101
R1(config-router)# network 192.168.1.0 0.0.0.255 area 0
R1(config-router)# network 10.1.1.0 0.0.0.3 area 0
b. On R2, use the following commands:
R2(config)# router ospf 101
R2(config-router)# network 10.1.1.0 0.0.0.3 area 0
R2(config-router)# network 10.2.2.0 0.0.0.3 area 0
c. On R3, use the following commands:
R3(config)# router ospf 101
R3(config-router)# network 192.168.3.0 0.0.0.255 area 0
R3(config-router)# network 10.2.2.0 0.0.0.3 area 0
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
Step 10: Save the basic running configuration for all three routers.
Save the running configuration to the startup configuration from the privileged EXEC mode prompt on R1, R2,
and R3.
R1# copy running-config startup-config
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
IKE must be enabled for IPsec to function. IKE is enabled, by default, on IOS images with cryptographic
feature sets. If it is disabled, you can enable it with the crypto isakmp enable command. Use this
command to verify that the router IOS supports IKE and that it is enabled.
R1(config)# crypto isakmp enable
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
R1(config-isakmp)# end
b. Configure the same policy on R3.
R3(config)# crypto isakmp policy 10
R3(config-isakmp)# hash sha
R3(config-isakmp)# authentication pre-share
R3(config-isakmp)# group 24
R3(config-isakmp)# lifetime 3600
R3(config-isakmp)# encryption aes 256
R3(config-isakmp)# end
c. Verify the IKE policy with the show crypto isakmp policy command.
R1# show crypto isakmp policy
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
b. On R1 and R3, create a transform set with tag R1-R3 and use an ESP transform with an AES 256 cipher
with ESP and the SHA hash function. The transform sets must match on both ends of the VPN.
R1(config)# crypto ipsec transform-set 50 esp-aes 256 esp-sha-hmac
R1(cfg-crypto-trans)# exit
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
Question:
Does IPsec evaluate whether the access lists are mirrored as a requirement to negotiate its security
association?
Type your answers here.
b. Use the match address <access-list> command to specify which access list defines which traffic to
encrypt.
R1(config-crypto-map)# match address 101
c. To view the list of possible set commands that you can do with a crypto map, use the help function.
R1(config-crypto-map)# set ?
identity Identity restriction.
ip Interface Internet Protocol config commands
isakmp-profile Specify isakmp Profile
nat Set NAT translation
peer Allowed Encryption/Decryption peer.
pfs Specify pfs settings
reverse-route Reverse Route Injection.
security-association Security association parameters
transform-set Specify list of transform sets in priority order
d. Setting a peer IP or hostname is required. Set it to R3’s remote VPN endpoint interface using the
following command.
R1(config-crypto-map)# set peer 10.2.2.1
e. Use the set transform-set tag command to hard code the transform set to be used with this peer. Set the
perfect forwarding secrecy type using the set pfs type command, and modify the default IPsec security
association life time with the set security-association lifetime seconds seconds command.
R1(config-crypto-map)# set pfs group24
R1(config-crypto-map)# set transform-set R1-R3
R1(config-crypto-map)# set security-association lifetime seconds 900
R1(config-crypto-map)# exit
f. Create a mirrored matching crypto map on R3.
R3(config)# crypto map CMAP 10 ipsec-isakmp
R3(config-crypto-map)# match address 101
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
a. Use the show crypto map command to display the crypto maps that will be applied to the router.
R1# show crypto map
Crypto Map IPv4 "CMAP" 10 ipsec-isakmp
Peer = 10.2.2.1
Extended IP access list 101
access-list 101 permit ip 192.168.1.0 0.0.0.255 192.168.3.0 0.0.0.255
Current peer: 10.2.2.1
Security association lifetime: 4608000 kilobytes/900 seconds
Responder-Only (Y/N): N
PFS (Y/N): Y
DH group: group24
Mixed-mode : Disabled
Transform sets={
R1-R3: { esp-256-aes esp-sha-hmac } ,
}
Interfaces using crypto map CMAP:
GigabitEthernet0/0/0
Note: The output of these show commands does not change if interesting traffic goes across the
connection. You test various types of traffic in the next task.
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
interface: GigabitEthernet0/0/0
Crypto map tag: CMAP, local addr 10.1.1.1
inbound ah sas:
outbound ah sas:
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
Question:
Step 10: Generate some uninteresting test traffic and observe the results.
a. Ping from R1 to the R3 G0/0/0 interface IP address 10.2.2.1. These pings should be successful.
b. Issue the show crypto isakmp sa command.
c. Ping from R1 to the R3 G0/0/1 interface IP address 192.168.3.1. These pings should be successful.
d. Issue the show crypto isakmp sa command again.
Question:
f. Turn off debugging with the no debug ip ospf hello or undebug all command.
g. Re-issue the show crypto isakmp sa command.
Question:
Step 11: Generate some interesting test traffic and observe the results.
a. Use an extended ping from R1 to the R3 G0/1 interface IP address 192.168.3.1. Extended ping allows
you to control the source address of the packets. Respond as shown in the following example. Press
Enter to accept the defaults, except where a specific response is indicated.
Note: You can also ping from PC-A to PC-C to generate interesting traffic.
R1# ping 192.168.3.1 source 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:
Packet sent with a source address of 192.168.1.1
..!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 1/1/2 ms
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
interface: GigabitEthernet0/0/0
Crypto map tag: CMAP, local addr 10.1.1.1
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
inbound ah sas:
outbound ah sas:
What other types of traffic would result in an SA forming and tunnel establishment?
Type your answers here.
Reflection
Would traffic on the Gigabit Ethernet link between PC-A and the R1 G0/0 interface be encrypted by the site-
to-site IPsec VPN tunnel? Explain.
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.
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 15 www.netacad.com
Lab - Configure a Site-to-Site VPN
Note: ISR G2 devices have Gigabit Ethernet interfaces instead of Fast Ethernet Interfaces.
--------------------
Router R1 after Part 1
end of document
© 2015 - 2021 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 15 of 15 www.netacad.com