NETW 0014 Week 5, Day 4 — WireGuard & Firewalling the 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/22

encourage image

There are no tags or description

Looks like no tags are added yet.

23 Terms

1
New cards

List everything IKEv2 negotiated before it sent a byte

algorithms, DH group, identities, certificates, selectors, lifetimes

2
New cards

What is WireGuard?

It is part of the Linux kernel (since 5.6) and appears as an ordinary network interface (wg0)

Each peer has a key pair; you exchange public keys, never secrets, and there is no CA and no negotiation: the algorithms are fixed (Curve25519, ChaCha20-Poly1305, BLAKE2s)

The configuration is two sections: [Interface] (this machine's private key, address and listen port) and one [Peer] per remote (its public key, its endpoint and its AllowedIPs)

3
New cards

What is AllowedIPs?

AllowedIPs is cryptokey routing:

  • It is both the routing table (which destinations go to this peer) and the filter (which source addresses are accepted from it)

  • wg-quick turns it into routes

  • A tunnel address of 10.99.0.[desk]/32, unique per desk, avoids having to agree a subnet


4
New cards

What does an idle WireGuard peer send?

nothing

5
New cards

What does wg show do?

reports the latest handshake and counters

6
New cards

What does a peer behind NAT need?

PersistentKeepalive

7
New cards

Why is the NAT exclusion not needed?

WireGuard traffic leaves S1 on wg0, not eth1, so the Week 1 -o eth1 MASQUERADE rule never matches it (its counter does not move)

8
New cards

What happens if the IPsec policy and a WireGuard are up for the same subnet?

the IPsec policy wins: the traffic still leaves as ESP and never enters wg0, so a WireGuard test would really be testing IPsec

9
New cards

Compare how IPsec (IKEv2) and WireGuard work for the following concept: Identity and trust

IPsec: PSK or certificates (a CA)

WireGuard: Public keys exchanged directly

10
New cards

Compare how IPsec (IKEv2) and WireGuard work for the following concept: Algorithms

IPsec: Negotiated (and misconfigurable)

WireGuard: Fixed, no negotiation

11
New cards

Compare how IPsec (IKEv2) and WireGuard work for the following concept: Configuration

IPsec: swanctl.conf plus NAT, proposals, selectors

WireGuard: One short file per side

12
New cards

Compare how IPsec (IKEv2) and WireGuard work for the following concept: Interface

IPsec: None: kernel policies

WireGuard: A real interface, wg0

13
New cards

Compare how IPsec (IKEv2) and WireGuard work for the following concept: Interoperability

IPsec: Standard, in every router and OS

WireGuard: Newer, growing support

14
New cards

Compare how IPsec (IKEv2) and WireGuard work for the following concept: Revocation and scale

IPsec: CA, CRL, OCSP

WireGuard: Remove a peer from the config

15
New cards

Between IPsec and WireGuard, Which took fewer steps, and which would you trust a thousand sites to?

WireGuard took fewer steps (one short file per side, no CA and no negotiation); IPsec is the one to trust at scale, because a CA with CRL and OCSP lets you issue and revoke identities centrally, where WireGuard means editing the peer list on every end.

16
New cards

What did AllowedIPs do for you that IKE's traffic selectors did before?

it is the route (which destinations go to this peer) and the filter (which sources are accepted from it) in one setting, where IPsec needed traffic selectors plus separate routing and NAT work.

17
New cards

Your firewall now trusts one address. What breaks if your partner's address changes?

the rules drop their IKE, ESP and WireGuard packets, so the tunnel cannot come up until you correct the address and save the rules again.

18
New cards

What is the likely cause and fix for the following issue: wg show has no handshake

A public key is wrong, the endpoint is wrong, or UDP 51820 is blocked

Compare keys character by character; check the endpoint; capture UDP 51820 on both ends

19
New cards

What is the likely cause and fix for the following issue: Handshake works but S2 cannot reach the partner's S2

Forwarding is off, AllowedIPs lacks the partner LAN, or the partner's end is not configured

Check ip_forward and the peer's allowed IPs, and compare wg show with your partner's

20
New cards

What is the likely cause and fix for the following issue: The ping works but the WireGuard counters do not rise

The IPsec policy is still active for the same subnet, so the traffic stays in ESP and never enters wg0

Stop the strongswan service first

21
New cards

What is the likely cause and fix for the following issue: wg-quick cannot find the device

The kernel module is not loaded

sudo modprobe wireguard, then retry

22
New cards

What is the likely cause and fix for the following issue: The tunnel dies after the firewall change

The partner's address was typed wrongly, or the rule is above the allow

Check counters and order; allow before drop

23
New cards

What is the likely cause and fix for the following issue: fail2ban stopped banning after saving

Its chain was saved or flushed

Restart fail2ban; save with fail2ban stopped