IPSec Configuration
IPSec is an alternative tunnel protocol for edge peering that uses AES-256-GCM encryption. While WireGuard is the default and recommended protocol for most deployments, IPSec is available when compliance requirements mandate it or when integrating with networks that require industry-standard IPSec encryption.
When to Use IPSec
Choose IPSec over WireGuard when:
- Your organization's security policy requires AES-256-GCM encryption specifically.
- Compliance frameworks (e.g., PCI-DSS, HIPAA, FedRAMP) mandate IPSec.
- You need explicit control over rekeying intervals and Security Association lifecycle.
- You are integrating with third-party networks that only support IPSec.
For all other cases, WireGuard is recommended due to its lower overhead, faster handshakes, and simpler key management.
How IPSec Peering Works
When you create a peering group with the IPSec tunnel protocol, the system manages IPSec Security Associations (SAs) instead of WireGuard key pairs:
- SA Key Generation -- When a link is created between two members, AES-256-GCM encryption keys (256-bit) are generated for each direction of traffic.
- SPI Allocation -- Each direction of each link receives a unique Security Parameter Index (SPI) that identifies the SA.
- Key Distribution -- SA keys are encrypted at rest in the database and distributed to edge devices via MQTT.
- Tunnel Establishment -- Edge devices use the SA material to establish IPSec tunnels with their peers.
Each link has two directional SAs -- one for traffic from Edge A to Edge B, and one for traffic from Edge B to Edge A. This ensures that each direction uses independent encryption keys.
Encryption Details
| Parameter | Value |
|---|---|
| Encryption Algorithm | AES-256-GCM (authenticated encryption) |
| Integrity Algorithm | None (GCM provides built-in authentication) |
| Key Size | 256 bits (32 bytes) |
| GCM Salt | 4-byte nonce prefix per SA direction |
| Encapsulation | UDP on the configured listen port |
AES-256-GCM is an authenticated encryption mode that provides both confidentiality and integrity in a single operation, making a separate integrity algorithm unnecessary.
Rekeying
Rekeying generates new SA keys and SPIs for all links in a peering group. This maintains forward secrecy -- if a key is compromised, only traffic encrypted with that specific key is affected.
Rekey Interval
When creating an IPSec peering, you configure a Rekey Interval in hours (default: 24). This controls how frequently SA keys should be refreshed.
| Interval | Use Case |
|---|---|
| 1-4 hours | High-security environments requiring frequent key rotation |
| 24 hours (default) | Standard deployments balancing security and stability |
| 168 hours (1 week) | Low-change environments where stability is prioritized |
Manual Rekeying
You can trigger an immediate rekey from the peering detail page:
- Select the IPSec peering group from the list.
- In the detail panel, click the Rekey IPSec button (amber button in the action bar).
- New SA keys and SPIs are generated for all links.
- Updated configurations are pushed to all member edges immediately.
- A toast notification confirms how many links were rekeyed.
During a rekey, there is a brief period where edges transition to the new SA keys. Traffic may experience momentary disruption (typically under one second) as edges install the new SAs.
What Happens During a Rekey
- New 256-bit AES keys and GCM salts are generated for every link direction.
- New SPIs are allocated for each SA.
- The new key material is encrypted and stored in the database.
- All member edges are marked as needing configuration sync.
- Updated configurations with new SA material are pushed to all edges via MQTT.
- The
last_rekey_attimestamp is updated on the peering group.
Status Indicators
IPSec peerings display status differently from WireGuard peerings:
Peering List
IPSec peering groups show an amber IPSec badge next to the peering name in the list view, making it easy to distinguish them from WireGuard peerings.
Member Status
| Status | Meaning |
|---|---|
| SA Active | Security Associations are established and the member is passing traffic. |
| SA Pending | SAs are being negotiated or have not yet been established. |
This differs from WireGuard peerings, which show the last handshake timestamp instead.
Link Status
| Status | Meaning |
|---|---|
| SA: Established | The IPSec SA between the two edges is active and encrypting traffic. |
| SA: Down | The SA is not established. Traffic is not flowing on this link. |
Firewall Requirements
IPSec peerings use UDP encapsulation on the configured listen port (default 51820). Ensure that:
- The listen port is open for inbound UDP traffic on all member edges.
- If dual tunnel is enabled, the secondary listen port is also open.
- NAT traversal is supported -- UDP encapsulation allows IPSec to work through NAT devices.
Unlike traditional IPSec deployments that require ESP protocol (IP protocol 50) to be allowed, SecureLink IPSec peering uses UDP encapsulation, which works through NAT and standard firewalls without special rules beyond the listen port.
Dual Tunnel with IPSec
IPSec fully supports dual tunnel redundancy (Active-Standby and Active-Active). Each tunnel in a dual tunnel pair has its own independent set of SAs:
- Primary tunnel: Uses SA keys and SPIs from the primary link.
- Secondary tunnel: Uses separate SA keys and SPIs from the secondary link.
Rekeying refreshes the SA material for both tunnels simultaneously. BGP and BFD operate identically to WireGuard dual tunnel configurations.
Troubleshooting IPSec Peering
SA Pending After Creation
If a member shows SA Pending after being added to the group:
- Verify the edge is online and sending heartbeats.
- Check that the configuration was received -- look for MQTT delivery confirmation in edge logs.
- Confirm the listen port is reachable from the peer edge.
- Try syncing the peering configuration from the detail page.
SA Down After Working Previously
If an established SA goes down:
- Check WAN connectivity on both edges involved in the link.
- Verify no firewall changes have blocked the listen port.
- Try a manual rekey -- this generates fresh SA material and pushes it to both edges.
- Check edge logs for SA negotiation errors.
Rekey Failures
If the Rekey IPSec button produces an error:
- Verify you have permission to manage the peering group.
- Check that the peering group is an IPSec peering (rekey is only available for IPSec).
- Ensure the API server is running and accessible.
- Check server logs for detailed error information.