Site-to-Site VPN Configuration Lab: Connecting Remote Sites With Secure Ipsec VPN
Site-to-Site VPN Configuration Lab: Connecting Remote Sites With Secure Ipsec VPN
Site-to-Site VPN
Configuration Lab
Connecting Remote Sites with Secure
IPSec VPN
Table of Contents
Introduction .................................................................................................................................2
Network Topology Overview ......................................................................................................2
Network Components Overview ............................................................................................2
Site-to-Site VPN Overview ............................................................................................................4
Network Setup .............................................................................................................................5
Switch Configuration ................................................................................................................5
Switch-A ...............................................................................................................................5
Switch-B ...............................................................................................................................6
Firewall Configuration ..............................................................................................................6
Site A Firewall Configuration..................................................................................................6
Site B Firewall Configuration ............................................................................................... 20
Router Configuration .............................................................................................................. 20
Assigning IP Addresses to Interfaces.................................................................................... 21
Configure Routing ............................................................................................................... 21
Configure NAT .................................................................................................................... 21
Verify Configuration ............................................................................................................ 22
Test connectivity ................................................................................................................. 22
IPSec Site-to-Site VPN Setup ...................................................................................................... 23
Firewall Configuration ............................................................................................................ 23
Set up A VPN Tunnel Interface ............................................................................................. 23
Configure Static Routes for VPN Tunnel ............................................................................... 25
Configure Cryptographic Profiles ......................................................................................... 28
Configure IKE Gateway ........................................................................................................ 29
Set up the IPSec Tunnel ....................................................................................................... 32
Create Security Policy Rules to Allow VPN Tunnel Traffic ...................................................... 34
Test Connectivity .................................................................................................................... 36
Troubleshooting IPSec Tunnel Connectivity ............................................................................. 37
Introduction
This lab will guide you through setting up the network infrastructure, configuring firewalls,
routers, and switches, and testing VPN connectivity between two sites. Refer to the topology
below:
Firewall(A) - Site A
WAN Interface (eth1/1): Connected to Gateway A (192.168.10.1/30).
Sub-interfaces:
Firewall(B) - Site B
WAN Interface (eth1/1): Connected to Gateway B (192.168.20.1/30).
Sub-interfaces:
Switch A (Site A)
• Port e0/0 → Connected to Firewall A (eth1/2), acting as a trunk.
Switch B (Site B)
• Port e0/0 → Connected to Firewall B (eth1/2), acting as a trunk.
End-User Devices
Each site has two end-user devices representing Accounts (VLAN 10) and HR (VLAN 20) users.
Site A
• accounts-1 (PC in VLAN 10) → IP: 172.20.10.2/24
Site B
• accounts-2 (PC in VLAN 10) → IP: 172.30.10.2/24
• Accounts (VLAN 10) in Site A to securely communicate with Accounts (VLAN 10) in Site B.
Note:
• This lab we will not create an isolation i.e hr-1 to hr-2 only communication, rather,
ACCOUNTS and HR subnets on both sides can communicate. You can do that once you get
hang of the lab.
• For this lab, we shall ONLY limit scope to Site-to-Site VPN using Static routes.
Network Setup
Under this section, we shall first begin with the network setup. We shall use a bottom-up approach
in which we begin with lower layer configuration as we work up the topology.
Switch Configuration
The purpose of the switches is to allow VLAN segmentation and connect each host to the correct
VLAN. By the end of this section, we shall complete the objectives:
➢ Configure VLANS.
➢ VLAN assignment.
➢ Configure trunks on switches.
➢ Configure the SVIs on switches for connectivity test ( we shall cover this after doing the
firewall configuration)
Switch-A
Configure the VLANS:
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name ACCOUNTS
Switch(config-vlan)#exit
Switch(config)#vlan 20
Switch(config-vlan)#name HR
Switch(config-vlan)#exit
Switch(config)#vlan 30
Switch(config-vlan)#name MGMT
Switch(config-vlan)#exit
Configure trunking for firewall connection. It is important to do the trunking to allow the vlans
(10,20 and 30) to pass through to the firewalls. This will allow the devices in those subnets to
access the DHCP server which are the sub-interfaces we will create on the firewall.
Switch(config)#interface eth0/0
Switch(config-if)#switchport mode trunk
Command rejected: An interface whose trunk encapsulation is "Auto" can not be
configured to "trunk" mode.
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport mode trunk
Switch(config-if)#switchport trunk allowed vlan 10,20,30
Switch(config-if)#exit
Switch(config)# wr
switchport trunk encapsulation dot1q explicitly sets the trunk encapsulation type to
802.1Q, allowing the interface to be manually configured as a trunk. By default, some switches
(especially older Cisco models) have trunk encapsulation set to "Auto", which prevents them from
being manually set to trunk mode until an encapsulation type (such as dot1q) is specified.
Switch-B
Follow the same steps to configure the Switch-B, the switch site B. Do keep note of the addressing
scheme when doing this. Ensure that you save the configurations to memory when done.
Firewall Configuration
The Palo Alto Firewalls will:
This section focuses on the networking bits (of course we are network security engineers, we have
do know this). By the end of this section, we shall complete the following objectives:
➢ Configure interfaces.
➢ Configure zones.
➢ Configure routing through virtual routers.
➢ Configure DHCP Services on the firewalls.
➢ Configure NAT policies.
➢ Configure Security Policies.
➢ Define objects.
➢ Configure management profiles.
• https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.yo
utube.com/watch%3Fv%3D7Q-
fS7uZDhQ%26pp%3DygULI21hZ3V5b3NwYW4%253D&ved=2ahUKEwjc7dinsJuLAxWc8LsI
HQG3HWIQwqsBegQIDBAF&usg=AOvVaw0iRMF8buhbg8gyG2vpBHRX
• https://docs.paloaltonetworks.com/pan-os/11-1/pan-os-admin/getting-started/integrate-
the-firewall-into-your-management-network/perform-initial-configuration
3. Click on ethernet1/1.
4. A modal window pops up to configure the interface.
5. Set the interface type to Layer 3. This is to allow layer 3 communication (IP Addressing).
6. Under virtual router drop down field select New Virtual Router.
a. For now, just define the name. In my case, it is jacabian-lab-vrouter. You can use
any name you prefer for this step. See below screenshot.
7. Click the Security Zone drop down and select New Zone to create a new zone.
a. Name the zone you just created as “untrust”. For now, we shall not configure Zone
Protection Profiles so leave it as is. Click Ok. See below screenshot.
You will note that the Types field is greyed out. This was implied when you selected the interface
type as Layer 3 in the Ethernet configuration. In Palo, each interface MUST have a corresponding
zone type i.e. Layer 3 zone can only associate Layer 3 interface. Also, A zone can have multiple
interfaces, but an interface can ONLY belong to one single zone.
8. You will be directed back to the Ethernet Interface window. Click on the IPv4 tab to set the
IP address of the interface.
a. Set the Type field to Static. We will be using static IP address for the WAN
connection.
b. Under the IP section, click Add at the bottom of the box. Under this section:
i. You can manually type the IP address and once done click anywhere
outside of the field to save.
ii. Or you can click the New Address to create an address object. I prefer this
method because it allows me to reuse the address object and making
changes to be easier should I need to change this value.
c. Configure objects as follows:
i. Name: Firewall-IP
ii. Description: (Optional)
iii. Type: IP Netmask with value as: 192.168.10.1/30.
iv. Press OK to confirm. You have just created an address object. You can find
the Objects under the Objects tab.
9. Once done, click on the Advanced tab. Under Other Info tab, click on Management Profile
drop down and select New Management Profile. We will create a management profile to
help us test connectivity in the next sections. Configure it as below:
a. Name: Ping-only
b. Leave Administrative Management Services unchecked.
c. Check Ping under the Network Services.
d. Click Ok to save.
10. Now Click Ok to save the interface configurations. You will be directed back to the
Interface screen.
Note that at this point, you have configured the WAN interface (public-facing interface). We
proceed to configure the sub-interface.
i. Type: Static
ii. IP: Create an Address Object and name it Gateway-accounts.
iii. The IP configurations are : IP Netmask; 172.20.10.1/24
c. Configure the Advanced tab as follows:
i. Other Info > Management Profile: Ping-Only. You will note that the
Management Profile you created will be listed (the beauty of objects).
d. Repeat the same for the other two subinterfaces:
Sub-interface Tag Virtual Router Security Zone IPv4 Management
Profile
Ethernet1/2.20 20 jacobian-lab- hr Static Ping-only
vrouter Gateway-hr:
172.20.20.1/24
Ethernet1/2.30 30 jacobian-lab- management Static Ping-only
vrouter Gateway-
mgmt:
172.20.30.1/24
e. Once done, commit all your changes.
i. Click the Commit button at the top right corner of the dashboard.
ii. Click ok at the Commit button at the bottom of the Modal window.
iii. A successful message will be shown.
f. Confirm that you have something like this:
You will note that Link State is green. This means that the interface is up(connected).
2. Ensure that all the interfaces you configured are on the list under the General tabs as
shown above. If not, then add them all one by one. Ignore the tunnel interface for now. We
shall get to that later.
3. Click On Static Routes. We are about to configure Static Routes to untrust zone. This is a
step in getting connected to the external networks.
Note that the 0.0.0.0/0 netmask matches all IP addresses NOT in the Routing tables. Thus, any IP
address not defined (typically outbound traffic) will match this. The interface is ethernet1/1, the
public facing interface. The next hop is ISP-IP which is an address object I created. You can create
this at this step. The Object configuration are as follows:
• Name: ISP-IP
• IP Netmask: 192.168.10.2/30
5. Click Ok.
6. Click Ok again to Confirm the settings.
7. Commit these changes.
You have successfully configured routing on the firewall. In the next section we shall configure
DHCP Servers.
For your practice, do the same for the MANAGEMENT VLAN. Follow the same steps. Be sure to
use the correct IP Pool Configurations and Gateway IP Address.
1. https://www.youtube.com/watch?v=Ahrao6kBg8w
2. https://www.youtube.com/watch?v=pyCv_39_OQQ
3. https://www.youtube.com/watch?v=o2MQjV_KSuo
Configure NAT
1. Under the Policies tab, click on the NAT node.
2. Click Add. Configure them as below:
At this point you can test if indeed our configurations hold. To confirm this, double click on of the
VPCs found on site A.
Router Configuration
The Router will perform the following functions:
Configure Routing
1.Configure the default route to dynamically use the next hop provided by DHCP using interface
Gi0/2 as the next hop:
ip route 0.0.0.0 0.0.0.0 gigabitEthernet0/2
Configure NAT
1.Enable NAT with dynamic overload:
ip nat inside source list 1 interface gigabitEthernet0/2 overload
Verify Configuration
Check DHCP-assigned IP on Gi0/2:
show ip interface brief
Test connectivity
Test internet connectivity by pinging a public IP.
ping 8.8.8.8
In order to set up the VPN tunnel we shall use the checklist below.
Make sure that your Ethernet interfaces, virtual routers, and zones are configured
properly.
Create your Tunnel interfaces. Ideally, put the tunnel interfaces in a separate zone, so that
tunneled traffic can use different policy rules.
Set up Static Routes or assign routing protocols to redirect traffic to the VPN tunnels. To
support dynamic routing (OSPF, BGP, RIP are supported), you must assign an IP address to
the tunnel interface.
Define the Cryptographic profiles (IKE Crypto Profiles and IPSEC Crypto Profiles) that
specify the protocols and algorithms for identification, authentication, and encryption to be
used for setting up VPN tunnels in IKEv1 Phase 1 and Phase 2.
Define IKE Gateways for establishing communication between the peers across each end
of the VPN tunnel.
Define IPSec Tunnel Configurations
(Optional) Specify how the firewall will monitor the IPSec tunnels.
Define Security Policies to filter and inspect the traffic.
3. On the Config tab, expand the Security Zone to define the zone as follows:
• To create a separate zone for VPN tunnel termination, click New Zone. In the Zone dialog,
define a Name for a new zone (Name it vpn-zone), and then click OK.
Assign an IP address to the tunnel interface, select the IPv4 or IPv6 tab, click Add in the IP section,
and enter the IP address and network mask to assign to the interface. With static routes, the tunnel
interface doesn’t require an IP address. For traffic that is destined to a specified subnet/IP address,
the tunnel interface will automatically become the next hop. Consider adding an IP address if you
want to enable tunnel monitoring.
• Interface—tunnel.10
• Security Zone—vpn-zone
• Interface—tunnel.11
For Site A:
For Site B:
2. Select Static Route, click Add, and enter a new route to access the subnet that is at the other
end of the tunnel. You will need to add two route entries for each subnet.
• Name — vpn-to-siteB-accounts
• Interface—tunnel.10
• Name — vpn-to-siteB-hr
• Interface—tunnel.10
• Name — vpn-to-siteA-accounts
• Interface—tunnel.11
• Name — vpn-to-siteA-hr
• Interface—tunnel.11
2. Click Add.
2. Click Add.
• Interface—ethernet1/1
• Local identification—None; this means that the local IP address will be used as the local
identification value.
• Interface—ethernet1/1
• Local identification—None; this means that the local IP address will be used as the local
identification value.
3. Select Advanced Phase 1 Options and select the IKE Crypto profile you created earlier to use for
IKE phase 1.
• Tunnel Interface—tunnel.10
• Type—Auto Key
• Tunnel Interface—tunnel.11
• Type—Auto Key
At this point the tunnel configurations are complete. However, the IPSec Tunnel status would still
indicate in red color. To conclude we need to allow traffic between the zones.
• untrust zone
• accounts zone
• hr zone and
• vpn-zone zone
By default, the interzone policy denies any traffic from one zone to another. To allow VPN traffic
from the users zones( in hr and accounts) to remote sites, we will have to allow traffic from users
zones to the vpn-zone and from vpn-zone to the untrust where the outside facing ethernet1/1
interface is. The return traffic should also be allowed.When we all bring this together, the
configurations are as follows:
• Name: allow-vpn-to-site-B
• Source: untrust, vpn-zone (to allow traffic return)
• Destination: untrust, vpn-zone (to allow traffic return)
• Application: Any
• Service/URL Category: application-default
• Actions: Allow
• Name: allow-users-to-vpn-zone
• Source: accounts, hr, vpn-zone ( to allow traffic return)
• Destination: accounts, hr, vpn-zone (to allow traffic return)
• Application: Any
• Service/URL Category: application-default
• Actions: Allow
• Name: allow-vpn-to-site-A
• Source: untrust, vpn-zone (to allow traffic return)
• Destination: untrust, vpn-zone (to allow traffic return)
• Application: Any
• Service/URL Category: application-default
• Actions: Allow
• Name: allow-users-to-vpn-zone
• Source: accounts, hr, vpn-zone ( to allow traffic return)
• Destination: accounts, hr, vpn-zone (to allow traffic return)
• Application: Any
• Service/URL Category: application-default
• Actions: Allow
For Site A
For Site B:
Test Connectivity
To test the end-to-end connectivity, double click one of the endpoint machine in one of the Site A.
Ping one of the end hosts in Site B. Refer to the screenshot below:
From the screenshot, you can see that I am able to ping the remote hr-2 host. This shows that the
tunnel is up. Try Pinging hr-1 from hr-2.
To further confirm this, navigate to the Network>IPSec Tunnel node to confirm this. You should see
something identical to this from both firewalls.
Refer to the links below for what may be the cause of the issue:
1. https://docs.paloaltonetworks.com/network-security/ipsec-
vpn/administration/troubleshooting/test-vpn-connectivity
2. https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA14u000000wlFxCAI
&lang=en_US%E2%80%A9
3. https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000Clh5CAC
4. https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000ClivCAC
-------------------THE END------------------