<div dir="ltr">Hi,<div><br></div><div>I have a policy-based ipsec setting where I only have one end ready and we are waiting for other end to connect to it. So, the VPN tunnel is not actually created yet. When we try to ping an address in remote subnet (presumably), the traffic could leak out to network through its interface. I checked and found this xfrm entry was missing.</div><div>







<p class="gmail-p1"><span class="gmail-s1"># ip xfrm policy<br></span>src <a href="http://10.100.0.0/16">10.100.0.0/16</a> dst <a href="http://10.200.0.0/16">10.200.0.0/16</a> <br>dir out priority 2608 <br>tmpl src 0.0.0.0 dst 0.0.0.0<br>proto esp reqid 0 mode transport</p></div><div>When this entry exists, pkt will be dropped as expected.</div><div><br></div><div>If I have all config ready and do a "ipsec start", that entry is added and pkt go dropped. If I do a ipsec auto --down/delete/add/up, I suppose we can get same behavior as "ipsec start", i.e. the entry is added. However, the entry will not be added and traffic get routed out. If the remote peer goes up and connect to this terminal, the entry will be added correctly. Do you know any reason why this behavior difference? How can we make sure no traffic gets leaked out while we are waiting for the peer to connect?</div><div><br></div><div>I do see the following log when the entry is not added.</div><div><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">May 3 22:29:08 vvr-10-69-244-34 pluto</span><span class="error" style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">[22363]</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">: vpn-5483483: WARNING: using a weak secret (PSK)</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">May 3 22:29:08 vvr-10-69-244-34 pluto</span><span class="error" style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">[22363]</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">: vpn-5483483: "conn_vpn-5483483-tunnel-VPNRemoteRoutedSubnet-tunnel-10.200.0.0/16" #1: initiating Main Mode</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">May 3 22:29:08 vvr-10-69-244-34 pluto</span><span class="error" style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">[22363]</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">: vpn-5483483: "conn_vpn-5483483-tunnel-VPNRemoteRoutedSubnet-tunnel-10.200.0.0/16": <b>deleting</b> non-instance connection</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">May 3 22:29:08 vvr-10-69-244-34 pluto</span><span class="error" style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">[22363]</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">: vpn-5483483: "conn_vpn-5483483-tunnel-VPNRemoteRoutedSubnet-tunnel-10.200.0.0/16" #1: <b>deleting</b> state (STATE_MAIN_I1)</span><br style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)"><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">May 3 22:29:08 vvr-10-69-244-34 pluto</span><span class="error" style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">[22363]</span><span style="color:rgb(51,51,51);font-family:arial,sans-serif;font-size:14px;background-color:rgb(245,245,245)">: vpn-5483483: added connection description "conn_vpn-5483483-tunnel-VPNRemoteRoutedSubnet-tunnel-10.200.0.0/16"</span><br></div><div><br></div><div>The "deleting .." was not there when we do "ipsec start". Not sure if the SPD policy entry was deleted during the time. (in both cases, remote peer is not ready or does not exist)</div><div><br></div><div><br></div><div>Thanks,</div><div>Xinwei</div><div><br></div><div><br></div><div><br></div></div>