Page MenuHomeVyOS Platform

IPsec: 'reset vpn ipsec site-to-site peer' installs the passthrough child as an ESP SA and the VTI stops passing traffic
Open, HighPublicBUG

Description

Route-based peer with a 0.0.0.0/0 traffic selector (both ends VyOS, the reset runs on the initiator):

set interfaces vti vti10 address 10.99.80.2/30
set protocols static route 192.168.80.0/24 interface vti10
set vpn ipsec site-to-site peer L139-X connection-type initiate
set vpn ipsec site-to-site peer L139-X vti bind vti10
set vpn ipsec site-to-site peer L139-X default-esp-group L139-ESP
set vpn ipsec site-to-site peer L139-X tunnel 1 local prefix 0.0.0.0/0
set vpn ipsec site-to-site peer L139-X tunnel 1 remote prefix 0.0.0.0/0

For this tunnel VyOS renders a trap-only passthrough child:

L139-X-tunnel-1-passthrough {
    local_ts = 0.0.0.0/0
    remote_ts = 0.0.0.0/0
    start_action = trap
    mode = pass
}

Before the reset only L139-X-tunnel-1 is installed and traffic over the VTI works. After reset vpn ipsec site-to-site peer L139-X with strongSwan 6.0.7:

L139-X: #2, ESTABLISHED, IKEv2
  L139-X-tunnel-1: #2, reqid 1, INSTALLED, TUNNEL, ESP:AES_CBC-256/HMAC_SHA2_256_128
  L139-X-tunnel-1-passthrough: #4, reqid 2, INSTALLED, TUNNEL, ESP:AES_CBC-256/HMAC_SHA2_256_128/MODP_2048
ping 10.99.80.1 (far VTI)                 FAIL
ping -I 192.168.81.1 192.168.80.1         FAIL
traffic over the VTI after the reset
1.5.1 (strongSwan 5.9.11)     works 3/3, no passthrough SA
rolling (6.0.7)               lost 2/2, passthrough installed as ESP SA

On rolling it was still lost about 5 minutes after the reset (not read longer). Only the whole-peer reset does it; before the reset the passthrough child stays a trap.

Cause
reset_peer() in src/op_mode/ipsec.py re-initiates every child returned by _get_con_childsa_name_list() (vici_initiate_all_child_sa_by_ike()), including the -passthrough children, which are mode = pass / start_action = trap and should never be initiated. strongSwan 5.9.11 did not install them (the far end refused the child); strongSwan 6.0.7 negotiates them and installs a 0/0 ESP SA next to the real one.

Suggested fix
Leave -passthrough children out of the list that the whole-peer reset initiates; they are trap-only and are not meant to be negotiated.

Details

Version
rolling
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)