SRX

last person joined: yesterday 

Ask questions and share experiences about the SRX Series, vSRX, and cSRX.
Expand all | Collapse all

Juniper - Cisco IPIP tunnel over IPSEC transport

  • 1.  Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-12-2013 02:46

    I have some installations of cisco and mikrotik with IPIP tunnel between.

     

    Cisco with following config:

    Spoiler

    crypto isakmp key 111111 address 109.126.111.111 no-xauth
    crypto isakmp fragmentation
    crypto isakmp invalid-spi-recovery
    crypto isakmp keepalive 30
    !
    crypto ipsec transform-set dns-transform esp-3des esp-md5-hmac
    mode transport require
    crypto ipsec df-bit clear
    !
    crypto ipsec profile dns-ipsec
    set transform-set dns-transform

    !
    interface Tunnel10302
    ip address 172.23.0.6 255.255.255.252
    ip access-group DMZ_IN in
    ip access-group DMZ_OUT out
    ip mtu 1450
    ip ospf network point-to-point
    ip ospf cost 10
    ip ospf flood-reduction
    ip ospf mtu-ignore
    tunnel source 213.85.222.222
    tunnel mode ipip
    tunnel destination 109.126.111.111
    tunnel protection ipsec profile dns-ipsec #disabled
    !

     

    Now i need to add Juniper SRX650  to my network.

    I made following config:

     

    Spoiler

    interfaces {
    ge-0/0/0 {
    unit 0;
    }
    ip-0/0/0 {
    unit 1030 {
    tunnel {
    source 109.126.111.111;
    destination 213.85.222.222;
    path-mtu-discovery;
    }
    family inet {
    address 172.23.0.5/30;
    }
    }
    }
    ge-0/0/1 {
    unit 0 {
    family inet;
    }
    }
    ge-0/0/2 {
    unit 0 {
    family inet;
    }
    }
    ge-0/0/3 {
    vlan-tagging;
    }
    unit 600 {
    vlan-id 600;
    family inet {
    address 109.126.111.111/28;
    }
    }

     

    and i get bidirectional connectivity over IPIP tunnel

     

    Spoiler

    mistiq> ping 172.23.0.6
    PING 172.23.0.6 (172.23.0.6): 56 data bytes
    64 bytes from 172.23.0.6: icmp_seq=0 ttl=64 time=131.453 ms

     

    How i can setup ipsec on junos IPSEC in transport(?!) mode?

    All of docs which i find in KB, tells about IPSEC in tunnel mode over st0 interface. 

     

    Problem in that I have src=sa-src=109.126.111.111 and dst = sa-dst = 213.85.222.222 (Transport mode)

     

    Anybody can help me?
    Thanks for advice!



  • 2.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-12-2013 02:51

    Some update: I have OSPF routing inside IPIP tunnel and do not need in static routes

     

    State of IPIP tunnel:

     

    Spoiler

    Logical interface ip-0/0/0.1030 (Index 76) (SNMP ifIndex 529)
    Flags: Point-To-Point SNMP-Traps 0x0 IP-Header 213.85.222.222:109.126.111.111:4:df:64:00000000 Encapsulation: IPIP-NULL
    Input packets : 1749
    Output packets: 29
    Security: Zone: trust
    Allowed host-inbound traffic : bootp bfd bgp dns dvmrp igmp ldp msdp nhrp ospf pgm pim rip router-discovery rsvp sap vrrp dhcp finger ftp tftp
    ident-reset http https ike netconf ping reverse-telnet reverse-ssh rlogin rpm rsh snmp snmp-trap ssh telnet traceroute xnm-clear-text xnm-ssl lsping
    ntp sip r2cp
    Protocol inet, MTU: 1480
    Flags: Sendbcast-pkt-to-re
    Addresses, Flags: Is-Preferred Is-Primary
    Destination: 172.23.0.4/30, Local: 172.23.0.5

     



  • 3.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-12-2013 20:41

    Hi Mistiq,

     

    The SRX only supports Tunnel mode I'm afraid.



  • 4.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-12-2013 20:57

    Thanks! Ok what i may do to solve my problem?

     

    I need secure VPN between Cisco, Juniper and Mikrotik with OSPF routing over

     

    Problem:

    1) Mikrotik doesn't support LSA refresh over sham links

    2) Mikrotik doesn't support creation of virtual ipsec tunnels hence doesn't support OSPF timers

    3) I have Trunk with some vlans on GE interface But when i try to adjust Public IP on Loopback it does not work.

    set interfaces lo0 unit 0 family inet address 109.126.111.111/32 can`t reach default gateway behind vlan 600

    4) When i try to adjust  ge-0/0/2 into l2 mode (and physically move WAN Uplink to it):

    [edit interfaces ge-0/0/2 unit 0]
    'family'
    Ethernet-switching family not allowed on srx650:On-board Gig-E

     

    It is possible to make secure VPN with OSPF in my situation?

     



  • 5.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-13-2013 04:37

    @mistiq wrote:

    Thanks! Ok what i may do to solve my problem?

     

    I need secure VPN between Cisco, Juniper and Mikrotik with OSPF routing over

     

    Problem:

    1) Mikrotik doesn't support LSA refresh over sham links

    2) Mikrotik doesn't support creation of virtual ipsec tunnels hence doesn't support OSPF timers

    3) I have Trunk with some vlans on GE interface But when i try to adjust Public IP on Loopback it does not work.

    set interfaces lo0 unit 0 family inet address 109.126.111.111/32 can`t reach default gateway behind vlan 600

    4) When i try to adjust  ge-0/0/2 into l2 mode (and physically move WAN Uplink to it):

    [edit interfaces ge-0/0/2 unit 0]
    'family'
    Ethernet-switching family not allowed on srx650:On-board Gig-E

     

    It is possible to make secure VPN with OSPF in my situation?

     

     

    Without knowing all of your topology it's hard to say, but with regards to the loopback issue you mention, have you assigned the loopback interface to a security zone? You will require this if you are to source traffic from it.

     

    I'm not sure what you mean in 2 - what does virtual IPSEC tunnels mean with regards to OSPF Timers?  You mean Mikrotik doesn't support "route-based" VPN in Juniper terminology?



  • 6.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-13-2013 05:47

    Topology in simple example:

                                             tunnel1 OSPF cost 10 (Area0)

    area1 -- (J SRX)=== ============== ==================(Mikrotik rou) -- area2

                                             tunnel2 OSPF cost 40 (Area0)

     

     

    Between Juniper and Mikrotik two IPIP or GRE tunnel (main and backup) over different isp`s.

     

    Now Juniper has one ISP connection and one Public IP. (Endpoint to tunnel interface)

    Mikrotik has two ISP connections and two public IPs.

     

    I need to secure both tunnel. 

    In Knowlege Base mentioned that SRX can`t  have two encapsulation (IPSEC + GRE) on physical interface i.e. GE.

    For GRE Tunnel require some private IPs on loopback (lo0) as SRC tunnel address.

    I can make static route to tunnel DST (private) address of tunnel over st0 and DST be reachable.

     

    But Mikrotik haven`t virtual ipsec interface like st0 and i can`t make the route to IP on lo0 (Junipers tunnel src) and it can`t be reachable.

     

    Or i misunderstood this?

     



  • 7.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-14-2013 01:31

    Ok! I solve 1st problem with double encapsulation on phisical interface.

    I have PI and assign PI address on lo0.

     

    Here is my config:

     

    Spoiler

    version 11.2R4.3;
    system {

    }
    interfaces {
    gr-0/0/0 {
    unit 10302 {
    clear-dont-fragment-bit;
    tunnel {
    source 194.1.444.444; (My PI Address)
    destination 213.85.222.222; (Mikrotik Address)
    allow-fragmentation;
    }
    family inet {
    mtu 1476;
    address 172.23.0.5/30;
    }
    }
    }
    ge-0/0/3 {
    vlan-tagging;
    unit 71 {
    vlan-id 71;
    family inet {
    address 172.20.3.253/30;
    }
    }
    unit 73 {
    vlan-id 73;
    family inet {
    address 172.20.3.69/30;
    }
    }
    unit 600 {
    vlan-id 600;
    family inet {
    address 109.126.111.111/28 {
    primary;
    }
    }
    }
    lo0 {
    unit 0 {
    family inet {
    address 194.1.444.444/32;
    }
    }
    }
    st0 {
    unit 0 {
    family inet;
    }
    }
    }
    }
    routing-options {
    graceful-restart;
    static {
    route 10.0.29.0/24 next-hop 172.20.3.254;
    route 0.0.0.0/0 next-hop 109.126.111.123;
    route 194.1.444.0/24 discard;
    route 213.85.222.222/32 next-hop st0.0;
    }
    router-id 172.20.3.253;
    autonomous-system 12345;
    }
    protocols {
    bgp {
    group eBGP-ISP {
    description "ISP Peer";
    multihop;
    preference 20;
    local-address 109.126.111.111;
    export our-network;
    peer-as 54321;
    local-as 12345;
    neighbor 109.126.111.123 {
    graceful-restart;
    }
    neighbor 109.126.1.123;
    }
    }
    ospf {
    area 10.0.1.0 {
    interface ge-0/0/3.71 {
    hello-interval 5;
    dead-interval 10;
    }
    }
    }
    }
    policy-options {
    policy-statement defaut {
    then reject;
    }
    policy-statement our-network {
    from {
    route-filter 194.1.444.0/24 exact;
    }
    then accept;
    }
    }
    security {
    ike {
    traceoptions {
    file vpn-debug-ike;
    flag all;
    }
    respond-bad-spi 20;
    proposal IKE-PROP-DNS {
    authentication-method pre-shared-keys;
    dh-group group2;
    authentication-algorithm md5;
    encryption-algorithm 3des-cbc;
    lifetime-seconds 500;
    }
    policy ike-pol {
    mode main;
    proposals IKE-PROP-DNS;
    pre-shared-key ascii-text "$9$FAwxnApuO1RSrCAwewesdswexNVwg4n/9AO1hSr"; ## SECRET-DATA
    }
    gateway msk-mt2 {
    ike-policy ike-pol;
    address 213.85.222.222;
    external-interface ge-0/0/3.600;
    }
    }
    ipsec {
    proposal DNS-PROP {
    protocol esp;
    authentication-algorithm hmac-sha1-96;
    encryption-algorithm 3des-cbc;
    lifetime-seconds 500;
    }
    policy ipsec-pol {
    proposals DNS-PROP;
    }
    vpn vpn1 {
    bind-interface st0.10302;
    ike {
    gateway msk-mt2;
    proxy-identity {
    local 194.1.444.444/32;
    remote 213.85.222.222/32;
    }
    ipsec-policy ipsec-pol;
    }
    establish-tunnels immediately;
    }
    }
    screen {
    ids-option untrust-screen {
    icmp {
    ping-death;
    }
    ip {
    source-route-option;
    tear-drop;
    }
    tcp {
    syn-flood {
    alarm-threshold 1024;
    attack-threshold 200;
    source-threshold 1024;
    destination-threshold 2048;
    timeout 20;
    }
    land;
    }
    }
    }
    policies {
    from-zone trust to-zone untrust {
    policy trust-to-untrust {
    match {
    source-address any;
    destination-address any;
    application any;
    }
    then {
    permit;
    }
    }
    }
    from-zone trust to-zone trust {
    policy trust-to-trust {
    match {
    source-address any;
    destination-address any;
    application any;
    }
    then {
    permit;
    }
    }
    }
    default-policy {
    permit-all;
    }
    }
    traceoptions {
    file secur;
    flag all;
    }
    zones {
    security-zone trust {
    address-book {
    address 194.1.444.444 194.1.444.444/32;
    }
    host-inbound-traffic {
    system-services {
    all;
    }
    protocols {
    all;
    }
    }
    interfaces {
    ge-0/0/1.0;
    ge-0/0/3.71 {
    host-inbound-traffic {
    protocols {
    ospf;
    }
    }
    }
    ge-0/0/3.73;
    ge-0/0/3.600;
    lo0.0;
    gr-0/0/0.10302;
    st0.10302;
    }
    }
    security-zone untrust {
    screen untrust-screen;
    host-inbound-traffic {
    system-services {
    ike;
    }
    }
    interfaces {
    ge-0/0/0.0 {
    host-inbound-traffic {
    system-services {
    dhcp;
    tftp;
    }
    }
    }
    ge-0/0/2.0;
    }
    }
    }
    }
    vlans {
    vlan-600 {
    vlan-id 600;
    }
    vlan-71 {
    vlan-id 71;
    }
    vlan-73 {
    vlan-id 73;
    }
    }

     

     

     

    On Mikrotik Side:

     ip ipsec policy:

    Spoiler

    src-address=213.85.222.222/32 src-port=any dst-address=194.1.444.444/32
    dst-port=any protocol=all action=encrypt level=require ipsec-protocols=esp
    tunnel=yes sa-src-address=213.85.222.222 sa-dst-address=194.1.444.444 
    proposal=TEST priority=0

     

    Spoiler

    Peer:

    address=194.1.444.444/32 port=500 auth-method=pre-shared-key
    secret="KEY" generate-policy=no exchange-mode=main
    send-initial-contact=yes nat-traversal=no my-id-user-fqdn=""
    proposal-check=obey hash-algorithm=sha1 enc-algorithm=3des
    dh-group=modp1024 lifetime=8m20s lifebytes=0 dpd-interval=disable-dpd
    dpd-maximum-failures=1

     

    Proposal:

    name="TEST" auth-algorithms=md5 enc-algorithms=3des lifetime=30m
    pfs-group=none

     

     

    And i can see error in log:

     

    Spoiler

     

    SRX650_1% tail -f /var/log/vpn-debug-ike

    Mar 14 17:35:30 ike_st_i_cert: Start

    Mar 14 17:35:30 ike_st_i_private: Start

    Mar 14 17:35:30 ike_st_o_sa_values: Start

    Mar 14 17:35:30 194.1.444.444:500 (Responder) <-> 213.85.222.222:500 { b40004e9 69bca3fe - 4be3d9f7 7c4124a9 [-1] / 0x00000000 } IP; Error = No proposal chosen (14)

    Mar 14 17:35:30 ike_alloc_negotiation: Start, SA = { b40004e9 69bca3fe - 4be3d9f7 7c4124a9}

    Mar 14 17:35:30 ike_encode_packet: Start, SA = { 0xb40004e9 69bca3fe - 4be3d9f7 7c4124a9 } / 58b3b068, nego = 0

    Mar 14 17:35:30 ike_send_packet: Start, send SA = { b40004e9 69bca3fe - 4be3d9f7 7c4124a9}, nego = 0, src=194.1.444.444:500, dst = 213.85.222.222:500, routing table id = 0

    Mar 14 17:35:30 ike_delete_negotiation: Start, SA = { b40004e9 69bca3fe - 4be3d9f7 7c4124a9}, nego = 0

    Mar 14 17:35:30 ike_free_negotiation_info: Start, nego = 0

    Mar 14 17:35:30 ike_free_negotiation: Start, nego = 0

    Mar 14 17:35:40 ike_get_sa: Start, SA = { b40004e9 69bca3fe - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:35:54 ike_get_sa: Start, SA = { f49089c7 1e60f16f - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:35:54 ike_sa_allocate: Start, SA = { f49089c7 1e60f16f - 8a22d76f b0cb518e }

    Mar 14 17:35:54 ike_init_isakmp_sa: Start, remote = 213.85.222.222:500, initiator = 0

    Mar 14 17:35:54 ike_decode_packet: Start

    Mar 14 17:35:54 ike_decode_packet: Start, SA = { f49089c7 1e60f16f - 8a22d76f b0cb518e} / 00000000, nego = -1

    Mar 14 17:35:54 ike_decode_payload_sa: Start

    Mar 14 17:35:54 ike_decode_payload_t: Start, # trans = 1

    Mar 14 17:35:54 ike_st_i_vid: VID[0..16] = afcad713 68a1f1c9 ...

    Mar 14 17:35:54 The remote server at 213.85.222.222:500 is 'draft-ietf-ipsec-dpd-00.txt'

    Mar 14 17:35:54 Not setting PMDATA_PEER_IS_OURS for 213.85.222.222

    Mar 14 17:35:54 ike_st_i_sa_proposal: Start

    Mar 14 17:35:54 Local dest IP: ipv4(any:0,[0..3]=194.1.444.444)

    Mar 14 17:35:54 Unable to find ike gateway as remote peer:213.85.222.222 is not recognized.

    Mar 14 17:35:54 KMD_PM_P1_POLICY_LOOKUP_FAILURE: Policy lookup for Phase-1 [responder] failed for p1_local=ipv4(any:0,[0..3]=194.1.444.444) p1_remote=ipv4(any:0,[0..3]=213.85.222.222)

    Mar 14 17:35:54 ike_isakmp_sa_reply: Start

    Mar 14 17:35:54 ike_st_i_cr: Start

    Mar 14 17:35:54 ike_st_i_cert: Start

    Mar 14 17:35:54 ike_st_i_private: Start

    Mar 14 17:35:54 ike_st_o_sa_values: Start

    Mar 14 17:35:54 194.1.444.444:500 (Responder) <-> 213.85.222.222:500 { f49089c7 1e60f16f - 8a22d76f b0cb518e [-1] / 0x00000000 } IP; Error = No proposal chosen (14)

    Mar 14 17:35:54 ike_alloc_negotiation: Start, SA = { f49089c7 1e60f16f - 8a22d76f b0cb518e}

    Mar 14 17:35:54 ike_encode_packet: Start, SA = { 0xf49089c7 1e60f16f - 8a22d76f b0cb518e } / fc182401, nego = 0

    Mar 14 17:35:54 ike_send_packet: Start, send SA = { f49089c7 1e60f16f - 8a22d76f b0cb518e}, nego = 0, src=194.1.444.444:500, dst = 213.85.222.222:500, routing table id = 0

    Mar 14 17:35:54 ike_delete_negotiation: Start, SA = { f49089c7 1e60f16f - 8a22d76f b0cb518e}, nego = 0

    Mar 14 17:35:54 ike_free_negotiation_info: Start, nego = 0

    Mar 14 17:35:54 ike_free_negotiation: Start, nego = 0

    Mar 14 17:36:04 ike_get_sa: Start, SA = { f49089c7 1e60f16f - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:36:14 ike_get_sa: Start, SA = { f49089c7 1e60f16f - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:36:24 ike_get_sa: Start, SA = { f49089c7 1e60f16f - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:36:34 ike_get_sa: Start, SA = { f49089c7 1e60f16f - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:36:44 ike_get_sa: Start, SA = { f49089c7 1e60f16f - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:36:56 ike_get_sa: Start, SA = { 43dbd9e3 7958a462 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:36:56 ike_sa_allocate: Start, SA = { 43dbd9e3 7958a462 - 26041e5d 8d2e8e49 }

    Mar 14 17:36:56 ike_init_isakmp_sa: Start, remote = 213.85.222.222:500, initiator = 0

    Mar 14 17:36:56 ike_decode_packet: Start

    Mar 14 17:36:56 ike_decode_packet: Start, SA = { 43dbd9e3 7958a462 - 26041e5d 8d2e8e49} / 00000000, nego = -1

    Mar 14 17:36:56 ike_decode_payload_sa: Start

    Mar 14 17:36:56 ike_decode_payload_t: Start, # trans = 1

    Mar 14 17:36:56 ike_st_i_vid: VID[0..16] = afcad713 68a1f1c9 ...

    Mar 14 17:36:56 The remote server at 213.85.222.222:500 is 'draft-ietf-ipsec-dpd-00.txt'

    Mar 14 17:36:56 Not setting PMDATA_PEER_IS_OURS for 213.85.222.222

    Mar 14 17:36:56 ike_st_i_sa_proposal: Start

    Mar 14 17:36:56 Local dest IP: ipv4(any:0,[0..3]=194.1.444.444)

    Mar 14 17:36:56 Unable to find ike gateway as remote peer:213.85.222.222 is not recognized.

    Mar 14 17:36:56 KMD_PM_P1_POLICY_LOOKUP_FAILURE: Policy lookup for Phase-1 [responder] failed for p1_local=ipv4(any:0,[0..3]=194.1.444.444) p1_remote=ipv4(any:0,[0..3]=213.85.222.222)

    Mar 14 17:36:56 ike_isakmp_sa_reply: Start

    Mar 14 17:36:56 ike_st_i_cr: Start

    Mar 14 17:36:56 ike_st_i_cert: Start

    Mar 14 17:36:56 ike_st_i_private: Start

    Mar 14 17:36:56 ike_st_o_sa_values: Start

    Mar 14 17:36:56 194.1.444.444:500 (Responder) <-> 213.85.222.222:500 { 43dbd9e3 7958a462 - 26041e5d 8d2e8e49 [-1] / 0x00000000 } IP; Error = No proposal chosen (14)

    Mar 14 17:36:56 ike_alloc_negotiation: Start, SA = { 43dbd9e3 7958a462 - 26041e5d 8d2e8e49}

    Mar 14 17:36:56 ike_encode_packet: Start, SA = { 0x43dbd9e3 7958a462 - 26041e5d 8d2e8e49 } / 7333b661, nego = 0

    Mar 14 17:36:56 ike_send_packet: Start, send SA = { 43dbd9e3 7958a462 - 26041e5d 8d2e8e49}, nego = 0, src=194.1.444.444:500, dst = 213.85.222.222:500, routing table id = 0

    Mar 14 17:36:56 ike_delete_negotiation: Start, SA = { 43dbd9e3 7958a462 - 26041e5d 8d2e8e49}, nego = 0

    Mar 14 17:36:56 ike_free_negotiation_info: Start, nego = 0

    Mar 14 17:36:56 ike_free_negotiation: Start, nego = 0

    Mar 14 17:37:06 ike_get_sa: Start, SA = { 43dbd9e3 7958a462 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:37:16 ike_get_sa: Start, SA = { 43dbd9e3 7958a462 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:37:26 ike_get_sa: Start, SA = { 43dbd9e3 7958a462 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:37:36 ike_get_sa: Start, SA = { 43dbd9e3 7958a462 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:37:46 ike_get_sa: Start, SA = { 43dbd9e3 7958a462 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:38:00 ike_get_sa: Start, SA = { 9c50edbf 7bffac92 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:38:00 ike_sa_allocate: Start, SA = { 9c50edbf 7bffac92 - 054607ce c2818570 }

    Mar 14 17:38:00 ike_init_isakmp_sa: Start, remote = 213.85.222.222:500, initiator = 0

    Mar 14 17:38:00 ike_decode_packet: Start

    Mar 14 17:38:00 ike_decode_packet: Start, SA = { 9c50edbf 7bffac92 - 054607ce c2818570} / 00000000, nego = -1

    Mar 14 17:38:00 ike_decode_payload_sa: Start

    Mar 14 17:38:00 ike_decode_payload_t: Start, # trans = 1

    Mar 14 17:38:00 ike_st_i_vid: VID[0..16] = afcad713 68a1f1c9 ...

    Mar 14 17:38:00 The remote server at 213.85.222.222:500 is 'draft-ietf-ipsec-dpd-00.txt'

    Mar 14 17:38:00 Not setting PMDATA_PEER_IS_OURS for 213.85.222.222

    Mar 14 17:38:00 ike_st_i_sa_proposal: Start

    Mar 14 17:38:00 Local dest IP: ipv4(any:0,[0..3]=194.1.444.444)

    Mar 14 17:38:00 Unable to find ike gateway as remote peer:213.85.222.222 is not recognized.

    Mar 14 17:38:00 KMD_PM_P1_POLICY_LOOKUP_FAILURE: Policy lookup for Phase-1 [responder] failed for p1_local=ipv4(any:0,[0..3]=194.1.444.444) p1_remote=ipv4(any:0,[0..3]=213.85.222.222)

    Mar 14 17:38:00 ike_isakmp_sa_reply: Start

    Mar 14 17:38:00 ike_st_i_cr: Start

    Mar 14 17:38:00 ike_st_i_cert: Start

    Mar 14 17:38:00 ike_st_i_private: Start

    Mar 14 17:38:00 ike_st_o_sa_values: Start

    Mar 14 17:38:00 194.1.444.444:500 (Responder) <-> 213.85.222.222:500 { 9c50edbf 7bffac92 - 054607ce c2818570 [-1] / 0x00000000 } IP; Error = No proposal chosen (14)

    Mar 14 17:38:00 ike_alloc_negotiation: Start, SA = { 9c50edbf 7bffac92 - 054607ce c2818570}

    Mar 14 17:38:00 ike_encode_packet: Start, SA = { 0x9c50edbf 7bffac92 - 054607ce c2818570 } / d12e1745, nego = 0

    Mar 14 17:38:00 ike_send_packet: Start, send SA = { 9c50edbf 7bffac92 - 054607ce c2818570}, nego = 0, src=194.1.444.444:500, dst = 213.85.222.222:500, routing table id = 0

    Mar 14 17:38:00 ike_delete_negotiation: Start, SA = { 9c50edbf 7bffac92 - 054607ce c2818570}, nego = 0

    Mar 14 17:38:00 ike_free_negotiation_info: Start, nego = 0

    Mar 14 17:38:00 ike_free_negotiation: Start, nego = 0

    Mar 14 17:38:10 ike_get_sa: Start, SA = { 9c50edbf 7bffac92 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500

    Mar 14 17:38:20 ike_get_sa: Start, SA = { 9c50edbf 7bffac92 - 00000000 00000000 } / 00000000, remote = 213.85.222.222:500 

    Ike status:

    Spoiler

    SRX650_1> show security ike security-associations
    Index State Initiator cookie Responder cookie Mode Remote Address
    6461643 DOWN 2a3cbbce31a042a0 0000000000000000 Main 213.85.222.222

     

    what i am doing wrong?

    Thanks!



  • 8.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-14-2013 04:11

     

    I think the problem is you are trying to source the IPSEC tunnel from your loopback interface, when it's actually egressing via ge-0/0/3.600, so it will source from 109.126.111.111, which the mikrotik should be pointed at as well.

     

    You will then also need to put the ge-0/0/3.600 in the untrust zone too and make sure it can receive host-inbound-traffic system-service ike.

     

     

    As a side hint - if you click the Insert Code icon instead of the Insert Spoiler button when posting, your config will keep it's indentation formatting - it's heaps easier to read 😉



  • 9.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-14-2013 04:49

    I start a sniffer on Mikrotik WAN

    And see only a packet with src=194.1.444.444 dst = 213.85.111.111 proto 47 (GRE),

    Seems like IPSEC encapsulation are not working but I have no idea why

     

    PS: When i disable IPSEC encryption on both side (i.e del routing-options static route 213.85.111.111/32 next-hop st0.0 on juniper and disable ipsec policy om microtik) - GRE tunnel is work perfect.

     

    PPS: From Juniper:

    root@SRX650_1% tcpdump -i ge-0/0/3.600 host 213.85.222.222
    verbose output suppressed, use <detail> or <extensive> for full protocol decode
    Address resolution is ON. Use <no-resolve> to avoid any reverse lookup delay.
    Address resolution timeout is 4s.
    Listening on ge-0/0/3.600, capture size 96 bytes
    
    Reverse lookup for 213.85.222.222 failed (check DNS reachability).
    Other reverse lookup failures will not be reported.
    Use <no-resolve> to avoid reverse lookups on IP addresses.
    
    19:54:17.540920  In IP 213.85.222.222.isakmp > 194.1.444.444.isakmp: isakmp: phase 1 I ident: [|sa]
    19:54:27.539505  In IP 213.85.222.222.isakmp > 194.1.444.444.isakmp: isakmp: phase 1 I ident: [|sa]
    19:54:37.545242  In IP 213.85.222.222.isakmp > 194.1.444.444.isakmp: isakmp: phase 1 I ident: [|sa]
    19:54:47.542296  In IP 213.85.222.222.isakmp > 194.1.444.444.isakmp: isakmp: phase 1 I ident: [|sa]
    19:54:57.615436  In IP 213.85.222.222.isakmp > 194.1.444.444.isakmp: isakmp: phase 1 I ident: [|sa]
    19:54:57.619961 Out IP truncated-ip - 80 bytes missing! 194.1.444.444.isakmp > 213.85.222.222.isakmp: [|isakmp]
    19:55:03.899490 Out IP truncated-ip - 58 bytes missing! 194.1.444.444 > 213.85.222.222: IP 172.23.0.5 > 172.23.0.6: [|icmp] (gre encap)
    19:55:04.906241 Out IP truncated-ip - 58 bytes missing! 194.1.444.444 > 213.85.222.222: IP 172.23.0.5 > 172.23.0.6: [|icmp] (gre encap)
    19:55:05.913314 Out IP truncated-ip - 58 bytes missing! 194.1.444.444 > 213.85.222.222: IP 172.23.0.5 > 172.23.0.6: [|icmp] (gre encap)
    19:55:06.920301 Out IP truncated-ip - 58 bytes missing! 194.1.444.444 > 213.85.222.222: IP 172.23.0.5 > 172.23.0.6: [|icmp] (gre encap)
    19:55:07.616541  In IP 213.85.222.222.isakmp > 194.1.444.444.isakmp: isakmp: phase 1 I ident: [|sa]
    19:55:07.930860 Out IP truncated-ip - 58 bytes missing! 194.1.444.444 > 213.85.222.222: IP 172.23.0.5 > 172.23.0.6: [|icmp] (gre encap)
    19:55:08.937500 Out IP truncated-ip - 58 bytes missing! 194.1.444.444 > 213.85.222.222: IP 172.23.0.5 > 172.23.0.6: [|icmp] (gre encap)
    19:55:09.944593 Out IP truncated-ip - 58 bytes missing! 194.1.444.444 > 213.85.222.222: IP 172.23.0.5 > 172.23.0.6: [|icmp] (gre encap)
    

     



  • 10.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport
    Best Answer

    Posted 03-14-2013 16:48

    I will try and diagram this a bit better, but the reason it's not working is you are trying to launch the tunnel from your loopback instead of the actual external interface on the SRX, and on the Mikrotik side, you are trying to terminat the GRE tunnel on the same IP address as the IPSEC tunnel.  On the SRX side, you need to set it up like this:

        lo0.0            ge-0/0/3.600    |           |   untrust
    194.1.444.444       109.126.111.111  |           |213.85.222.222
          |                    |         |           |     |
          |                    |         |           |     |
          |                    ===st0.0================vpn==
          |                              |           |     |
          ====gr-0/0/0.0===============================gre==
                                    SRX  |           |  Mikrotik
    _____________________________________|           |_______________

     You have correctly put a route in that says to send traffic to the GRE endpoint, next-hop st0.0, so the GRE goes OVER the IPSEC tunnel and not directly via the internet.  The problem you have though is that if you are terminating both the IPSEC tunnel AND the GRE tunnel on the same IP on the Mikrotic, then this route will not work (because the route-lookup for the tunnel endpoint 213.85.222.222 will have the next-hop of the tunnel which isn't up yet).

     

    I think you need to configure a loopback interface on the Mikrotik and source your GRE tunnel from that interface, and then have a next-hop for it on the SRX side via the st0.0 interface.

     

    Does this make sense?  Hopefully I've explained it properly.

     



  • 11.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-14-2013 17:12

    Thaks for answer!

     

    You draw correct diagram that i try realize.

     

    But two problem in there:

     

    1) On Mikrotik i have provider assigned network (/30 for example) on physical wan interface and i cant`t reassign Public IP to loopback because i lost connectivity.

    2) In case when i use some private address as a source for GRE tunnel on Mikrotik i can`t create route to tunnel destination (Address on Juniper) over "somethig", because Mikrotik does not have virtual interface for ipsec (like st0 on Juniper) 

     

    Route like "routing-options static route 213.85.222.222/32 next-hop st0." fully impossible on Mikrotik.



  • 12.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-14-2013 22:06

    Ok i fully modify my Juniper config:

    interfaces {
        ge-0/0/0 {
            unit 0;
        }
        gr-0/0/0 {
            unit 10302 {
                clear-dont-fragment-bit;
                tunnel {
                    source 172.16.0.1;
                    destination 172.16.0.2;
                    allow-fragmentation;
                }
                family inet {
                    mtu 1436;
                    address 172.23.0.10/31;
                }                           
            }
            unit 600 {
                vlan-id 600;
                family inet {
                    address 109.126.111.111/28 {
                        primary;
                    }
                }
            }
        }
        lo0 {
            unit 0 {
                family inet {
                    address 172.16.0.1/24;
                }
            }
        }
        st0 {
            unit 0 {
                family inet;
            }
        }
    }
    routing-options {
        graceful-restart;
        static {
            route 10.0.29.0/24 next-hop 172.20.3.254;
            route 0.0.0.0/0 next-hop 109.126.111.123;
            route 194.1.240.0/24 discard;
            route 172.16.0.2/32 next-hop st0.0;
            route 172.23.0.11/32 next-hop gr-0/0/0.10302;
        }
        router-id 172.20.3.253;
    security {
        ike {
            traceoptions {
                file vpn-debug-ike;
                flag all;
            }
            respond-bad-spi;
            proposal IKE-PROP-DNS {
                description DNS-IPSEC-Prop;
                authentication-method pre-shared-keys;
                dh-group group2;
                authentication-algorithm md5;
                encryption-algorithm 3des-cbc;
                lifetime-seconds 500;
            }
            policy ike-pol {
                mode main;
                proposals IKE-PROP-DNS;
                pre-shared-key ascii-text "KEY"; ## SECRET-DATA
            }
            gateway msk-mt2 {
                ike-policy ike-pol;
                address 213.85.222.222;
                no-nat-traversal;
                local-identity inet 109.126.111.111;
                external-interface ge-0/0/3.600;
            }
        }
        ipsec {
            proposal DNS-PROP {             
                protocol esp;
                authentication-algorithm hmac-md5-96;
                encryption-algorithm 3des-cbc;
                lifetime-seconds 500;
            }
            policy ipsec-pol {
                proposals DNS-PROP;
            }
            vpn vpn1 {
                bind-interface st0.0;
                ike {
                    gateway msk-mt2;
                    proxy-identity {
                        local 172.16.0.1/32;
                        remote 172.16.0.2/32;
                        service any;
                    }
                    ipsec-policy ipsec-pol;
                }
                establish-tunnels immediately;
            }
        }
        screen {
            ids-option untrust-screen {
                icmp {
                    ping-death;
                }
                ip {
                    source-route-option;
                    tear-drop;
                }
                tcp {
                    syn-flood {
                        alarm-threshold 1024;
                        attack-threshold 200;
                        source-threshold 1024;
                        destination-threshold 2048;
                        timeout 20;
                    }
                    land;
                }
            }
        }
        policies {
            from-zone trust to-zone untrust {
                policy trust-to-untrust {
                    match {
                        source-address any;
                        destination-address any;
                        application any;
                    }
                    then {
                        permit;
                    }
                }
            }
            from-zone trust to-zone trust {
                policy trust-to-trust {
                    match {
                        source-address any;
                        destination-address any;
                        application any;
                    }
                    then {
                        permit;             
                    }
                }
            }
            default-policy {
                permit-all;
            }
        }
        traceoptions {
            file secur;
            flag all;
        }
        zones {
            security-zone trust {
                host-inbound-traffic {
                    system-services {
                        all;
                    }
                    protocols {
                        all;
                    }
                }
                interfaces {
                    ge-0/0/1.0;
                    ge-0/0/3.71 {
                        host-inbound-traffic {
                            protocols {
                                ospf;
                            }
                        }
                    }
                    ge-0/0/3.73;
                    lo0.0;
                    st0.0;
                }
            }
            security-zone untrust {
                screen untrust-screen;
                host-inbound-traffic {
                    system-services {
                        ike;
                    }
                    protocols {
                        all;
                    }
                }
                interfaces {
                    ge-0/0/0.0 {
                        host-inbound-traffic {
                            system-services {
                                dhcp;
                                tftp;
                            }
                        }
                    }
                    ge-0/0/2.0;
                    ge-0/0/3.600;
                    gr-0/0/0.10302;
                }
            }
        }
    }
    vlans {
        vlan-600 {
            vlan-id 600;
        }                                   
        vlan-71 {
            vlan-id 71;
        }
        vlan-73 {
            vlan-id 73;
        }
    }
    
    [edit]

     IPsec are Wokring:

     

    SRX650_1# run show security ike security-associations 
    Index   State  Initiator cookie  Responder cookie  Mode           Remote Address   
    6462781 UP     4aa13822cef1af1e  27d215f5106e41ec  Main           213.85.222.222 
    
    SRX650_1# run show security ipsec security-associations  
      Total active tunnels: 1
      ID    Algorithm       SPI      Life:sec/kb  Mon vsys Port  Gateway   
      <131073 ESP:3des/md5  84a541e9 288/  unlim   -   root 500   213.85.222.222  
      >131073 ESP:3des/md5  24bb2e1  288/  unlim   -   root 500   213.85.222.222  
    

     

    I can ping everthing exept tunnel IPs:

     

    myst@VL_SRX650_1# run ping 213.85.222.222 
    PING 213.85.222.222 (213.85.222.222): 56 data bytes
    64 bytes from 213.85.222.222: icmp_seq=0 ttl=54 time=120.096 ms
    ^C
    --- 213.85.222.222 ping statistics ---
    1 packets transmitted, 1 packets received, 0% packet loss
    round-trip min/avg/max/stddev = 120.096/120.096/120.096/0.000 ms
    
    [edit]
    myst@VL_SRX650_1# run ping 172.16.0.2        
    PING 172.16.0.2 (172.16.0.2): 56 data bytes
    64 bytes from 172.16.0.2: icmp_seq=0 ttl=64 time=116.688 ms
    ^C
    --- 172.16.0.2 ping statistics ---
    1 packets transmitted, 1 packets received, 0% packet loss
    round-trip min/avg/max/stddev = 116.688/116.688/116.688/0.000 ms
    
    [edit]
    myst@VL_SRX650_1# run ping 172.23.0.11   
    PING 172.23.0.11 (172.23.0.11): 56 data bytes
    ^C
    --- 172.23.0.11 ping statistics ---
    2 packets transmitted, 0 packets received, 100% packet loss
    
    [edit]
    

     

     



  • 13.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 03-14-2013 23:03

    Problem solved.

    I put interface gr-0/0/0.10302 onto untrust zone and set security to 

     untrust host-inbound-traffic system-services all
     untrust host-inbound-traffic protocols all

     

    Thanks for all!



  • 14.  RE: Juniper - Cisco IPIP tunnel over IPSEC transport

    Posted 10-01-2015 01:46

    Hi Mistiq, I deal with the same problem. Please can you attach a Mikrotik configuration also?

     

    Thanks a lot!