NETW 0014 Week 5, Day 2 — The PSK Tunnel

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/15

encourage image

There are no tags or description

Looks like no tags are added yet.

16 Terms

1
New cards

What will the first tunnel ping look like on eth1 if we forget the NAT exclusion?

the plaintext packet leaves with a private destination

2
New cards

Explain the structure of swanctl.conf

A connections section holds one or more connections; each has version = 2, local_addrs, remote_addrs, proposals, a local and a remote block (each with auth and id) and a children block

A child names the traffic selectors local_ts and remote_ts, esp_proposals, mode = tunnel, start_action and dpd_action

A secrets section holds PSKs (ike-name { id-1 = ...; id-2 = ...; secret = "..." })

Unlike the old ipsec.conf, there is no left/right swapping: local is always this machine, so the two ends are written the same way round

3
New cards

What is the swanctl.conf working loop?

(1) Edit the file

(2) swanctl --load-all

(3) swanctl --initiate --child NAME (or let start_action = start do it)

(4) swanctl --list-sas

4
New cards

What is the output of swanctl.conf?

the IKE SA state, the algorithms, the ids, the uptime and, per child, the selectors, SPIs and byte counters

5
New cards

What is the first clue that traffic is not entering the tunnel?

Counters that do not move

6
New cards

What does ip xfrm policy do?

lists what the kernel will encrypt (a pair of selectors per direction, plus forwarding)

7
New cards

What does ip xfrm state do?

lists the negotiated SAs with their SPIs

8
New cards

What does tcpdump -i eth1 esp do?

shows what the classroom sees: only the outer addresses and an SPI

9
New cards

If the SA is up but ip xfrm policy shows no policy, or the counters never rise, where is the problem?

in the traffic selectors, not in IKE

10
New cards

What is a PSK’s weakness?

It’s too simple. One secret, known to both ends, agreed out of band. Use a long random value, never a word. Two peers that compromise each other's host lose the secret for both

11
New cards

What is the likely cause and fix for the following issue: No SA after load

PSK or ids differ, wrong addresses, or the other end is not loaded

Read journalctl -u strongswan; compare ids and addresses; confirm both ends ran swanctl --load-all

12
New cards

What is the likely cause and fix for the following issue: "no proposal chosen"

The two ends specify different proposals

Use identical IKE and ESP proposals on both ends

13
New cards

What is the likely cause and fix for the following issue: SA is up but the ping fails

MASQUERADE has not been excluded, a traffic selector is wrong, or forwarding is off

Capture on eth1; check ip xfrm policy; check the nat rule and ip_forward

14
New cards

What is the likely cause and fix for the following issue: S2 lost internet after the fix

The rule excludes too much, or was not re-added

Check iptables -t nat -S POSTROUTING; the internet traffic must still match MASQUERADE

15
New cards

What is the likely cause and fix for the following issue: Tunnel drops after a reboot

The connection is not loaded at start, or the rule was not persisted

Confirm the service is enabled and the saved rules include the new rule

16
New cards

What is the likely cause and fix for the following issue: Replies vanish with a good SA

Reverse-path filtering, or the partner's exclusion is missing

Check sysctl net.ipv4.conf.all.rp_filter on both ends and the partner's nat rule