Cloud concept · Updated

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

In short

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.

Cloud Concepts Hub →

6 key aspects of IPsec

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

01
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.

02
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.

03
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.

04
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.

05
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.

06
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 VPNAWS 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.

AWS Transit GatewayAWS 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.

AWS Direct ConnectAWS 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.

IPsec exam questions

Real practice exam questions on IPsec, with the correct answer and its explanation. Answer them with every option in the exam simulator.

SAA-C03

A company is replacing a leased circuit with an internet-based connection to private application servers in one VPC. The applications use several legacy TCP protocols and cannot be modified. Traffic must be encrypted between the company's network router and an AWS-managed network endpoint.

The company has created an AWS Site-to-Site VPN connection. Its router is behind an existing NAT device that has a static public IPv4 address. The router supports NAT traversal. The perimeter firewall permits outbound UDP port 500 and return traffic but blocks all other traffic to the AWS tunnel endpoints. Logs show that initial key exchange begins, but neither encrypted tunnel finishes establishing. The pre-shared keys and cryptographic settings match, and application routes and security rules are correctly configured.

Which change will meet the requirements with the LOWEST additional recurring connectivity cost?

Show answerCORRECT ANSWER

Enable NAT traversal on the company router and permit outbound UDP port 4500 and its return traffic to both AWS tunnel endpoints, in addition to UDP port 500.

IPsec NAT traversal encapsulates protected traffic in UDP port 4500 so that it can pass through the NAT device. Permitting this traffic allows the existing Site-to-Site VPN to establish encrypted tunnels without purchasing another connectivity service or changing the applications.

ANS-C01

A company sends telemetry from its data center to a VPC through an AWS Site-to-Site VPN. The application uses IPv4 UDP packets with the Don't Fragment (DF) bit set. Both VPN tunnels remain established, small telemetry messages arrive successfully, and TCP transfers work. However, telemetry messages with a 1,450-byte UDP payload consistently fail.

Testing confirms that the encrypted path can carry an inner IPv4 packet of at most 1,400 bytes without fragmentation. The application uses a 20-byte IPv4 header and an 8-byte UDP header. Security policy prohibits fragmentation and requires the existing encryption settings to remain unchanged. The network engineer can change application packet sizing but cannot increase the underlying network MTUs.

Which change will restore telemetry delivery while meeting these requirements?

Show answerCORRECT ANSWER

Configure the telemetry sender to split messages into UDP datagrams with application payloads no larger than 1,372 bytes.

IPsec encapsulation reduces the space available for the inner IP packet. With a verified inner packet limit of 1,400 bytes, subtracting the 20-byte IPv4 header and 8-byte UDP header leaves 1,372 bytes for application data. Application-level message splitting preserves encryption and avoids IP fragmentation.

Practice IPsec in a full exam

Questions on IPsec in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is IPsec

3 min read

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.

Learn IPsec in lessons

2 short lessons on IPsec in 1 certification course.

Open the lessons