Capstone project

Project: a tunnel you can hand over

Lesson 20 of 20 · 24 min · Module 6: Put it together

Build the complete tunnel for a new head-office gateway, to a standard that the next administrator can read and trust.

Start this lesson →

Free. No installation: you write and run the code in your browser, and it is checked automatically.

By the end, you’ll be able to…

  • Build a complete, resilient site-to-site tunnel from a brief
  • Combine identities, NAT traversal, PFS, lifetimes and DPD
  • Verify the negotiation, the data path and the behaviour over time

The idea

The capstone uses the whole course: a gateway behind NAT with name identities, strong proposals with PFS, exact selectors for several networks, sensible lifetimes, and dead peer detection. Build it from the top of the negotiation down, and verify every line of the brief.

# reachability and IKE
# authentication and identities
# data protection and selectors
# timers and resilience

01Bring up IKE and authenticate

Peer, version, IKE proposal, key and both identities. This gateway is behind NAT, so the identities are names. Stop when IKE_AUTH reports ok.

02Protect the data

The IPsec proposal with the PFS group the branch uses, and one selector for each pair of networks. The branch network is a /23; write it as agreed.

03Make it last

Lifetimes the right way round, dead peer detection, and NAT traversal left on. Then read the Rekey and Outage lines and every test packet.

Your project brief

Configure the tunnel. 1. Peer 198.51.100.2, IKEv2, proposals as the branch has them (see the panel). 2. Shared key Vt4-9mQe-Xb72-hKs6-Pd1w; this gateway is hq.example.com, the branch is branch.example.com. 3. Head-office networks 10.0.1.0/24 and 10.0.3.0/24 reach the branch network 10.1.0.0/23. 4. PFS as the branch requires. 5. Lifetimes: 86400 for IKE, 3600 for IPsec. 6. A dead peer is noticed within 60 seconds. Offer nothing weak, and do not summarise the head-office networks.

What the checks look for

  • IKE comes up with the agreed proposal
  • Authentication succeeds with the agreed key and name identities
  • The data is protected with the agreed proposal and PFS, and rekeying works
  • Both head-office networks reach the whole branch network through NAT
  • Two selectors are installed exactly as configured
  • Lifetimes are one day and one hour, and a dead peer is noticed within a minute
  • Nothing weak is offered, and internet traffic stays outside
Try it in the editor →

Take this with you

A tunnel you can hand over is one where the configuration states exactly what is negotiated, protected and monitored, and you have verified each of those.

Go a little further

Write the twelve lines of the branch side. Then mark the ones that would change if the branch, instead of the head office, were behind NAT.

Learn VPN & IPsec Foundations for free

20 short lessons with real code and instant checks.

See the whole course →