Firewalls and VPNs lab 7 of 16
MikroTik to pfSense IPsec then WireGuard between MikroTiks
Join a MikroTik shop router to a pfSense head office with IKEv2, including the pfSense bogon trap and MikroTik's NAT bypass, then link two MikroTik shops with WireGuard and compare a policy-based IPsec tunnel with a routed WireGuard one.
Run this lab
It needs Lite: its 5 nodes are set to 5 vCPU and 2,816 MB in total. That fits the free demo too.
In your workspace: Shared, then Firewalls and VPNs multi-vendor guided labs, then 07 - MikroTik to pfSense IPsec then WireGuard between MikroTiks
- Level
- Intermediate
- Time
- About 90 minutes
- Nodes need
- 5 vCPU, 2,816 MB
- Smallest plan
- Lite
The scenario
Dartmoor Outdoor runs pfSense at head office, because it is open source and the team knows it well, and small MikroTik routers in its shops, because they are cheap and capable. Shop 1 needs the stock system at HQ (10.1.0.0/24). Shop 2 opens next month and only needs to reach shop 1's click-and-collect server, so the shops get a quick WireGuard link between them.
| Device | Interface | Address | Notes |
|---|---|---|---|
| PF-HQ | em0 WAN / em1 LAN | 203.0.113.2/24, gateway 203.0.113.1 / 10.1.0.1/24 | You set both in Task 1 |
| ADMIN | eth0 | 10.1.0.10/24 | Gateway 10.1.0.1 |
| ISP | ether1 / ether2 / ether3 | 203.0.113.1 / 198.51.100.1 / 192.0.2.1 (/24 each) | |
| SHOP1 | ether1 / lan | 198.51.100.2/24 / 10.2.0.1/24 | Masquerade on ether1 |
| SHOP2 | ether1 / lan | 192.0.2.2/24 / 10.3.0.1/24 | Masquerade on ether1 |
| WireGuard | SHOP1 / SHOP2 wg-shops | 10.255.12.1/30 / 10.255.12.2/30 | UDP 13231 |
| IPsec setting (HQ to shop 1) | Value |
|---|---|
| Phase 1 | IKEv2, AES-256, SHA-256, DH group 19 (ECP-256), 28,800 s, peers identified by IP address |
| Authentication | Pre-shared key Dart-VPN-27 |
| Phase 2 | ESP AES-256 with SHA-256, PFS group 19, 3,600 s, 10.1.0.0/24 to and from 10.2.0.0/24 |
What you’ll practise
- Address a factory pfSense from its console and open its web interface from a LAN desktop
- Build an IKEv2 phase 1 and phase 2 on pfSense and the matching profile, proposal, peer, identity and policy on RouterOS
- Explain why pfSense's bogon block and RouterOS's masquerade both break a VPN, and fix each
- Read the tunnel on both ends: Status > IPsec or swanctl --list-sas, /ip ipsec active-peers and installed-sa
- Build a routed WireGuard tunnel between two RouterOS routers with keys, allowed addresses and routes
- Compare IPsec's negotiation with WireGuard's fixed cryptography
The tasks
- Bring PF-HQ onto the network
- IPsec on pfSense
- IPsec on SHOP1
- Read the tunnel on both ends
- WireGuard between the shops
The Lab Tasks pane has the scenario, these tasks, the checks to run, hints and the full solution.
Topology and devices
The network as it opens in EVE-NG, drawn from the lab’s own canvas, and the image each node runs.
Every link, as text
- PF-HQ
e0to ISPether1 - PF-HQ
e1to ADMINeth0 - ISP
ether2to SHOP1ether1 - ISP
ether3to SHOP2ether1
| Node | Device | Image in Add Node | Set to |
|---|---|---|---|
| PF-HQ | Netgate pfSense CE | pfsense-CE-2.5.2-RELEASE | 1 vCPU, 1,024 MB |
| ADMIN | EVE-NG GUI server (Docker) | eve-gui-server:latest | 1 vCPU, 1,024 MB |
| ISP | MikroTik RouterOS | mikrotik-7.14.2 | 1 vCPU, 256 MB |
| SHOP1 | MikroTik RouterOS | mikrotik-7.14.2 | 1 vCPU, 256 MB |
| SHOP2 | MikroTik RouterOS | mikrotik-7.14.2 | 1 vCPU, 256 MB |
How to open this lab
Sign in to your workspace at
lab.cloudlabbox.com.In File Manager, open Shared, then the folder
Firewalls and VPNs multi-vendor guided labs.Open
07 - MikroTik to pfSense IPsec then WireGuard between MikroTiksand start its nodes, then open Lab Tasks for the scenario and the steps.
The lab is read-only. You can start the nodes and configure the devices, but changes to the topology can’t be saved. To change it, rebuild it in your own folder.
More Firewalls and VPNs labs
Related labs in other courses
CloudLabBox is independent of Check Point, Cisco, CompTIA, Fortinet, Juniper Networks, MikroTik, Netgate and Palo Alto Networks. The lab follows exam topics and isn’t vendor training material; vendor names identify the exams and the images in the workspace.