Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
IPsec VPN and IKEv2 for Beginners: Hands-On Labs
New
Rating: 4.9 out of 5(18 ratings)
83 students

IPsec VPN and IKEv2 for Beginners: Hands-On Labs

IPSec IKE and ikev2 labs: build an ipsec vpn with strongSwan on Rocky Linux 9 and Ubuntu 24.04, from zero
Last updated 11/2026
English
English [Auto],

What you'll learn

  • Install strongSwan on Rocky Linux 9 and Ubuntu 24.04 and read the parts of swanctl.conf.
  • Open the firewall for IKE and ESP and check that the gateways can reach each other.
  • Build a site-to-site IPsec tunnel with a pre-shared key and test it with a ping from LAN to LAN.
  • Capture ESP and port 4500 traffic and look inside the tunnel with xfrm state and policy.
  • Choose IKE and ESP proposals, set lifetimes and rekeying, and use dead peer detection with automatic reconnect.
  • Create a CA and certificates with openssl and connect two gateways with certificates.
  • Configure IKEv2 remote access with a virtual IP pool and a user login, and connect with strongSwan as the client.
  • Read logs, watch counters, find MTU problems and fix broken tunnels in troubleshooting drills.
  • IPsec VPN and IKEv2 for Beginners: Hands-On Labs
  • IPSec IKE and IKEv2 VPN: Hands-On Labs on Linux
  • ipsec vpn with IKEv2 and strongSwan: Step-by-Step Labs
  • IPsec and IKEv2 VPN for Beginners on Rocky and Ubuntu

Course content

1 section • 32 lectures • 1h 58m total length
  • 01_welcome_and_what_you_will_build2:41
  • 02_lab_preparation_servers_tools_and_ai_help6:02
  • 03_what_ipsec_is_tunnel_esp_security_associations3:27
  • 04_what_ikev2_does_two_phases_in_four_messages2:34
  • 05_install_strongswan_on_rocky_9_and_ubuntu_24_043:55
  • 06_the_parts_of_swanctl_conf4:16
  • 07_open_the_firewall_for_ipsec3:43
  • 08_your_first_tunnel_with_a_pre_shared_key4:11
  • 09_test_the_tunnel_ping_from_lan_to_lan3:31
  • 10_see_the_traffic_esp_and_port_45003:36
  • 11_look_inside_xfrm_state_and_policy3:56
  • 12_start_stop_and_restart_the_tunnel3:43
  • 13_ike_and_esp_proposals_choose_algorithms3:58
  • 14_lifetimes_and_rekeying3:43
  • 15_dead_peer_detection_and_auto_reconnect3:50
  • 16_traffic_selectors_more_than_one_subnet3:45
  • 17_wrong_key_wrong_id_read_the_errors3:56
  • 18_why_certificates_the_limits_of_a_pre_shared_key3:49
  • 19_make_a_ca_and_certificates_with_openssl4:07
  • 20_site_to_site_with_certificates3:50
  • 21_certificate_problems_wrong_name_untrusted_c_a_expired3:57
  • 22_ikev2_remote_access_the_idea3:57
  • 23_remote_access_server_pool_and_eap_users3:51
  • 24_remote_access_client_connect_and_get_a_virtual_ip4:02
  • 25_wrong_password_and_removing_a_user3:51
  • 26_logs_and_debugging_with_charon3:32
  • 27_monitoring_counters_and_ip_xfrm_monitor3:46
  • 28_mtu_and_mss_problems3:22
  • 29_troubleshooting_drills4:02
  • 30_security_basics_strong_algorithms_pfs_key_handling3:30
  • 31_cleanup_cheat_sheet_and_outro3:38
  • IPsec VPN and IKEv2 for Beginners - Hands-On Labs.zip0:02

Requirements

  • No VPN or IPsec experience is needed. You should be able to open a Linux terminal, log in with SSH and edit a text file (nano or vi); every other idea is explained first and then practiced. You need two small Linux servers, cloud servers with any provider or local virtual machines, running Rocky Linux 9 and/or Ubuntu 24.04, with root or sudo access and a public or reachable IP address each. The labs create pretend LANs on each server, so you do not need real office networks. You can follow with one operating system or both. The labs cost only a few cents with any cloud provider if you delete the servers when you finish.

Description


This course contains the use of artificial intelligence.

IPsec is the standard way to join two networks over the internet with an encrypted tunnel, and IKEv2 is the protocol that sets the tunnel up. Many beginners find IPsec confusing because of the many words: security associations, ESP, proposals, traffic selectors. This course teaches IPsec and IKEv2 from zero with a simple method: a short explanation with a diagram, and then a real lab on real Linux servers.

Every lab runs for real on Rocky Linux 9.7 with strongSwan 6.0.6 and on Ubuntu 24.04 with strongSwan 5.9.13. The labs use two gateways, each with a pretend LAN, so you can see a real tunnel carry traffic from one LAN to the other. The videos show the real terminal output and the small differences between the two systems, such as package commands, firewall and file paths.

You will learn: how IPsec, ESP and security associations work; what IKEv2 does in its four first messages; installing strongSwan and reading swanctl.conf; opening the firewall; a site-to-site ipsec vpn with a pre-shared key and testing it from LAN to LAN; seeing ESP traffic and port 4500; xfrm state and policy; proposals, lifetimes and rekeying; dead peer detection; traffic selectors; reading errors for a wrong key or wrong ID; making a CA and certificates with openssl and using them for site-to-site; certificate problems; IKEv2 remote access with a server pool and a user login, where strongSwan is also the client; logs, monitoring, MTU problems, troubleshooting drills and security basics.

The course has 31 lectures with about 1 hour 58 minutes of video in total as delivered. The course includes a lab guide, command scripts and lab files for every lab video; every command and every result is also on the screen, and nothing is paywalled inside the course. The narration voice is AI generated.

Please know before you buy: you need two small Linux servers, either cloud servers or local virtual machines. The Windows, macOS, iOS and Android VPN clients were not tested in this course, so the course does not claim them; the remote access labs use strongSwan on Linux as the client. There is no full-tunnel routing lab: the remote access labs send only the traffic for the server LAN through the tunnel. The MSS clamping rule was not tested. The lectures are video only, and the course includes a lab guide, command scripts and lab files for every lab video; every command and every result is also on the screen, and nothing is paywalled inside the course. The narration voice is AI generated.

The course is written for beginners: aspiring network and security engineers, Linux and system administrators, and students who want to understand how an IPsec VPN with IKEv2 really works.

This course contains the use of artificial intelligence.

Curriculum Outline

  1. Welcome and what you will build

  2. Lab preparation: servers, tools and AI help

  3. What IPsec is: tunnel, ESP, security associations

  4. What IKEv2 does: two phases in four messages

  5. Install strongSwan on Rocky 9 and Ubuntu 24.04

  6. The parts of swanctl.conf

  7. Open the firewall for IPsec

  8. Your first tunnel with a pre-shared key

  9. Test the tunnel: ping from LAN to LAN

  10. See the traffic: ESP and port 4500

  11. Look inside: xfrm state and policy

  12. Start, stop and restart the tunnel

  13. IKE and ESP proposals: choose algorithms

  14. Lifetimes and rekeying

  15. Dead peer detection and auto reconnect

  16. Traffic selectors: more than one subnet

  17. Wrong key, wrong ID: read the errors

  18. Why certificates: the limits of a pre-shared key

  19. Make a CA and certificates with openssl

  20. Site to site with certificates

  21. Certificate problems: wrong name, untrusted C A, expired

  22. IKEv2 remote access: the idea

  23. Remote access server: pool and EAP users

  24. Remote access client: connect and get a virtual IP

  25. Wrong password and removing a user

  26. Logs and debugging with charon

  27. Monitoring: counters and ip xfrm monitor

  28. MTU and MSS problems

  29. Troubleshooting drills

  30. Security basics: strong algorithms, PFS, key handling

  31. Cleanup, cheat sheet and outro



Who this course is for:

  • Beginners who want to learn IPsec and IKEv2 VPN from zero
  • Linux and system administrators who must join two networks with an encrypted tunnel
  • Network, security and cloud engineers who want to practice site-to-site and remote access VPN labs
  • Students who want a clear base before working with firewalls, cloud VPN gateways or network security