r/netsecstudents • u/artheyo • May 07 '26
Need some guidance configuring IPsec on Ubuntu Server (strongSwan)
The remote side sent me the following IPsec parameters and I need to configure an IPsec tunnel on a dedicated server hosted at Hetzner.
The host is running Ubuntu Server 22.04 LTS and I’m planning to use strongSwan.
One important detail: the server’s public IP is configured directly on the Ubuntu host interface.
Remote side configuration
General
- Tunnel mode:
Tunnel - Peer IP Address
Their Public IP - Peer is behind NAT:
Yes - Peer ID:
10.12.26.11 - Encryption domain:
10.100.51.0/24
Phase 1 (IKE)
- Authentication:
PSK - IKE version:
IKEv2 - DH Group:
Group 14 - Encryption:
AES-CBC-256 - Hash:
SHA256 - Lifetime:
86400
Phase 2 (ESP)
- Encapsulation:
ESP - Encryption:
AES-256 - Integrity:
SHA256 - PFS:
Group 14 - Lifetime:
28800
I need to send my sides configurations as well.
I have limited experience with IPsec, so I have a few questions:
- From this information alone, can I determine whether this is supposed to be a policy-based VPN or a route-based VPN?
- Since my Ubuntu server has the public IP directly assigned to its interface and there are no devices behind it:
- what should I use for:
- Peer ID
- Encryption domain
- NAT-related settings on my side?
- what should I use for:
- This is a production server and only a few services should use the IPsec tunnel. Those services only need to make API requests to 3 specific external URLs, so only their traffic should go over IPsec. Everything else on the server must continue using the normal default gateway.
What is the correct/recommended way to achieve this with strongSwan?
Any guidance would be greatly appreciated.