Interview Prep/Networking/Security: Firewalls, SGs, NACLs & VPN

Set up WireGuard to give an engineer access to a private network.

IntermediateScenarioSecurity: Firewalls, SGs, NACLs & VPN
Answer

Situation read → WireGuard is a lightweight VPN with a very small config.

What I'd do →

  1. On the server install wireguard-tools, generate keys with wg genkey | tee server.key | wg pubkey > server.pub
  2. Write /etc/wireguard/wg0.conf with [Interface] Address=10.8.0.1/24 ListenPort=51820 PrivateKey=... and a [Peer] with PublicKey and AllowedIPs = 10.8.0.2/32
  3. Enable forwarding and NAT for the private network
  4. Start with wg-quick up wg0 and check wg show
  5. Open UDP 51820 in the security group

Why → AllowedIPs doubles as routing table and access control for each peer.

Interview tip → Say rotating keys and removing a peer are one-line operations, which is why it's popular.

All Networking questions Roadmap: Networking for DevOps

More on Security: Firewalls, SGs, NACLs & VPN