CLOUD CONCEPT

IPsec

IPsec is a suite of network-layer protocols that authenticates and protects IP traffic between communicating hosts or security gateways.

Cloud Concepts Hub →

What is IPsec

IPsec can provide confidentiality, integrity, peer authentication, and protection against replayed packets without requiring changes to individual applications. In cloud architectures, it commonly secures site-to-site VPN connections between on-premises networks and cloud networks, but it does not replace routing, firewall rules, or application-level security.

IPsec, short for Internet Protocol Security, protects traffic at the IP layer rather than within a particular application protocol. This allows a single connection between security gateways to protect traffic from many applications, including applications that do not implement their own encryption. Its security properties depend on the protocols, algorithms, authentication methods, and policies configured at both endpoints.

The main IPsec packet-protection protocols are Encapsulating Security Payload (ESP) and Authentication Header (AH). ESP is commonly used for cloud VPNs because it supports encryption together with integrity and authentication protections. AH provides integrity and authentication but does not encrypt packet contents and is generally unsuitable for paths involving address translation. Internet Key Exchange (IKE), preferably IKEv2 where supported, authenticates peers and negotiates security associations, cryptographic parameters, and key material. These agreements must be compatible on both endpoints.

IPsec supports tunnel mode and transport mode. Tunnel mode encapsulates the original IP packet inside another IP packet and is the usual choice for gateway-to-gateway cloud connectivity. Transport mode protects the payload of the original IP packet without adding a new outer IP header and is more commonly associated with host-to-host protection. Neither mode automatically protects data after it leaves the IPsec endpoints.

For example, a company can connect its data center firewall to a cloud VPN gateway and route private application traffic through an encrypted tunnel across the internet. With AWS Site-to-Site VPN, the cloud endpoint can be a virtual private gateway or a transit gateway. Route tables must direct the relevant network prefixes into the VPN, and security groups, network ACLs, and on-premises firewalls must permit the intended application traffic. A tunnel showing an established state does not prove that these routing and authorization requirements are satisfied.

A common exam distinction is that private connectivity and encrypted connectivity are different properties. AWS Direct Connect provides dedicated connectivity but does not encrypt customer traffic by default. An appropriately designed IPsec VPN can run over Direct Connect when both private transport and network-layer encryption are required. MACsec is another encryption option on supported Direct Connect connections, but it protects a link rather than providing the same gateway-to-gateway protection boundary as IPsec.

IPsec introduces encapsulation overhead and cryptographic processing, which can reduce effective throughput and usable packet size. Engineers should account for path MTU, fragmentation, and TCP maximum segment size when diagnosing applications that stall despite an established tunnel. Internet-based VPNs also inherit the latency and availability characteristics of their underlying paths. Redundant tunnels, resilient customer gateway infrastructure, and tested routing failover are important; AWS Site-to-Site VPN supplies two tunnels per connection, and both should be configured.

Operational troubleshooting should separate negotiation failures from forwarding failures. Check peer authentication, IKE and IPsec proposals, key lifetimes, and traffic selectors when tunnels fail to establish. Check routes, return paths, overlapping address ranges, and firewall policies when tunnels establish but traffic fails. IKE commonly uses UDP port 500; NAT traversal encapsulates ESP in UDP port 4500, while native ESP uses IP protocol 50 rather than a TCP or UDP port. Finally, retain TLS where application identity or protection beyond the VPN gateways is required: an IPsec tunnel is not a substitute for end-to-end application security.

Key aspects of IPsec

IPsec secures traffic between defined network endpoints through negotiated cryptography, while routing, authorization, performance, and resilience remain separate design responsibilities.

Network-layer traffic protection

IPsec protects IP traffic independently of the application protocol. A gateway-to-gateway deployment can secure many applications without modifying each application.

Negotiated authentication and cryptography

IKE authenticates peers and negotiates security associations and key material. Configure compatible, strong algorithms and securely manage authentication credentials on both endpoints.

Tunnel and transport modes

Tunnel mode encapsulates entire original IP packets and is typical for site-to-site VPNs. Transport mode protects the original packet payload and is more commonly used between hosts.

Explicit security boundaries

Protection applies between the IPsec endpoints, not automatically between application processes. Traffic beyond a VPN gateway may require TLS or another protection mechanism.

Independent routing and access control

Establishing a tunnel does not create all necessary routes or authorize application access. Validate destination routes, return routes, network addressing, and firewall policies separately.

Performance and resilience considerations

Encryption and encapsulation consume processing capacity and reduce usable packet size. Configure redundant tunnels, monitor their health, and test failover and MTU-sensitive applications.

Cloud services for IPsec

AWS Site-to-Site VPN supplies the IPsec tunnels, while a virtual private gateway or AWS Transit Gateway provides the AWS-side termination and routing integration. Transit Gateway is useful when a shared hybrid connection must reach multiple VPCs, with route tables controlling reachability. AWS Direct Connect can provide the underlying dedicated path when an architecture requires private transport in addition to IPsec encryption. Across these designs, engineers must configure customer gateway equipment, redundant tunnels, compatible cryptographic settings, routes, and access controls; no individual service supplies all of those controls automatically.

AWS Site to Site VPN image AWS Site-to-Site VPN

Implements managed IPsec connectivity between an AWS network endpoint and a customer gateway device. Each VPN connection provides two tunnels, which should both be configured for resilience.

Open AWS Site-to-Site VPN →
AWS Transit Gateway image AWS Transit Gateway

Can terminate AWS Site-to-Site VPN connections and route traffic between VPN attachments and connected VPCs. Transit gateway route tables determine which networks can exchange traffic; encryption on a VPN attachment does not automatically encrypt every other attachment.

Open AWS Transit Gateway →
AWS Direct Connect image AWS Direct Connect

Provides dedicated connectivity rather than IPsec encryption by default. IPsec VPN connectivity can be layered over Direct Connect; AWS Private IP VPN supports private-addressed VPN endpoints over Direct Connect using a transit gateway.

Open AWS Direct Connect →