Description
A route-based (VTI) site-to-site peer with IPv4 and IPv6 traffic selectors in one CHILD_SA only carries IPv4 when the remote side is a Sophos Firewall (SFOS 22.0.2 MR-2). IPv6 over the tunnel does not work.
Version
VyOS 1.5.1
Configuration (relevant part)
set interfaces vti vti0 address '192.0.2.2/30' set interfaces vti vti0 address '2001:db8:1004::2/64' set vpn ipsec site-to-site peer peer1 vti bind 'vti0' set vpn ipsec site-to-site peer peer1 vti traffic-selector local prefix '0.0.0.0/0' set vpn ipsec site-to-site peer peer1 vti traffic-selector local prefix '::/0' set vpn ipsec site-to-site peer peer1 vti traffic-selector remote prefix '0.0.0.0/0' set vpn ipsec site-to-site peer peer1 vti traffic-selector remote prefix '::/0'
The Sophos side is a route-based connection with IP version "Dual".
Observed
The tunnel is established, but the CHILD_SA only contains IPv4:
peer1-vti: #1, reqid 1, INSTALLED, TUNNEL-in-UDP, ESP:AES_GCM_16-256
local 0.0.0.0/0
remote 0.0.0.0/0ip xfrm policy has policies for 0.0.0.0/0 only, ip -6 xfrm policy has none for the tunnel.
ping 2001:db8:1004::1 fails with Destination unreachable: Address unreachable.
Test
With only ::/0 as traffic selector (IPv4 prefixes removed), the CHILD_SA is established with local ::/0 / remote ::/0 and the IPv6 ping works (14.6 ms). So both families work, just not inside one CHILD_SA.
Cause
data/templates/ipsec/swanctl/peer.j2 renders exactly one child per VTI peer (<peer>-vti) and puts all prefixes of both families into one local_ts / remote_ts. The responder is allowed to narrow the traffic selectors (RFC 7296 section 2.9) and this Sophos picks one family. strongSwan does not retry with a second CHILD_SA for the rest.
Expected
A dual-stack VTI peer should be able to carry both families, also against peers that only accept one family per CHILD_SA.
Proposal
Add an option (for example vti traffic-selector split-by-family) that renders two children for the peer, one with the IPv4 prefixes and one with the IPv6 prefixes. Same if_id, same ESP group. Without the option nothing changes for existing peers.
Needs a look at src/op_mode/ipsec.py (only knows <peer>-vti) and at vti-up-down (called once per child).
Workaround
Two peers with two VTIs and different local IDs, one per address family.