Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Manual Security Associations

Example: Configuring Manual SAs

This example shows how to create an IPsec tunnel by using manual security associations (SAs), and contains the following sections:

Requirements

This example uses the following hardware and software components:

  • Four M Series, MX Series, or T Series routers with multiservices interfaces installed in them.

  • Junos OS Release 9.4 and later.

No special configuration beyond device initialization is required before you can configure this feature.

Overview and Topology

A security association (SA) is a simplex connection that enables two hosts to securely communicate with each other by means of IPsec. There are two types of SAs: manual SA and dynamic SA. This example explains a manual SA configuration.

Manual SAs require no negotiation; all values, including the keys, are static and specified in the configuration. Manual SAs use statically defined security parameter index (SPI) values, algorithms, and keys, and require matching configurations on both ends of the tunnel. Each peer must have the same configured options for communication to take place.

Manual SAs are best suited for small, static networks where the distribution, maintenance, and tracking of keys are not difficult.

Topology

Figure 1 shows an IPsec topology that contains a group of four routers: Routers 1, 2, 3, and 4.

Figure 1: Manual SA TopologyManual SA Topology

Routers 2 and 3 establish an IPsec tunnel by using a multiservices PIC and manual SA settings. Routers 1 and 4 provide basic connectivity and are used to verify that the IPsec tunnel is operational.

Configuration

This example uses four routers, and involves the following configurations:

  • Routers 1 and 4 are configured for basic OSPF connectivity with Routers 2 and 3 respectively.

  • Routers 2 and 3 are configured for OSPF connectivity with Routers 1 and 4 respectively. Routers 2 and 3 are also configured to create an IPsec tunnel by using manual SAs between these two routers. To direct traffic to the IPsec tunnel through the multiservices interface, next-hop style service sets are configured on Routers 2 and 3, and the multiservices interfaces that are configured as the IPsec inside interface are added to the OSPF configuration on the respective routers.

Note:

The interface types shown in this example are for indicative purpose only. For example, you can use so- interfaces instead of ge- and sp- instead of ms-.

This section contains:

Configuring Router 1

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI, at the [edit] hierarchy level, of Router 1.

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure Router 1 for OSPF connectivity with Router 2:

  1. Configure an Ethernet interface and loopback interface.

  2. Specify the OSPF area and associate the interfaces with the OSPF area.

  3. Configure the router ID.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols ospf, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration

Configuring Router 2

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI, at the [edit] hierarchy level, of Router 2.

Configuring Interfaces and OSPF Connectivity (with Router 1 and Router 3) on Router 2

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure OSPF connectivity and IPsec tunnel parameters on Router 2:

  1. Configure interface properties. In this step, you configure two Ethernet interfaces (ge-1/0/0 and ge-1/0/1), a loopback interface, and a multiservices interface (ms-1/2/0).

  2. Specify the OSPF area and associate the interfaces with the OSPF area.

  3. Configure the router ID.

  4. Configure an IPsec rule. In this step, you configure an IPsec rule and specify manual SA parameters, such as the remote-gateway address, authentication and encryption properties, and so on.

  5. Configure a next-hop style service set, specify the local-gateway address, and associate the IPsec VPN rule with the service set.

  6. Commit the configuration.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols ospf, show routing-options, and show services commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration

Configuring Router 3

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI, at the [edit] hierarchy level, of Router 3.

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To configure OSPF connectivity and IPsec tunnel parameters on Router 3:

  1. Configure interface properties. In this step, you configure two Ethernet interfaces (ge-1/0/0 and ge-1/0/1), a loopback interface, and a multiservices interface (ms-1/2/0).

  2. Specify the OSPF area and associate the interfaces with the OSPF area.

  3. Configure a router ID.

  4. Configure an IPsec rule. In this step, you configure an IPsec rule and specify manual SA parameters, such as the remote-gateway address, authentication and encryption properties, and so on.

  5. Configure a next-hop style service set, specify the local-gateway address, and associate the IPsec VPN rule with the service set.

  6. Commit the configuration.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols ospf, show routing-options, and show services commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration

Configuring Router 4

CLI Quick Configuration

To quickly configure this example, copy the following commands, paste them into a text file, remove any line breaks, change any details necessary to match your network configuration, and then copy and paste the commands into the CLI, at the [edit] hierarchy level, of Router 4.

Step-by-Step Procedure

The following example requires you to navigate various levels in the configuration hierarchy. For information about navigating the CLI, see Using the CLI Editor in Configuration Mode in the CLI User Guide.

To set up OSPF connectivity with Router 3

  1. Configure the interfaces. In this step, you configure an Ethernet interface (ge-1/0/1) and a loopback interface.

  2. Specify the OSPF area and associate the interfaces with the OSPF area.

  3. Configure the router ID.

  4. Commit the configuration.

Results

From configuration mode, confirm your configuration by entering the show interfaces, show protocols ospf, and show routing-options commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration

Verification

To confirm that the manual SA configuration is working properly, perform the following tasks:

Verifying Traffic Flow Through the IPsec Tunnel

Purpose

Verify that the IPsec tunnel carries traffic between Router 1 and Router 4.

Action

Issue a ping command from Router 1 to lo0 on Router 4.

Meaning

The output shows that Router 1 is able to reach Router 4 over the IPsec tunnel.

Verifying the Security Associations on Router 2

Purpose

Verify that the security associations are active on Router 2 and that the traffic is flowing over the IPsec tunnel.

Action
  • To verify that the security associations are active, Issue show services ipsec-vpn ipsec security-associations detail on Router 2.

  • To verify that traffic is traveling over the bidirectional IPsec tunnel, issue show services ipsec-vpn ipsec statistics on Router 2.

Meaning

The show services ipsec-vpn ipsec security-associations detail command output shows the SA properties that you configured.

The show services ipsec-vpn ipsec statistics command output shows the traffic flow over the IPsec tunnel.

Verifying the Security Associations on Router 3

Purpose

Verify the security associations and flow of traffic over the IPsec tunnel.

Action
  • To verify that the security associations are active, Issue show services ipsec-vpn ipsec security-associations detail on Router 3.

  • To verify that traffic is traveling over the bidirectional IPsec tunnel, issue show services ipsec-vpn ipsec statistics on Router 3.

Meaning

The show services ipsec-vpn ipsec security-associations detail command output shows the SA properties that you configured.

The show services ipsec-vpn ipsec statistics command output shows the traffic flow over the IPsec tunnel.