You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ovs-appctl -t ovs-monitor-ipsec tunnels/show always reports that there are no active connection (at least when using strongSwan), even when ipsec status shows active connections and traffic is encrypted as expected across VMs.
ovs-appctl -t ovs-monitor-ipsec tunnels/show
/# ovs-appctl -t ovs-monitor-ipsec tunnels/show
Interface name: ol-plane-a39e0c v1 (CONFIGURED)
Tunnel Type: geneve
Local IP: %defaultroute
Remote IP: 172.18.0.4
Address Family: IPv4
SKB mark: None
Local cert: None
Local name: None
Local key: None
Remote cert: None
Remote name: None
CA cert: None
PSK: changeme
Ofport: 1
CFM state: Disabled
Kernel policies installed:
src 172.18.0.3/32 dst 172.18.0.4/32 proto udp dport 6081
src 172.18.0.3/32 dst 172.18.0.4/32 proto udp dport 6081
src 172.18.0.3/32 dst 172.18.0.4/32 proto udp sport 6081
src 172.18.0.3/32 dst 172.18.0.4/32 proto udp sport 6081
Kernel security associations installed:
IPsec connections that are active:
Interface name: worker2-a0d026 v1 (CONFIGURED)
Tunnel Type: geneve
Local IP: %defaultroute
Remote IP: 172.18.0.2
Address Family: IPv4
SKB mark: None
Local cert: None
Local name: None
Local key: None
Remote cert: None
Remote name: None
CA cert: None
PSK: changeme
Ofport: 2
CFM state: Disabled
Kernel policies installed:
src 172.18.0.3/32 dst 172.18.0.2/32 proto udp sport 6081
src 172.18.0.3/32 dst 172.18.0.2/32 proto udp sport 6081
src 172.18.0.3/32 dst 172.18.0.2/32 proto udp dport 6081
src 172.18.0.3/32 dst 172.18.0.2/32 proto udp dport 6081
Kernel security associations installed:
sel src 172.18.0.3/32 dst 172.18.0.2/32 proto udp sport 6081
sel src 172.18.0.2/32 dst 172.18.0.3/32 proto udp dport 6081
sel src 172.18.0.3/32 dst 172.18.0.2/32 proto udp dport 6081
sel src 172.18.0.2/32 dst 172.18.0.3/32 proto udp sport 6081
IPsec connections that are active:
The first (.*) subgroup will do a greedy match, so for example when tunnel_name is worker2-a0d026-out-1{4}, the code will use worker2-a0d026-out as the interface name. In turn, this means that this if statement will never evaluate to true, leading to an empty IPsec connections that are active list.
As a quick test, I added the ? modified to the regex ((.*?)), which makes it non-greedy, and I did get some output, although it was messy and clearly not what we'd like:
IPsec connections that are active:
worker2-a0d026-out-1{2}: 172.18.0.3/32[udp] === 172.18.0.2/32[udp/6081]
worker2-a0d026-in-1{1}: 172.18.0.3/32[udp/6081] === 172.18.0.2/32[udp]
worker2-a0d026-in-1[1]: ESTABLISHED 9 seconds ago, 172.18.0.3[172.18.0.3]...172.18.0.2[172.18.0.2]
worker2-a0d026-out-1{5}: 172.18.0.3/32[udp] === 172.18.0.2/32[udp/6081]
worker2-a0d026-in-1{6}: 172.18.0.3/32[udp/6081] === 172.18.0.2/32[udp]
My guess is that the parsing code for the ipsec status output has not changed in OVS in a long time, while the output format of the command has evolved.
I don't know if the command behaves correctly when libreSwan is used for IKE.
The text was updated successfully, but these errors were encountered:
Yeah, unfortunately parsing of the ipsec status is not very reliable as the format is not very stable.
Could you try a change similar to this one on your setup: openvswitch/ovs@2ee0f44 ? This change was made for Libreswan quite some time ago, but should probably be ported for strongSwan as well.
ovs-appctl -t ovs-monitor-ipsec tunnels/show
always reports that there are no active connection (at least when using strongSwan), even whenipsec status
shows active connections and traffic is encrypted as expected across VMs.ovs-appctl -t ovs-monitor-ipsec tunnels/show
ipsec status
ipsec statusall
IMO, this regex is the main issue: https://github.com/openvswitch/ovs/blob/481bc09794225b791c36c2790f7acd779a6ae0bb/ipsec/ovs-monitor-ipsec.in#L302
The first
(.*)
subgroup will do a greedy match, so for example whentunnel_name
isworker2-a0d026-out-1{4}
, the code will useworker2-a0d026-out
as the interface name. In turn, this means that this if statement will never evaluate to true, leading to an emptyIPsec connections that are active
list.As a quick test, I added the
?
modified to the regex ((.*?)
), which makes it non-greedy, and I did get some output, although it was messy and clearly not what we'd like:My guess is that the parsing code for the
ipsec status
output has not changed in OVS in a long time, while the output format of the command has evolved.I don't know if the command behaves correctly when libreSwan is used for IKE.
The text was updated successfully, but these errors were encountered: