Telecom Glossary

What Is IPsec?

A plain-English guide to the protocol behind most site-to-site VPNs: how IKE sets up a tunnel in two phases, what security associations and ESP do, tunnel vs transport mode, and why NAT and dynamic addresses get in the way.

IPsec (Internet Protocol Security) is a suite of IETF standards that encrypts and authenticates IP traffic between two points, such as two office firewalls, so it can cross the public internet privately. It is the protocol behind most site-to-site VPNs and many remote-access VPNs, and getting a tunnel working mostly comes down to both ends agreeing on the same settings and being able to reach each other's address.

IPsec works at the network layer, underneath applications. Once a tunnel is up, any traffic between the two networks, whether file shares, printers, phone calls or database connections, is protected without each application doing anything. That is why it suits permanent links between offices, data centers and cloud networks. Which kind of VPN a business should choose is a separate question, covered in our guide to business VPN options. This page explains how the protocol itself works.

The parts of IPsec

  • IKE (Internet Key Exchange). The negotiation protocol. The two ends use it to prove who they are, agree on encryption settings and create shared keys. IKEv2 is the current version; IKEv1 is older and still found on many devices. IKE runs over UDP port 500.
  • Security associations (SAs). The agreements IKE produces. Each SA records the algorithms, keys and lifetime for traffic in one direction, so a working tunnel has at least a pair. Each SA has an ID number called an SPI that travels in every packet.
  • ESP (Encapsulating Security Payload). The protocol that carries your traffic. It encrypts the data and adds an integrity check so tampering is detected. ESP is IP protocol 50, a separate protocol number from TCP or UDP.
  • AH (Authentication Header). An older option that checks integrity without encrypting. It cannot pass through address translation, and it is rarely used for business VPNs.

IKE phase 1 and phase 2

Tunnel setup happens in two stages. Firewall screens usually call them phase 1 and phase 2, even on IKEv2, where the standard uses different names.

  1. Phase 1 builds a secure channel for the negotiation itself. The two ends agree on encryption, integrity and Diffie-Hellman settings, exchange keys, and authenticate each other with a pre-shared key or certificates. The result is the IKE SA. In IKEv1 this uses main mode or the less secure aggressive mode.
  2. Phase 2 builds the SAs that carry your traffic. Inside the phase 1 channel, the ends agree on ESP settings and on which networks the tunnel covers, known as traffic selectors, proxy IDs or the encryption domain depending on the vendor. The result is a pair of IPsec SAs, called child SAs in IKEv2.
  3. Both phases expire and rekey. Each SA has a lifetime, and new keys are negotiated before it runs out. Phase 1 lifetimes are commonly longer than phase 2.

A rule of thumb for troubleshooting: if phase 1 fails, check the peer addresses, authentication and phase 1 settings. If phase 1 comes up and phase 2 does not, the traffic selectors or phase 2 settings usually differ between the two ends.

What both ends must agree on

When you build a tunnel to a partner, a branch or a cloud network, the two sides exchange a short worksheet. Mismatches in any line are the most common reason a tunnel will not come up.

SettingPhaseWhat to agree
Peer addresses1The public IP address of each end
IKE version1IKEv2 where both ends support it
Authentication1Pre-shared key or certificates; a long random key if pre-shared
Encryption and integrity1 and 2Current algorithms such as AES with SHA-2, or AES-GCM
Diffie-Hellman group1, and 2 if PFS is onA current group both ends support
Perfect forward secrecy (PFS)2On or off, and which group
Lifetimes1 and 2Matching values, or at least compatible ones
Traffic selectors2The exact local and remote networks, written the same way on both ends

Avoid outdated options such as DES, 3DES, MD5 and the smallest Diffie-Hellman groups, and check the current guidance from your firewall maker and the other party. Cloud providers publish the settings their VPN gateways accept.

Tunnel mode vs transport mode

Tunnel mode encrypts the entire original packet, including its private source and destination addresses, and wraps it in a new packet addressed between the two firewalls. Site-to-site VPNs use tunnel mode, because the networks behind each firewall stay hidden and private addresses can cross the internet.

Transport mode encrypts only the payload and keeps the original IP header. It is used between two hosts that talk directly, or together with another tunneling protocol such as GRE, which does the wrapping instead.

Firewalls also build tunnels in two styles. A policy-based VPN encrypts traffic that matches a rule. A route-based VPN creates a virtual tunnel interface and sends traffic into it with ordinary routing, which makes failover across two circuits and dynamic routing easier. The two ends can use different styles, as long as their traffic selectors match.

NAT traversal, CGNAT and static IPs

ESP has no port numbers, so a router that translates addresses cannot track it. NAT traversal (NAT-T) solves that. During IKE, the two ends detect any translation between them and switch to UDP port 4500, wrapping each ESP packet in UDP so it passes through. Most firewalls do this automatically, as long as UDP ports 500 and 4500 are allowed.

NAT-T lets an end behind translation start a tunnel. It does not make that end reachable. If a branch is behind carrier-grade NAT, it can usually connect out to a head office with a public address, and the head office cannot start the tunnel back. If both ends are behind CGNAT, a direct tunnel generally will not work. A static IP address on at least one end, ideally the hub, avoids most of this. Dynamic addresses can be handled with dynamic DNS or the firewall's own identity settings, at the cost of more to go wrong.

Performance and packet size

  • Encryption speed. Firewalls list a separate IPsec throughput figure, often far below their plain firewall figure. That number, not the circuit speed, often sets the tunnel's ceiling. Our page on the next-generation firewall explains why inspection and encryption figures differ from the headline number.
  • Overhead. ESP adds headers, padding and an integrity check, tunnel mode adds a new IP header, and NAT-T adds a UDP header. Packets that were full size before can become too large, which shows up as some applications hanging while others work. Lowering the TCP maximum segment size on the tunnel, known as MSS clamping, is the usual fix.
  • Dead peer detection. Each end checks that the other is still answering and tears the tunnel down if it is not, so a backup path can take over.

IPsec vs SSL VPN and the alternatives

IPsec VPNSSL/TLS VPN
Typical useSite-to-site; also remote access with IKEv2 clientsRemote access for staff
PortsUDP 500 and 4500, plus ESPUsually TCP or UDP 443
Works through restrictive guest networksSometimes blockedUsually passes, since it looks like secure web traffic
InteroperabilityAn open standard; different makers' firewalls can connectUsually tied to one maker's client and gateway
ClientBuilt into most operating systems, or a vendor clientVendor client or a browser

For staff access, many businesses are moving to zero trust products that grant access to individual applications instead of a whole network; our guide to zero trust network access explains how. SD-WAN still builds IPsec tunnels between sites, but creates and manages them automatically. Cloud security services built on the SASE model often accept IPsec tunnels from office firewalls as their way in.

How FiberX helps

FiberX gets quotes from several carriers for each site and checks the details that decide whether a tunnel will work: whether the hub has a static IP, whether a backup line sits behind CGNAT, and whether the upload at the hub can carry every branch. If you would rather not manage tunnels yourself, we can quote managed SD-WAN and managed firewall services. The carrier pays us, so there is no markup. Request a quote, or call or text 478-758-8091.

// QUESTIONS

Frequently Asked Questions

01Is IPsec a VPN?

IPsec is the protocol suite many VPNs are built on. An IPsec VPN uses it to create an encrypted tunnel between two firewalls, or between a device and a firewall.

02What ports does IPsec use?

IKE uses UDP port 500, and UDP port 4500 when NAT traversal is in use. Without NAT traversal, the encrypted traffic itself travels as ESP, which is IP protocol 50.

03Is IPsec still secure?

Yes, when it is set up with current algorithms, strong keys or certificates and patched firewalls. Most weaknesses come from outdated settings, weak pre-shared keys or unpatched VPN gateways.

04Why does my IPsec tunnel keep dropping?

Common causes are mismatched lifetimes or rekey settings, a changing public IP address on one end, dead peer detection timing out on a lossy line, and packet size problems. Comparing both ends' logs at the time of the drop usually points to the cause.

05Can IPsec work behind NAT?

Yes. NAT traversal wraps the encrypted traffic in UDP so it passes through address translation. The end behind NAT normally has to start the tunnel, because the other end cannot reach it directly.

06Is IKEv2 better than IKEv1?

IKEv2 is the newer standard. It needs fewer messages to set up a tunnel, handles NAT and reconnection better, and is the usual choice when both ends support it.

// FREE · NO OBLIGATION · SAME-DAY RESPONSE

Want This Priced for Your Address?

Reading is cheap; a real number for your building is better. Pick a time below, or call and we will talk it through.

EMAIL INFO@FIBERXINTERNET.COM · TEXT (478) 758-8091

FIBERX · APPOINTMENT CONSOLE
Book an Appointment

Talk to Phil. Pick a Time.

A quick call with your dedicated agent — internet quotes, AI automation, or both. No obligation, same-day response.

Pick your 30-minute slot ALL TIMES ET
or call 478-758-8091

REQUEST GOES STRAIGHT TO PHIL · SAME-DAY CONFIRMATION

Call now · same-day478-758-8091