Labs / Sealed Lines / GRE, VPN & IPsec

Lab 3 of 3 · GRE, VPN & IPsec

IPsec: two offices, one untrusted network between them

Join two offices over IPsec, and see what the ISP still reads.

Open this lab Pro 6 steps

The idea

IPsec has two routers agree on keys (IKE) and then encrypt whatever their policy selects (ESP), so the ISP between two offices sees only sealed packets: a site to site tunnel. officeRouter and branchRouter build it across ispRouter, so alice in the office reaches fileServer in the branch.

Two one-way SAs, one SPI each
Two one-way SAs, one SPI each
Tunnel mode
Tunnel mode

Steps

  1. Without the tunnel: the ISP reads everything

    Before sealing anything, see what an ISP in the middle can read without it. alice, in the office, and fileServer, in the branch, are joined across an ISP, with no tunnel yet. ispRouter records what passes.

    alice:~# curl -s http://fileServer.lab/payroll.csv
  2. IKE: the routers agree on keys

    Before encrypting anything, the two routers must share keys, over the very line the ISP listens on. IKE (Internet Key Exchange) does it. swanctl drives strongSwan, the IPsec program on both routers.

    officeRouter:~# swanctl --initiate --child sites
    officeRouter:~# swanctl --list-sas

Pro

4 more steps in the app

  1. Policies and SAs in the kernel
  2. What the ISP sees now
  3. The price: bigger packets, a smaller MTU
  4. Both ends must agree
Get Pro

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab