Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

IPsec VPN Overview

A VPN is a private network that uses a public network to connect two or more remote sites. Instead of using dedicated connections between networks, VPNs use virtual connections routed (tunneled) through public networks. IPsec VPN is a protocol, consists of set of standards used to establish a VPN connection.

A VPN provides a means by which remote computers communicate securely across a public WAN such as the Internet.

A VPN connection can link two LANs (site-to-site VPN) or a remote dial-up user and a LAN. The traffic that flows between these two points passes through shared resources such as routers, switches, and other network equipment that make up the public WAN. To secure VPN communication while passing through the WAN, the two participants create an IP Security (IPsec) tunnel.

The term tunnel does not denote tunnel mode (see Packet Processing in Tunnel Mode). Instead, it refers to the IPsec connection.

IPsec VPN Topologies on SRX Series Devices

The following are some of the IPsec VPN topologies that Junos operating system (OS) supports:

  • Site-to-site VPNs—Connects two sites in an organization together and allows secure communications between the sites.

  • Hub-and-spoke VPNs—Connects branch offices to the corporate office in an enterprise network. You can also use this topology to connect spokes together by sending traffic through the hub.

  • Remote access VPNs—Allows users working at home or traveling to connect to the corporate office and its resources. This topology is sometimes referred to as an end-to-site tunnel.

Comparing Policy-Based and Route-Based VPNs

It is important to understand the differences between policy-based and route-based VPNs and why one might be preferable to the other.

Table 1 lists the differences between route-based VPNs and policy-based VPNs.

Table 1: Differences Between Route-Based VPNs and Policy-Based VPNs

Route-Based VPNs

Policy-Based VPNs

With route-based VPNs, a policy does not specifically reference a VPN tunnel.

With policy-based VPN tunnels, a tunnel is treated as an object that, together with source, destination, application, and action, constitutes a tunnel policy that permits VPN traffic.

The policy references a destination address.

In a policy-based VPN configuration, a tunnel policy specifically references a VPN tunnel by name.

The number of route-based VPN tunnels that you create is limited by the number of route entries or the number of st0 interfaces that the device supports, whichever number is lower.

The number of policy-based VPN tunnels that you can create is limited by the number of policies that the device supports.

Route-based VPN tunnel configuration is a good choice when you want to conserve tunnel resources while setting granular restrictions on VPN traffic.

With a policy-based VPN, although you can create numerous tunnel policies referencing the same VPN tunnel, each tunnel policy pair creates an individual IPsec security association (SA) with the remote peer. Each SA counts as an individual VPN tunnel.

With a route-based approach to VPNs, the regulation of traffic is not coupled to the means of its delivery. You can configure dozens of policies to regulate traffic flowing through a single VPN tunnel between two sites, and only one IPsec SA is at work. Also, a route-based VPN configuration allows you to create policies referencing a destination reached through a VPN tunnel in which the action is deny.

In a policy-based VPN configuration, the action must be permit and must include a tunnel.

Route-based VPNs support the exchange of dynamic routing information through VPN tunnels. You can enable an instance of a dynamic routing protocol, such as OSPF, on an st0 interface that is bound to a VPN tunnel.

The exchange of dynamic routing information is not supported in policy-based VPNs.

Route-based configurations are used for hub-and-spoke topologies.

Policy-based VPNs cannot be used for hub-and-spoke topologies.

With route-based VPNs, a policy does not specifically reference a VPN tunnel.

When a tunnel does not connect large networks running dynamic routing protocols and you do not need to conserve tunnels or define various policies to filter traffic through the tunnel, a policy-based tunnel is the best choice.

Route-based VPNs do not support remote-access (dial-up) VPN configurations.

Policy-based VPN tunnels are required for remote-access (dial-up) VPN configurations.

Route-based VPNs might not work correctly with some third-party vendors.

Policy-based VPNs might be required if the third party requires separate SAs for each remote subnet.

When the security device does a route lookup to find the interface through which it must send traffic to reach an address, it finds a route via a secure tunnel interface (st0) , which is bound to a specific VPN tunnel.

With a route-based VPN tunnel, you can consider a tunnel as a means for delivering traffic, and can consider the policy as a method for either permitting or denying the delivery of that traffic.

With a policy-based VPN tunnel, you can consider a tunnel as an element in the construction of a policy.

Route-based VPNs support NAT for st0 interfaces.

Policy-based VPNs cannot be used if NAT is required for tunneled traffic.

Proxy ID is supported for both route-based and policy-based VPNs. Route-based tunnels also offer the usage of multiple traffic selectors also known as multi-proxy ID. A traffic selector is an agreement between IKE peers to permit traffic through a tunnel, if the traffic matches a specified pair of local and remote IP address prefix, source port range, destination port range, and protocol. You define a traffic selector within a specific route-based VPN, which can result in multiple Phase 2 IPsec SAs. Only traffic that conforms to a traffic selector is permitted through an SA. The traffic selector is commonly required when remote gateway devices are non-Juniper Networks devices.

Policy-based VPNs are only supported on SRX5400, SRX5600, and SRX5800 devices. Platform support depends on the Junos OS release in your installation.

Comparison of Policy-Based VPNs and Route-Based VPNs

Table 2 summarizes the differences between policy-based VPNs and route-based VPNs.

Table 2: Comparison Between Policy-Based VPNs and Route-Based VPNs

Policy-Based VPNs

Route-Based VPNs

In policy-based VPNs, a tunnel is treated as an object that, together with source, destination, application, and action, constitutes a tunnel policy that permits VPN traffic.

In route-based VPNs, a policy does not specifically reference a VPN tunnel.

A tunnel policy specifically references a VPN tunnel by name.

A route determines which traffic is sent through the tunnel based on a destination IP address.

The number of policy-based VPN tunnels that you can create is limited by the number of tunnels that the device supports.

The number of route-based VPN tunnels that you create is limited by the number of st0 interfaces (for point-to-point VPNs) or the number of tunnels that the device supports, whichever is lower.

With a policy-based VPN, although you can create numerous tunnel policies referencing the same VPN tunnel, each tunnel policy pair creates an individual IPsec SA with the remote peer. Each SA counts as an individual VPN tunnel.

Because the route, not the policy, determines which traffic goes through the tunnel, multiple policies can be supported with a single SA or VPN.

In a policy-based VPN, the action must be permit and must include a tunnel.

In a route-based VPN, the regulation of traffic is not coupled to the means of its delivery.

The exchange of dynamic routing information is not supported in policy-based VPNs.

Route-based VPNs support the exchange of dynamic routing information through VPN tunnels. You can enable an instance of a dynamic routing protocol, such as OSPF, on an st0 interface that is bound to a VPN tunnel.

If you need more granularity than a route can provide to specify the traffic sent to a tunnel, using a policy-based VPN with security policies is the best choice.

Route-based VPNs uses routes to specify the traffic sent to a tunnel; a policy does not specifically reference a VPN tunnel.

With a policy-based VPN tunnel, you can consider a tunnel as an element in the construction of a policy.

When the security device does a route lookup to find the interface through which it must send traffic to reach an address, it finds a route through a secure tunnel (st0) interface.

With a route-based VPN tunnel, you can consider a tunnel as a means for delivering traffic, and can consider the policy as a method for either permitting or denying the delivery of that traffic.

Understanding IKE and IPsec Packet Processing

An IPsec VPN tunnel consists of tunnel setup and applied security. During tunnel setup, the peers establish security associations (SAs), which define the parameters for securing traffic between themselves. (See IPsec Overview.) After the tunnel is established, IPsec protects the traffic sent between the two tunnel endpoints by applying the security parameters defined by the SAs during tunnel setup. Within the Junos OS implementation, IPsec is applied in tunnel mode, which supports the Encapsulating Security Payload (ESP) and Authentication Header (AH) protocols.

This topic includes the following sections:

Packet Processing in Tunnel Mode

IPsec operates in one of two modes—transport or tunnel. When both ends of the tunnel are hosts, you can use either mode. When at least one of the endpoints of a tunnel is a security gateway, such as a Junos OS router or firewall, you must use tunnel mode. Juniper Networks devices always operate in tunnel mode for IPsec tunnels.

In tunnel mode, the entire original IP packet—payload and header—is encapsulated within another IP payload, and a new header is appended to it, as shown in Figure 1. The entire original packet can be encrypted, authenticated, or both. With the Authentication Header (AH) protocol, the AH and new headers are also authenticated. With the Encapsulating Security Payload (ESP) protocol, the ESP header can also be authenticated.

Figure 1: Tunnel ModeTunnel Mode

In a site-to-site VPN, the source and destination addresses used in the new header are the IP addresses of the outgoing interface. See Figure 2.

Figure 2: Site-to-Site VPN in Tunnel ModeSite-to-Site VPN in Tunnel Mode

In a dial-up VPN, there is no tunnel gateway on the VPN dial-up client end of the tunnel; the tunnel extends directly to the client itself (see Figure 3). In this case, on packets sent from the dial-up client, both the new header and the encapsulated original header have the same IP address: that of the client’s computer.

Some VPN clients, such as the dynamic VPN client and Netscreen-Remote, use a virtual inner IP address (also called a “sticky address”). Netscreen-Remote enables you to define the virtual IP address. The dynamic VPN client uses the virtual IP address assigned during the XAuth configuration exchange. In such cases, the virtual inner IP address is the source IP address in the original packet header of traffic originating from the client, and the IP address that the ISP dynamically assigns the dial-up client is the source IP address in the outer header.

Figure 3: Dial-Up VPN in Tunnel ModeDial-Up VPN in Tunnel Mode

Distribution of IKE and IPsec Sessions Across SPUs

In the SRX5400, SRX5600, and SRX5800 devices, IKE provides tunnel management for IPsec and authenticates end entities. IKE performs a Diffie-Hellman (DH) key exchange to generate an IPsec tunnel between network devices. The IPsec tunnels generated by IKE are used to encrypt, decrypt, and authenticate user traffic between the network devices at the IP layer.

The VPN is created by distributing the IKE and IPsec workload among the multiple Services Processing Units (SPUs) of the platform. For site-to-site tunnels, the least-loaded SPU is chosen as the anchor SPU. If multiple SPUs have the same smallest load, any of them can be chosen as an anchor SPU. Here, load corresponds to the number of site-to-site gateways or manual VPN tunnels anchored on an SPU. For dynamic tunnels, the newly established dynamic tunnels employ a round-robin algorithm to select the SPU.

In IPsec, the workload is distributed by the same algorithm that distributes the IKE. The Phase 2 SA for a given VPN tunnel termination points pair is exclusively owned by a particular SPU, and all IPsec packets belonging to this Phase 2 SA are forwarded to the anchoring SPU of that SA for IPsec processing.

Multiple IPsec sessions (Phase 2 SA) can operate over one or more IKE sessions. The SPU that is selected for anchoring the IPsec session is based on the SPU that is anchoring the underlying IKE session. Therefore, all IPsec sessions that run over a single IKE gateway are serviced by the same SPU and are not load-balanced across several SPUs.

Table 3 shows an example of an SRX5000 line device with three SPUs running seven IPsec tunnels over three IKE gateways.

Table 3: Distribution of IKE and IPsec Sessions Across SPUs

SPU

IKE Gateway

IPsec Tunnel

SPU0

IKE-1

IPsec-1

IPsec-2

IPsec-3

SPU1

IKE-2

IPsec-4

IPsec-5

IPsec-6

SPU2

IKE-3

IPsec-7

The three SPUs have an equal load of one IKE gateway each. If a new IKE gateway is created, SPU0, SPU1, or SPU2 could be selected to anchor the IKE gateway and its IPsec sessions.

Setting up and tearing down existing IPsec tunnels does not affect the underlying IKE session or existing IPsec tunnels.

Use the following show command to view the current tunnel count per SPU: show security ike tunnel-map.

Use the summary option of the command to view the anchor points of each gateway: show security ike tunnel-map summary.

VPN Support for Inserting Services Processing Cards

SRX5400, SRX5600, and SRX5800 devices have a chassis-based distributed processor architecture. The flow processing power is shared and is based on the number of Services Processing Cards (SPCs). You can scale the processing power of the device by installing new SPCs.

In an SRX5400, SRX5600, or SRX5800 chassis cluster, you can insert new SPCs on the devices without affecting or disrupting the traffic on the existing IKE or IPsec VPN tunnels. When you insert a new SPC in each chassis of the cluster, the existing tunnels are not affected and traffic continues to flow without disruption.

Starting in Junos OS Release 19.4R1, on all SRX5000 Series devices chassis cluster, you can insert a new SRX5K-SPC3 (SPC3) or SRX5K-SPC-4-15-320 (SPC2) card to an existing chassis containing SPC3 card. You can only insert the cards in a higher slot than the existing SPC3 card on the chassis. You must reboot the node after the inserting SPC3 to activate the card. After the node reboot is complete, IPsec tunnels are distributed to the cards.

However, existing tunnels cannot use the processing power of the Service Processing Units (SPUs) in the new SPCs. A new SPU can anchor newly established site-to-site and dynamic tunnels. Newly configured tunnels are not, however, guaranteed to be anchored on a new SPU.

Site-to-site tunnels are anchored on different SPUs based on a load-balancing algorithm. The load-balancing algorithm is dependent on number flow threads each SPU is using. Tunnels belonging to the same local and remote gateway IP addresses are anchored on the same SPU on different flow RT threads used by the SPU. The SPU with the smallest load is chosen as the anchor SPU. Each SPU maintains number of flow RT threads that are hosted in that particular SPU. The number of flow RT threads hosted on each SPU vary based on the type of SPU.

Tunnel load factor = Number of tunnels anchored on the SPU / Total number of flow RT threads used by the SPU.

Dynamic tunnels are anchored on different SPUs based on a round-robin algorithm. Newly configured dynamic tunnels are not guaranteed to be anchored on the new SPC.

Starting in Junos OS Release 18.2R2 and 18.4R1, all the existing IPsec VPN features that are currently supported on SRX5K-SPC3 (SPC3) only will be supported on SRX5400, SRX5600, and SRX5800 devices when SRX5K-SPC-4-15-320 (SPC2) and SPC3 cards are installed and operating on the device in a chassis cluster mode or in a standalone mode.

When both SPC2 and SPC3 cards are installed, you can verify the tunnel mapping on different SPUs using the show security ipsec tunnel-distribution command.

Use the command show security ike tunnel-map to view the tunnel mapping on different SPUs with only SPC2 card inserted. The command show security ike tunnel-map is not valid in an environment where SPC2 and SPC3 cards are installed.

Inserting SPC3 Card: Guidelines and Limitations:

  • In a chassis cluster, if one of the nodes has 1 SPC3 card and the other node has 2 SPC3 cards, the failover to the node that has 1 SPC3 card is not supported.

  • You must insert the SPC3 or SPC2 in an existing chassis in a higher slot than a current SPC3 present in a lower slot.

  • For SPC3 ISHU to work, you must insert the new SPC3 card into the higher slot number.

  • On SRX5800 chassis cluster, you must not insert the SPC3 card in the highest slot (slot no. 11) due to the power and heat distribution limit.

  • We do not support SPC3 hot removal.

Table 4 summarizes the SRX5000 line of devices with SPC2 or SPC3 card that supports KMD or IKED process:

Table 4: KMD/IKED Process Support on SRX5000 Line of Devices

SRX5000 Line of Devices

Support for KMD or IKED Process

SRX5000 line of devices with only SPC2 card installed

Supports both KMD and IKED process.

SRX5000 line of devices with only SPC3 card installed

Supports only IKED process.

SRX5000 line of devices with both SPC2 and SPC3 card installed

Supports only IKED process.

Enabling IPsec VPN Feature Set on SRX5K-SPC3 Services Processing Card

SRX5000 line of devices with SRX5K-SPC3 card requires junos-ike package to install and to enable any of the IPsec VPN features. By default, junos-ike package is installed in Junos OS Releases 20.1R2, 20.2R2, 20.3R2, 20.4R1, and later for SRX5000 line of devices with RE3. As a result iked and ikemd process runs on the routing engine by default instead of IPsec key management daemon (kmd).

If you want to use KMD process to enable IPsec VPN features on SRX5000 line of devices without a SPC3 card, you must run the request system software delete junos-ike command. After running the command, you must reboot the device.

To check the installed junos-ike package, use the following command:

IPsec VPN Feature Support on SRX5000 Line of Devices with SRX5K-SPC3 and vSRX Instances with New Package

This topic provides you a summary of IPsec VPN features and configurations that are not supported of SRX5000 line of devices with SPC3 and on vSRX instances.

IPsec VPN feature is supported by two processes, iked and ikemd on SRX5K-SPC3 and vSRX instances. A single instance of iked and ikemd will run on the Routing Engine at a time.

By default, Junos-ike package is installed in Junos OS Releases 20.1R2, 20.2R2, 20.3R2, 20.4R1, and later for SRX5000 line of devices with RE3, and both the iked and ikemd process runs on the routing engine.

To restart ikemd process in the Routine Engine use the restart ike-config-management command.

To restart iked process in the Routing Engine use the restart ike-key-management command.

If you want to use KMD process to enable IPsec VPN features on SRX5000 line of devices without a SPC3 card, you must run the request system software delete junos-ike command. After running the command, you must reboot the device.

IPsec VPN Features Not Supported

To determine if a feature is supported by a specific platform or Junos OS release, refer Feature Explorer.

Table 5: IPsec VPN Feature Support on SRX Series Devices and vSRX Instances

Features

Support on SRX 5000 line of devices with SRX5K-SPC3 and vSRX Instances

Auto Discovery VPN (ADVPN).

No

AutoVPN Protocol Independent Multicast (PIM) point-to-multipoint mode.

No

AutoVPN RIP support for unicast traffic.

No

Bidirectional Forwarding Detection (BFD) over OSPFv3 routes on st0 interface.

Not supported on vSRX

Configuring forwarding class on IPsec VPNs.

No

Config Mode (draft-dukes-ike-mode-cfg-03).

No

Dead peer detection (DPD) and DPD gateway failover.

DPD gateway failover is not supported on vSRX.

AH transport modes.

No

Group VPN.

No

Idle timers for IKE.

No

Idle timers for IPsec SA.

No

Invalid SPI response.

No

Lifetime of IKE SA, in kilobytes.

No

Logical system.

No

Manual VPN.

No

Multicast traffic.

No

Neighbor Discovery Protocol (NDP) over st0 interfaces.

No

Packet size configuration for IPsec datapath verification.

No

Packet reordering for IPv6 fragments over tunnel.

No

Point-to-multipoint tunnel interfaces.

No

Policy-based IPsec VPN.

No

Remote Access.

No

Support group IKE IDs for Dynamic VPN configuration.

No

TOS/DSCP Honoring for IPsec (outer/Inner).

Supported on SRX and vSRX

Static routing .

Supported on SRX and vSRX

Dynamic (RIP, OSPF, BGP) routing No

VPN monitoring.

No

XAuth

No

Understanding Hub-and-Spoke VPNs

If you create two VPN tunnels that terminate at a device, you can set up a pair of routes so that the device directs traffic exiting one tunnel to the other tunnel. You also need to create a policy to permit the traffic to pass from one tunnel to the other. Such an arrangement is known as hub-and-spoke VPN. (See Figure 4.)

You can also configure multiple VPNs and route traffic between any two tunnels.

SRX Series devices support only the route-based hub-and-spoke feature.

Figure 4: Multiple Tunnels in a Hub-and-Spoke VPN ConfigurationMultiple Tunnels in a Hub-and-Spoke VPN Configuration
Release History Table
Release
Description
20.1R2
By default, junos-ike package is installed in Junos OS Releases 20.1R2, 20.2R2, 20.3R2, 20.4R1, and later for SRX5000 line of devices with RE3. As a result iked and ikemd process runs on the routing engine by default instead of IPsec key management daemon (kmd).