Example: Dynamic Endpoint Tunneling Configuration
Figure 1: IPSec Dynamic Endpoint Tunneling Topology Diagram

Figure 1 shows a local network N-1 located behind security gateway SG-1. SG-1 is a Juniper Networks router terminating dynamic peer endpoints. The tunnel termination address on SG-1 is 10.7.7.2 and the local network address is 172.16.1.0/24.
A remote peer router obtains addresses from an ISP pool and runs RFC-compliant IKE. Remote network N-2 has address 172.16.2.0/24 and is located behind security gateway SG-2 with tunnel termination address 10.7.7.1.
On Router SG-1, configure an IKE access profile to accept proposals from SG-2. Apply the interface identifier from the access profile to the inside services interface and apply the IKE access profile itself to the IPSec next-hop style service set.
Router SG-1
Verifying Your Work
To verify proper operation of a dynamic endpoint tunnel configured on the AS PIC, use the following command:
The following section shows output from this command used with the configuration example. The dynamically created rule _junos_ appears in the output, as well as the establishment of the inbound and outbound dynamically created tunnels.
user@router> show services ipsec-vpn
ipsec security-associations detail
Service set: dynamic_nh_ss Rule: _junos_ , Term: tunnel4, Tunnel index: 4 Local gateway: 10.7.7.2, Remote gateway: 10.7.7.1 Local identity: ipv4(any:0,[0..3]=10.255.14.63) Remote identity: ipv4(any:0,[0..3]=10.255.14.64) Direction: inbound , SPI: 428111023, AUX-SPI: 0 Mode: tunnel, Type: dynamic, State: Installed Protocol: ESP, Authentication: hmac-sha1-96, Encryption: 3des-cbc Soft lifetime: Expires in 27660 seconds Hard lifetime: Expires in 27750 seconds Anti-replay service: Enabled, Replay window size: 64 Direction: outbound , SPI: 4035429231, AUX-SPI: 0 Mode: tunnel, Type: dynamic, State: Installed Protocol: ESP, Authentication: hmac-sha1-96, Encryption: 3des-cbc Soft lifetime: Expires in 27660 seconds Hard lifetime: Expires in 27750 seconds Anti-replay service: Enabled, Replay window size: 64