Add ability to pass any nb_global option with the ipsec prefix to sb, which will get used by ovs-monitor-ipsec to configure IPsec backend. For example
ovn-nbctl set nb_global . options:ipsec_replay-window=128 ovn-nbctl set nb_global . options:ipsec_dpd-delay=30s ovn-nbctl set nb_global . options:ipsec_dpd-timeout=120s ovn-nbctl set nb_global . options:ipsec_salifetime=8h Reported-at: https://redhat.atlassian.net/browse/FDP-3029 Signed-off-by: Mairtin O'Loingsigh <[email protected]> --- Documentation/tutorials/ovn-ipsec.rst | 5 +++++ NEWS | 1 + controller/encaps.c | 13 +++++++++++++ tests/ovn-ipsec.at | 12 ++++++++++++ 4 files changed, 31 insertions(+) diff --git a/Documentation/tutorials/ovn-ipsec.rst b/Documentation/tutorials/ovn-ipsec.rst index aebd3e848..f9b58b9ba 100644 --- a/Documentation/tutorials/ovn-ipsec.rst +++ b/Documentation/tutorials/ovn-ipsec.rst @@ -166,6 +166,11 @@ You can also check the logs of the ``ovs-monitor-ipsec`` daemon and the IKE daemon to locate issues. ``ovs-monitor-ipsec`` outputs log messages to ``/var/log/openvswitch/ovs-monitor-ipsec.log``. +Any "ipsec_*" option such as the one below can be set and to configure the +underlying IPsec backend, which can simplify debug. + + $ ovn-nbctl set nb_global . options:ipsec_replay-window=128 + Bug Reporting ------------- diff --git a/NEWS b/NEWS index 9839d19b9..256e7eb17 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ Post v26.03.0 ------------- + - Added ability to set any 'ipsec_*' which will be passed IPsec backend. - Documented missing ovn-nbctl commands: "mirror-rule-add", "mirror-rule-del", "lr-nat-update-ext-ip", "ha-chassis-group-set-chassis-prio", "lsp-add-router-port", diff --git a/controller/encaps.c b/controller/encaps.c index 081fbe671..2a483c237 100644 --- a/controller/encaps.c +++ b/controller/encaps.c @@ -276,6 +276,19 @@ tunnel_add(struct tunnel_ctx *tc, if (forceencaps) { smap_add(&options, "ipsec_forceencaps", "yes"); } + + struct smap_node *node; + SMAP_FOR_EACH (node, &sbg->options) { + char ipsec_prefix[] = "ipsec_"; + if (!strncmp(ipsec_prefix, node->key, strlen(ipsec_prefix)) && + strcmp("ipsec_encapsulation", node->key) && + strcmp("ipsec_forceencaps", node->key)) { + const char *ipsec_option = smap_get(&sbg->options, node->key); + if (ipsec_option) { + smap_add(&options, node->key, ipsec_option); + } + } + } } if (is_ramp_tunnel(&chassis_rec->other_config)) { diff --git a/tests/ovn-ipsec.at b/tests/ovn-ipsec.at index 961fc643f..05fbced28 100644 --- a/tests/ovn-ipsec.at +++ b/tests/ovn-ipsec.at @@ -45,6 +45,10 @@ ovs-vsctl \ # Enable IPsec check ovn-nbctl set nb_global . ipsec=true check ovn-nbctl set nb_global . options:ipsec_encapsulation=true +check ovn-nbctl set nb_global . options:ipsec_replay-window=100 +check ovn-nbctl set nb_global . options:ipsec_dpd-delay=30s +check ovn-nbctl set nb_global . options:ipsec_dpd-timeout=120s +check ovn-nbctl set nb_global . options:ipsec_salifetime=8h check ovn-nbctl --wait=hv sync @@ -52,9 +56,17 @@ OVS_WAIT_UNTIL([test x`as hv2 ovs-vsctl get Interface ovn-hv1-0 options:remote_i AT_CHECK([as hv2 ovs-vsctl get Interface ovn-hv1-0 options:local_ip | tr -d '"\n'], [0], [192.168.0.2]) AT_CHECK([as hv2 ovs-vsctl get Interface ovn-hv1-0 options:remote_name | tr -d '\n'], [0], [hv1]) AT_CHECK([as hv2 ovs-vsctl get Interface ovn-hv1-0 options:ipsec_encapsulation | tr -d '\n'], [0], [yes]) +AT_CHECK([as hv2 ovs-vsctl get Interface ovn-hv1-0 options:ipsec_replay-window | tr -d '\n'], [0], ["100"]) +AT_CHECK([as hv2 ovs-vsctl get Interface ovn-hv1-0 options:ipsec_dpd-delay | tr -d '\n'], [0], ["30s"]) +AT_CHECK([as hv2 ovs-vsctl get Interface ovn-hv1-0 options:ipsec_dpd-timeout | tr -d '\n'], [0], ["120s"]) +AT_CHECK([as hv2 ovs-vsctl get Interface ovn-hv1-0 options:ipsec_salifetime | tr -d '\n'], [0], ["8h"]) OVS_WAIT_UNTIL([test x`as hv1 ovs-vsctl get Interface ovn-hv2-0 options:remote_ip | tr -d '"\n'` = x192.168.0.2]) AT_CHECK([as hv1 ovs-vsctl get Interface ovn-hv2-0 options:local_ip | tr -d '"\n'], [0], [192.168.0.1]) AT_CHECK([as hv1 ovs-vsctl get Interface ovn-hv2-0 options:remote_name | tr -d '\n'], [0], [hv2]) AT_CHECK([as hv1 ovs-vsctl get Interface ovn-hv2-0 options:ipsec_encapsulation | tr -d '\n'], [0], [yes]) +AT_CHECK([as hv1 ovs-vsctl get Interface ovn-hv2-0 options:ipsec_replay-window | tr -d '\n'], [0], ["100"]) +AT_CHECK([as hv1 ovs-vsctl get Interface ovn-hv2-0 options:ipsec_dpd-delay | tr -d '\n'], [0], ["30s"]) +AT_CHECK([as hv1 ovs-vsctl get Interface ovn-hv2-0 options:ipsec_dpd-timeout | tr -d '\n'], [0], ["120s"]) +AT_CHECK([as hv1 ovs-vsctl get Interface ovn-hv2-0 options:ipsec_salifetime | tr -d '\n'], [0], ["8h"]) AT_CLEANUP -- 2.54.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
