Allow key configuration for [ip6]gre[tap] tunnels (LP: #1966476)#274
Conversation
Codecov Report
@@ Coverage Diff @@
## main #274 +/- ##
==========================================
- Coverage 99.19% 99.07% -0.12%
==========================================
Files 61 61
Lines 11206 10862 -344
==========================================
- Hits 11116 10762 -354
- Misses 90 100 +10
Continue to review full report at Codecov.
|
|
The solution is working successfully for configuring a GRE tunnel with key. |
|
Thank you very much for the feedback/confirmation. I still need to find some time to polish up this PR (maybe add an integration tests) and get it landed. |
30f9572 to
0046f0a
Compare
|
I cleaned this PR up, added some integration tests (autopkgtest) and rebased on top of the current |
schopin-pro
left a comment
There was a problem hiding this comment.
LGTM :)
Small nitpick: adding the tests in a commit before adding the implementation means that you'll have a broken test suite in your history. This triggers my inner Git neat freak ;-)
Keys are not required, but optional, for any backend renderer.
243830a to
9e091de
Compare
|
Thanks for the review! I rebased on top of |
Description
The following example should configure a GRE tunnel between 172.16.4.2 and 172.16.1.2, with key 33490175. The effect should be like manually configured with: sudo ip tunnel add test1 mode gre local 172.16.4.2 remote 172.16.1.2 key 33490175.
However, the following Netplan configuration fails under Ubuntu 22.04 (latest development version, March 25, 2022):
Result of "sudo netplan generate": Error in network definition: gre1-255-255: 'input-key' is not required for this tunnel type
Some investigation into the sources of Netplan (src/validation.c -> https://github.com/canonical/netplan/blob/main/src/validation.c):
It seems that the cases NETPLAN_TUNNEL_MODE_GRE and NETPLAN_TUNNEL_MODE_IP6GRE are missing for systemd-networkd. According to systemd/systemd#12144, systemd-networkd should support configuration with keys since ca. 2 years.
Checklist
make checksuccessfully.make check-coverage).