Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipsec: Add support of ipsec-interface, DPD options and authby #2478

Merged
merged 1 commit into from Dec 14, 2023

Conversation

cathay4t
Copy link
Member

@cathay4t cathay4t commented Nov 30, 2023

Add support of these libreswan Ipsec options:

  • ipsec-interface: 'yes'|'no'|u32
  • dpddelay: u64
  • dpdtimeout: u64
  • dpdaction: String
  • authby: String

Integration test case included but marked as OK to fail as
NetworkManager-libreswan supporting these options is not released yet.

@kubevirt-bot
Copy link
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@cathay4t cathay4t changed the title WIP: ipsec: Add support of ipsec-interface and DPD options ipsec: Add support of ipsec-interface and DPD options Nov 30, 2023
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/nmstate-nmstate-2478
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@cathay4t cathay4t changed the title ipsec: Add support of ipsec-interface and DPD options ipsec: Add support of ipsec-interface, DPD options and authby Dec 6, 2023
@cathay4t cathay4t marked this pull request as ready for review December 6, 2023 02:01
@@ -26,6 +26,7 @@ fn np_iface_type_to_nmstate(
nispor::IfaceType::Vxlan => InterfaceType::Vxlan,
nispor::IfaceType::Ipoib => InterfaceType::InfiniBand,
nispor::IfaceType::Tun => InterfaceType::Tun,
nispor::IfaceType::Other(v) if v == "xfrm" => InterfaceType::Xfrm,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not support the xfrm interface in nispor ?

Copy link
Member Author

@cathay4t cathay4t Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is urgent case, release new version of nispor take times.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can at least add a "TODO" comment ? to move it to nispor ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am creating a JIRA card to track this work :)

skip_serializing_if = "Option::is_none",
rename = "ipsec-interface",
default,
deserialize_with = "parse_ipsec_iface"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not easier to make ipsec_interface a struct with a bool and a number ? instead of this multitype "yes", "no", number string ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cathay4t do you have the NetworkManager ref around ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to follow exactly the same format, we can make it more "structural" like:

use-ipsec-interfae: true|false
ipsec-interface-number: 33

Copy link
Member Author

@cathay4t cathay4t Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. If you have better way of parsing yes|no|u32, please state.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to invent new stuff, just follow ipsec.conf manpage here. The section is named as libreswan, so I will refrain myself on abstracting stuff.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is patch to NetworkManager-libreswan for this : https://gitlab.gnome.org/GNOME/NetworkManager-libreswan/-/merge_requests/25/

I have scratch build in https://people.redhat.com/fge/ipsec_nmstate/

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only support integer or string now. no bool support.

Add support of these libreswan Ipsec options:
 * `ipsec-interface: 'yes'|'no'|u32`
 * `authby: String`
 * `dpddelay: u64`
 * `dpdtimeout: u64`
 * `dpdaction: String`

Integration test case included but marked as OK to fail as
NetworkManager-libreswan supporting these options is not released yet.

Signed-off-by: Gris Ge <fge@redhat.com>
Copy link
Member

@ffmancera ffmancera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cathay4t cathay4t merged commit c81fa8a into nmstate:base Dec 14, 2023
50 checks passed
@cathay4t cathay4t deleted the ipsec branch December 14, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants