This article explains why some traffic is allowed through a route based VPN, even when the source or destination IP (or network) is not specified in proxy-identity .
proxy-identity
Two devices are directly connected, with VPN configuration as follows:
root@srx# show security ipsec <...Output Snipped...> vpn vpn1 { bind-interface st0.0; ike { gateway ikeg; proxy-identity { local 192.168.1.0/24; remote 192.168.2.0/24; service any; } ipsec-policy ipsecp; } establish-tunnels immediately; }
root@srx# show security ipsec <...Output Snipped...> vpn vpn1 { bind-interface st0.0; ike { gateway ikeg; proxy-identity { local 192.168.2.0/24; remote 192.168.1.0/24; service any; } ipsec-policy ipsecp; } establish-tunnels immediately; }
Loopback is configured on these devices and given routes:
root@240-POE-1# show interfaces lo0 unit 0 { family inet { address 192.168.4.1/32; } } [edit] root@240-POE-1# show routing-options static { route 192.168.3.1/32 next-hop st0.0; }
xroot@240-POE-2# show interfaces lo0 unit 0 { family inet { address 192.168.3.1/32; } } [edit] root@240-POE-2# show routing-options static { route 192.168.4.1/32 next-hop st0.0; }
root@srx# run show security flow session protocol icmp Session ID: 55490, Policy name: default-policy-00/2, Timeout: 2, Valid In: 192.168.4.1/0 --> 192.168.3.1/23053;icmp, If: st0.0, Pkts: 1, Bytes: 84 >>>>>Coming through st0 i.e. VPN Out: 192.168.3.1/23053 --> 192.168.4.1/0;icmp, If: .local..0, Pkts: 1, Bytes: 84 Session ID: 55492, Policy name: default-policy-00/2, Timeout: 4, Valid In: 192.168.4.1/1 --> 192.168.3.1/23053;icmp, If: st0.0, Pkts: 1, Bytes: 84 Out: 192.168.3.1/23053 --> 192.168.4.1/1;icmp, If: .local..0, Pkts: 1, Bytes: 84
When proxy-identity is configured, it is only used during the negotiation of the VPN. After the negotiation completes, the PFE module does not detect these proxy-identities. Hence once the VPN comes up, any traffic can go into the VPN.
The solution is to use traffic-selectors (introduced in Junos OS 12.1X46) as described here: Example: Configuring Traffic Selectors in a Route-Based VP . Traffic-selectors push the negotiated networks to the packet forwarding engine (PFE) module, and thus flow will only allow traffic configured in traffic selectors .
traffic-selectors
Traffic-selectors
traffic selectors