Build and test two VPNs

Configure an IPsec site-to-site tunnel between two company offices, then a WireGuard point-to-point link from a home office. Network+ and Security+ aligned.

Lab progress0 of 23 tasks

What a network administrator needs to know about VPNs

A VPN carries private traffic across a network you don't control. The administrator's job runs the full life cycle: plan it, configure it, prove it works, and keep it working. Read this briefing, then complete Parts A and B.

Site-to-site

Two gateways (routers or firewalls) protect whole networks. Users never run VPN software. Part A builds this with IPsec in tunnel mode.

Point-to-point

A one-to-one tunnel between exactly two endpoints, such as a home-office laptop and an office server. Part B builds this with WireGuard.

Remote access

Many individual users connect to one concentrator with a client app (IKEv2, SSL/TLS, OpenVPN). Covered in this briefing and the knowledge check.

Knowledge an administrator needs

Concepts

  • VPN topologies: site-to-site, remote access (client-to-site), point-to-point (host-to-host), hub-and-spoke, full mesh, and dynamic multipoint (DMVPN).
  • Tunnel vs transport mode: tunnel mode wraps the entire original packet in a new IP header (gateway to gateway). Transport mode protects only the payload and keeps the original header (host to host, or GRE over IPsec).
  • Cryptography basics: symmetric ciphers (AES-GCM, AES-CBC, ChaCha20), integrity (HMAC-SHA-256/384), key exchange (Diffie-Hellman groups 14, 19, 20, 21), authentication (pre-shared keys vs. certificates/PKI).
  • IPsec architecture: IKE phase 1 (IKE SA, management channel) and phase 2 (IPsec/child SAs that carry data), security parameter index (SPI), lifetimes and rekeying, perfect forward secrecy (PFS).
  • Policy-based vs route-based VPNs: crypto ACLs ("interesting traffic") vs. virtual tunnel interfaces (VTI) with routing.
  • Split vs full tunneling and their security and bandwidth trade-offs.

Supporting network knowledge

  • IP addressing: non-overlapping private subnets at every site, wildcard masks, CIDR.
  • NAT and NAT traversal: NAT exemption for VPN traffic, NAT-T over UDP 4500, why AH breaks behind NAT.
  • Firewalls and ports: UDP 500/4500, ESP (IP 50), WireGuard UDP 51820, TLS 443.
  • MTU and MSS: encryption overhead (50 to 80 bytes) causes fragmentation; adjust TCP MSS to around 1360.
  • Identity: AAA, RADIUS (UDP 1812/1813), LDAP/Active Directory, SAML, multifactor authentication.
  • Supporting services: DNS (split DNS for internal names), NTP (certificate validation and log timestamps), syslog/SIEM.
Skills an administrator must demonstrate

Plan

  • Gather requirements: who connects, to what, how many users, required throughput and uptime.
  • Choose the VPN type, protocol, and crypto suite that meet security policy and device support.
  • Design addressing, routing, and which traffic is protected (split or full tunnel).
  • Plan authentication, key and certificate management, and firewall/NAT changes.

Configure

  • Build IKE/IPsec policies, keys, transform sets, crypto ACLs or tunnel interfaces from the CLI.
  • Configure VPN on SOHO routers and firewalls through a web GUI.
  • Generate and distribute keys (WireGuard), certificates (PKI), and client profiles.
  • Open the right firewall ports and create NAT exemptions.

Test and troubleshoot

  • Verify underlay reachability first, then the tunnel.
  • Read SA tables (show crypto isakmp sa, wg show) and packet counters.
  • Use debugs and packet captures to isolate phase 1, phase 2, routing, or firewall problems.

Maintain

  • Rotate keys and renew certificates before expiration.
  • Patch VPN firmware promptly; VPN gateways are a top target for attackers.
  • Monitor tunnel state, logs, capacity, and failed logins; review access regularly.
  • Document configurations, addressing, and change history.
SOHO vs. enterprise: what changes
AreaSmall office/home office (SOHO)Enterprise
Typical useA few remote workers, one small branch, or a home lab linked to the cloudMany branches, thousands of remote users, partner (extranet) links, cloud VPCs
DevicesAll-in-one router/firewall, a Linux host, or a NAS running WireGuard/OpenVPNDedicated firewalls/VPN concentrators, ISR/ASR routers, SD-WAN edges, cloud VPN gateways
ProtocolsWireGuard, OpenVPN, IKEv2 built into the routerIPsec IKEv2 (route-based VTI, DMVPN), SSL/TLS remote access, ZTNA alongside VPN
AuthenticationPre-shared keys or key pairs, local accountsCertificates (PKI), RADIUS/AD, SAML single sign-on, MFA, device posture checks
AvailabilitySingle gateway, single ISPRedundant gateways, dual ISPs, dead peer detection, dynamic routing over tunnels
ManagementWeb GUI, manual key exchangeCentral management, templates, automation (Ansible/APIs), SIEM logging, change control
Skill emphasisPort forwarding, dynamic DNS, NAT, basic key handlingCrypto policy design, routing, scale, HA, compliance (NIST, CMMC), incident response
Common VPN protocols and ports
ProtocolWhat it doesPorts / IP protocolWhere you'll see itStatus
IKEv2Negotiates keys and security associations for IPsecUDP 500; UDP 4500 with NAT-TSite-to-site, mobile clientsRecommended
IKEv1Older IPsec key exchange (main/aggressive mode)UDP 500, 4500Legacy site-to-site (used in Part A because it's still common on exams and in the field)Migrate to IKEv2
ESPEncrypts and authenticates IPsec dataIP protocol 50 (or inside UDP 4500)All modern IPsecRecommended
AHAuthenticates only, no encryption; breaks with NATIP protocol 51Rare, legacyAvoid
SSL/TLS VPNRemote access over HTTPS (Cisco Secure Client, GlobalProtect, FortiClient)TCP 443, DTLS UDP 443Enterprise remote accessCommon
OpenVPNTLS-based, flexible, open sourceUDP 1194 default (or TCP)SOHO routers, small businessCommon
WireGuardLean modern VPN: Curve25519, ChaCha20-Poly1305UDP 51820 defaultSOHO, cloud, point-to-point (Part B)Growing fast
L2TP/IPsecLayer 2 tunnel protected by IPsecUDP 1701 inside IPsec, UDP 500, 4500Older client VPNsLegacy
GREUnencrypted tunnel that carries multicast and routing protocolsIP protocol 47GRE over IPsec, DMVPNPair with IPsec
PPTPBroken MS-CHAPv2 authenticationTCP 1723 + GREShould not be foundInsecure, do not use
SSTPMicrosoft VPN over TLSTCP 443Windows clientsNiche
VPN life cycle: plan, configure, verify, maintain
  1. Gather requirements. Sites, users, applications, bandwidth, uptime, and compliance rules.
  2. Design addressing and topology. Confirm subnets don't overlap; pick site-to-site, remote access, or point-to-point.
  3. Select protocols and crypto. For example IKEv2, AES-256-GCM, SHA-256, DH group 14 or higher, PFS.
  4. Plan authentication. Pre-shared keys for labs and small sites; certificates and MFA for production.
  5. Prepare the edge. Allow UDP 500/4500 and ESP (or UDP 51820), add NAT exemptions, reserve static public IPs or dynamic DNS.
  6. Configure both ends with mirror-image parameters.
  7. Verify. Test underlay first, generate interesting traffic, check SAs, counters, and application access.
  8. Document and hand off. Diagrams, parameters (never the keys themselves), and a test record.
  9. Monitor and maintain. Log review, rekey and certificate renewals, firmware patches, capacity checks.
Command reference

Cisco IOS: policy-based IKEv1 site-to-site (Part A)

crypto isakmp policy 10
 encryption aes 256
 hash sha256
 authentication pre-share
 group 14
 lifetime 86400
crypto isakmp key MVCC-Lab-2026 address 198.51.100.1
crypto ipsec transform-set TS esp-aes 256 esp-sha256-hmac
 mode tunnel
ip access-list extended VPN-TRAFFIC
 permit ip 10.1.1.0 0.0.0.255 10.2.2.0 0.0.0.255
crypto map VPN-MAP 10 ipsec-isakmp
 set peer 198.51.100.1
 set transform-set TS
 match address VPN-TRAFFIC
interface GigabitEthernet0/0
 crypto map VPN-MAP

Cisco IOS: route-based IKEv2 with a virtual tunnel interface (enterprise)

crypto ikev2 proposal PROP
 encryption aes-cbc-256
 integrity sha256
 group 14
crypto ikev2 policy POL
 proposal PROP
crypto ikev2 keyring KR
 peer BRANCH
  address 198.51.100.1
  pre-shared-key MVCC-Lab-2026
crypto ikev2 profile PROF
 match identity remote address 198.51.100.1 255.255.255.255
 authentication remote pre-share
 authentication local pre-share
 keyring local KR
crypto ipsec profile IPSEC-PROF
 set transform-set TS
 set ikev2-profile PROF
interface Tunnel0
 ip address 172.16.0.1 255.255.255.252
 ip tcp adjust-mss 1360
 tunnel source GigabitEthernet0/0
 tunnel destination 198.51.100.1
 tunnel mode ipsec ipv4
 tunnel protection ipsec profile IPSEC-PROF
ip route 10.2.2.0 255.255.255.0 Tunnel0

Cisco verification and troubleshooting

show crypto isakmp sa          ! phase 1 state: QM_IDLE = good, MM_NO_STATE = failing
show crypto ipsec sa           ! phase 2 SAs, encaps/decaps counters
show crypto ikev2 sa           ! IKEv2 equivalent
show crypto map
show crypto session detail
debug crypto isakmp            ! then generate traffic; undebug all when done
clear crypto sa                ! force renegotiation
ping 10.2.2.1 source g0/1      ! source from the LAN so traffic matches the ACL

Linux: WireGuard (Part B)

sudo apt install wireguard
umask 077; wg genkey | tee privatekey | wg pubkey > publickey
sudo nano /etc/wireguard/wg0.conf
sudo ufw allow 51820/udp
sudo wg-quick up wg0
sudo wg show
sudo systemctl enable wg-quick@wg0

Linux: strongSwan IPsec

sudo apt install strongswan strongswan-swanctl
sudo swanctl --load-all        # load /etc/swanctl/swanctl.conf
sudo swanctl --initiate --child net-net
sudo swanctl --list-sas
sudo tcpdump -ni eth0 'udp port 500 or udp port 4500 or esp'

Windows client (PowerShell)

Add-VpnConnection -Name "Office" -ServerAddress "vpn.example.com" `
  -TunnelType Ikev2 -AuthenticationMethod Eap -EncryptionLevel Required -SplitTunneling
Get-VpnConnection
rasdial "Office"               # connect; rasdial "Office" /disconnect to drop
Test-NetConnection 10.2.2.10 -Port 443
Troubleshooting guide
SymptomLikely causeWhat to check
No SA at allNo interesting traffic, crypto map not applied, peer unreachablePing the peer's public IP; confirm the map is on the outside interface; ping with a LAN source
MM_NO_STATEPhase 1 mismatch, wrong pre-shared key, UDP 500 blockedshow crypto isakmp policy on both ends; debug crypto isakmp
QM_IDLE but no encrypted packetsPhase 2 mismatch: transform set, mode, or ACLs that don't mirrorshow crypto ipsec sa; compare ACLs line by line
Encaps rise, decaps stay at 0Peer can't route the reply, peer NATs the traffic, or a firewall drops ESPPeer routing table, NAT exemption, ESP/UDP 4500 rules
Ping works, web pages or file shares hangMTU/fragmentation from encryption overheadip tcp adjust-mss 1360; ping with DF bit set
Tunnel drops at regular intervalsLifetime, rekey, or dead peer detection mismatchLifetimes and DPD settings on both ends; logs at drop time
WireGuard: no "latest handshake"Wrong public key, endpoint, port, or firewallsudo wg show on both ends; ufw status
WireGuard: handshake but no pingAllowedIPs doesn't cover the source or destinationAllowedIPs on both peers
Remote users connect but can't reach serversSplit-tunnel routes or internal DNS missingClient route table, pushed DNS servers
Glossary flip cards

Select a card to flip it.