Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring Dynamically Assigned Policy Based Tunnels

    This example shows how to configure dynamically assigned policy-based tunnels and contains the following sections.

    Requirements

    This example uses the following hardware and software components:

    • Three M Series, MX Series or T Series routers.
    • Junos OS Release 9.4 or later.

    Overview and Topology

    An IPsec policy for dynamic endpoints defines a combination of security parameters (IPsec proposals) used during IPsec negotiation between dynamic peer security gateways, in which the remote ends of tunnels do not have a statically assigned IP address.

    A policy based VPN is a configuration with a specific VPN tunnel referenced in a policy which acts as a Tunnel. You use a Policy-based VPN if the remote VPN device is a non-Juniper device and if you must access only one subnet or one network at the remote site, across the VPN.

    This example explains the IPsec dynamic endpoint tunneling topology as shown in Figure 1.

    Before you configure dynamically assigned tunnels, be sure you have:

    • A local network N-1 connected to a security gateway SG-1. The exit points must have a Juniper Networks router to terminate the static and dynamic peer endpoints. The tunnel termination address on SG-1 is 10.1.1.1 and the local network address is 172.16.1.0/24.
    • Two remote peer routers that obtain addresses from an ISP pool and run an RFC-compliant IKE. The remote network N-2 has the address 172.16.2.0/24 and is connected to the security gateway SG-2 with the tunnel termination address 10.2.2.2. The remote network N-3 has the address 172.16.3.0/24 and is connected to the security gateway SG-3 with the tunnel termination address 10.3.3.3.

    Figure 1: IPsec Dynamic Endpoint Tunneling Topology

    IPsec Dynamic Endpoint Tunneling Topology

    Configuration

    To configure dynamically assigned policy based tunnels, perform these tasks:

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

    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 SG1 router.

    Configuring Interfaces

    set interfaces ms-0/0/0 unit 0 family inetset interfaces ms-0/0/0 unit 1 family inetset interfaces ms-0/0/0 unit 1 service-domain insideset interfaces ms-0/0/0 unit 1 dial-options ipsec-interface-id demo-ipsec-interface-idset interfaces ms-0/0/0 unit 1 dial-options mode sharedset interfaces ms-0/0/0 unit 2 family inetset interfaces ms-0/0/0 unit 2 service-domain outside

    Configuring Access Profile

    set access profile demo-access-profile client * ike allowed-proxy-pair remote 172.16.2.0/24 local 172.16.1.0/24set access profile demo-access-profile client * ike allowed-proxy-pair remote 172.16.3.0/24 local 172.16.1.0/24set access profile demo-access-profile client * ike ascii-text keyfordynamicpeersset access profile demo-access-profile client * ike interface-id demo-ipsec-interface-id

    Configuring Service Set

    set services service-set demo-service-set next-hop-service inside-service-interface ms-0/0/0.1set services service-set demo-service-set next-hop-service outside-service-interface ms-0/0/0.2

    Configuring IPsec Properties

    set services ipsec-vpn ipsec proposal ipsec_proposal_demo1 protocol espset services ipsec-vpn ipsec proposal ipsec_proposal_demo1 authentication-algorithm hmac-sha1-96set services ipsec-vpn ipsec proposal ipsec_proposal_demo1 encryption-algorithm 3des-cbcset services ipsec-vpn ipsec policy demo2 perfect-forward-secrecy keys group2set services ipsec-vpn ipsec policy demo2 proposals ipsec_proposal_demo1set services ipsec-vpn ike proposal ike_proposal_demo1 authentication-method pre-shared-keysset services ipsec-vpn ike proposal ike_proposal_demo1 dh-group group2set services ipsec-vpn ike policy ike_policy_demo1 version 2set services ipsec-vpn ike policy ike_policy_demo1 proposals ike_proposal_demo1set services ipsec-vpn ike policy ike_policy_demo1 pre-shared-key ascii-text keyfordemo1

    Configuring Routing Instances

    set routing-instances demo-vrf instance-type vrfset routing-instances demo-vrf ms-0/0/0.1set routing-instances demo-vrf ms-0/0/0.2

    Configuring a Next-Hop SG1 Service-Set

    Step-by-Step Procedure

    Step-by-Step Procedure

    The following example requires you to navigate various levels in the configuration hierarchy.

    1. Configure the interfaces.
      [edit interfaces]user@router1# set interfaces ms-0/0/0 unit 0 family inetuser@router1# set interfaces ms-0/0/0 unit 1 family inetuser@router1# set interfaces ms-0/0/0 unit 1 service-domain insideuser@router1# set interfaces ms-0/0/0 unit 1 dial-options ipsec-interface-id demo-ipsec-interface-iduser@router1# set interfaces ms-0/0/0 unit 1 dial-options mode shareduser@router1# set interfaces ms-0/0/0 unit 2 family inetuser@router1# set interfaces ms-0/0/0 unit 2 service-domain outside
    2. Configure the access profile.
      [edit access]user@router1# set profile demo-access-profile client * ike allowed-proxy-pair remote 172.16.2.0/24 local 172.16.1.0/24user@router1# set profile demo-access-profile client * ike ascii-text keyfordynamicpeersuser@router1# set profile demo-access-profile client * ike interface-id demo-ipsec-interface-id
    3. Configure the services set.
      [edit services]user@router1# set service-set demo-service-set next-hop-service inside-service-interface ms-0/0/0.1user@router1# set service-set demo-service-set next-hop-service outside-service-interface ms-0/0/0.2
    4. Configure the IPsec properties.
      [edit services ipsec-vpn]user@router1#set ipsec proposal ipsec_proposal_demo1 protocol espuser@router1#set ipsec proposal ipsec_proposal_demo1 authentication-algorithm hmac-sha1-96user@router1#set ipsec proposal ipsec_proposal_demo1 encryption-algorithm 3des-cbcuser@router1#set ipsec policy demo2 perfect-forward-secrecy keys group2user@router1#set ipsec policy demo2 proposals ipsec_proposal_demo1user@router1#set ike proposal ike_proposal_demo1 authentication-method pre-shared-keysuser@router1#set ike proposal ike_proposal_demo1 dh-group group2user@router1#set ike policy ike_policy_demo1 version 2user@router1#set ike policy ike_policy_demo1 proposals ike_proposal_demo1user@router1#set ike policy ike_policy_demo1 pre-shared-key ascii-text keyfordemo1
    5. Configure the routing instances.
      [edit routing-instances]user@router1# set demo-vrf instance-type vrfuser@router1# set demo-vrf ms-0/0/0.1user@router1# set demo-vrf ms-0/0/0.2

    Results

    From configuration mode of Router 1, confirm your configuration by entering the show interfaces, show access, and show services commands. If the output does not display the intended configuration, repeat the instructions in this example to correct the configuration.

    interfaces {ms-0/0/0 {unit 0 {family inet;}unit 1 {family inet;service-domain inside;dial-options {ipsec-interface-id demo-ipsec-interface-id;mode shared;}}unit 2 {family inet;service-domain outside;}}}
    access {profile demo-access-profile client * {ike {allowed-proxy-pair {remote 172.16.2.0/24 local 172.16.1.0/24; #Set for Network 2 connected to Network 1remote 172.16.3.0/24 local 172.16.1.0/24; #Set for Network 3 connected to Network 1}pre-shared-key {ascii-text keyfordynamicpeers;}interface-id demo-ipsec-interface-id;}}}
    services {service-set demo-service-set {next-hop-service {inside-service-interface ms-0/0/0.1;outside-service-interface ms-0/0/0.2;}ipsec-vpn-options {local-gateway 1.1.1.1;ike-access-profile demo-access-profile;}}ipsec-vpn {ipsec {proposal ipsec_proposal_demo1 {protocol esp;authentication-algorithm hmac-sha1-96;encryption-algorithm 3des-cbc;}policy demo2 {perfect-forward-secrecy {keys group2;}proposals ipsec_proposal_demo1;}}ike {proposal ike_proposal_demo1 {authentication-method pre-shared-keys;dh-group group2;}policy ike_policy_demo1 {version 2;proposals ike_proposal_demo1;pre-shared-key ascii-text "$9$jokmT69pRhrz3hrev7Nik"; ## SECRET-DATA}}}}
    routing-instances {demo-vrf {instance-type vrf;interface ms-0/0/0.1;interface ms-0/0/0.2;}}

    Verification

    Verifying That the Next-Hop SG1 Service Set with Policy-Based Tunnels Is Created

    Purpose

    Verify that the next-hop SG1 service set with policy-based tunnels is created.

    Action

    From operational mode, enter the show route command.

    user@router1> show route
    demo-vrf.inet.0: .... # Routing instance
    172.11.0.0/24 *[Static/1]..
    	> via ms-0/0/0.1
    	172.12.0.0/24 *[Static/1]..
    > via ms-0/0/0.1

    From operational mode, enter the show services ipsec-vpn ipsec security-associations detail

    user@router1>show services ipsec-vpn ipsec security-associations detail
    rule: junos-dynamic-rule-0
    term: term-0
    local-gateway-address : 10.1.1.1 #Tunnel termination address on SG-1
    remote-gateway-address: 10.2.2.2 #Tunnel termination address on SG-2
    source-address : 0.0.0.0/0
    destination-address : 0.0.0.0/0
    ipsec-inside-interface: ms-0/0/0.1
    term: term-1
    local-gateway-address : 10.1.1.1 #Tunnel termination address on SG-1
    remote-gateway-address: 10.3.3.3 #Tunnel termination address on SG-3
    source-address : 0.0.0.0/0
    destination-address : 0.0.0.0/0
    IPsec Properties
    ipsec-inside-interface: ms-0/0/0.1
    match-direction: input

    Meaning

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

    Published: 2013-08-29