Skip to content

Commit 558108a

Browse files
Merge pull request #2573 from pperiyasamy/ipsec-nat-t-feature
OCPBUGS-40906: Implement IPsec NAT-Traversal encapsulation option
2 parents 6f02e29 + 50899e2 commit 558108a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bindata/network/ovn-kubernetes/common/008-script-lib.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,15 @@ data:
326326
local ipsec_encapsulation=false
327327
{{ if .OVNIPsecEnable }}
328328
ipsec=true
329+
# Check for rendered IPsec encapsulation type, if it's set with "Always",
330+
# then force NAT-T encapsulation option on the OVN.
331+
{{ if eq .OVNIPsecEncap "Always" }}
332+
ipsec_encapsulation=true
333+
{{ end }}
329334
# IBMCloud does not forward ESP (IP proto 50)
330335
# Instead, force IBMCloud IPsec to always use NAT-T
336+
# So for IBMCloud, NAT-T will be set irrespective of whatever
337+
# value set in the .OVNIPsecEncap parameter.
331338
if [ "{{.PlatformType}}" == "IBMCloud" ]; then
332339
ipsec_encapsulation=true
333340
fi

pkg/network/ovn_kubernetes.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo
293293
data.Data["OVNIPsecDaemonsetEnable"] = OVNIPsecDaemonsetEnable
294294
data.Data["OVNIPsecEnable"] = OVNIPsecEnable
295295
data.Data["IPsecServiceCheckOnHost"] = renderIPsecHostDaemonSet && renderIPsecContainerizedDaemonSet
296+
data.Data["OVNIPsecEncap"] = operv1.EncapsulationAuto
297+
if OVNIPsecEnable && c.IPsecConfig.Full != nil {
298+
data.Data["OVNIPsecEncap"] = c.IPsecConfig.Full.Encapsulation
299+
}
296300

297301
klog.V(5).Infof("IPsec: is MachineConfig enabled: %v, is East-West DaemonSet enabled: %v", data.Data["IPsecMachineConfigEnable"], data.Data["OVNIPsecDaemonsetEnable"])
298302

0 commit comments

Comments
 (0)