Skip to content

Wireguard#82

Closed
lxnt wants to merge 19 commits intocanonical:masterfrom
lxnt:wireguard
Closed

Wireguard#82
lxnt wants to merge 19 commits intocanonical:masterfrom
lxnt:wireguard

Conversation

@lxnt
Copy link
Contributor

@lxnt lxnt commented Mar 16, 2019

Description

preliminary.
add wireguard and l2tp support.

questions:

  • is it a good idea to put them into tunnels section at all
  • l2tp has interesting format for local_ip, so what should be done:
    • new keyword, not use existing local (as is done now)
    • reuse local, change its parser
  • wireguard has (optional) endpoint, should the remote key be reused for that?
  • coverage does not exclude glib, the results are useless (bionic). any tips?

Checklist

  • [ x] Runs make check successfully.
  • Retains 100% code coverage (make check-coverage).
  • [ x] New/changed keys in YAML format are documented.
  • (Optional) Closes an open bug in Launchpad.

@lxnt
Copy link
Contributor Author

lxnt commented Mar 16, 2019

l2tp's local address can be either ipv4 or ipv6 or one of 'auto, 'static' or 'dynamic' (for networkd)
wireguard remote address (endpoint) can be either ipv4, ipv6 or a hostname and must include port.

so the question is how to do that - reuse local and remote keys and move all verification to validate_tunnel() or have separate keys or even separate sections (not include them in "tunnels")

@lxnt
Copy link
Contributor Author

lxnt commented Mar 17, 2019

Tunnel address validation was reworked to allow for hostnames, ports and keywords.
now used for every other address too.

Dummy interfaces were added so that empty bridges can be forced up on networkd (by adding a dummy).

This is now feature-complete as far as I'm concerned. Please review the general idea.

@lxnt
Copy link
Contributor Author

lxnt commented Mar 17, 2019

No way to test l2tp due to https://github.com/lxc/lxd/issues/5439 at the moment.

Request overall review.

@lxnt lxnt marked this pull request as ready for review March 17, 2019 20:39
Copy link
Contributor

@cyphermox cyphermox left a comment

Choose a reason for hiding this comment

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

  • is it a good idea to put them into tunnels section at all

No issues at all, those do make sense as tunnels.

  • l2tp has interesting format for local_ip, so what should be done:
    Steve, what do you think? I think it would be best to keep the same key, but parse it differently for that tunnel type.

  • wireguard has (optional) endpoint, should the remote key be reused for that?
    One more for Steve. Reusing 'remote' seems like the most straightforward, but it might be confusing if common parlance for wireguard is to refer this as "endpoint" only.

  • coverage does not exclude glib, the results are useless (bionic). any tips?

Coverage reports work fine here and automated through codecov. Have you run 'make check-coverage'? This should generate a proper html report for you under test-coverage/C/; and it only contains the relevant bits.

Could you please add unit tests that test the various changes to config generation you made so we can be sure there are no regressions in other parts of the code than to handle tunnels? Then I'll gladly write integration tests, with your input on what would be a good way to test these (with lxd or without).

: netplan ID of the underlying device definition on which this VLAN gets
created.

## Properties for device type ``dummies:``
Copy link
Contributor

Choose a reason for hiding this comment

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

Please keep dummy interfaces separate, those are unrelated to L2TP / Wireguard tunnels.

Also, you couldn't know about this beforehand, but I have some different plans on how to address this particular device type :)

Copy link
Contributor

Choose a reason for hiding this comment

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

What I mean by this is that it probably should be in a completely separate PR, since it's not directly related to tunnels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, yes, I agree it doesn't belong here. It just was slapped on top in hurry, because of how systemd-networkd refuses to up the bridge interface if it doesn't contain at least one other interface.

Can you share your plans?

@lxnt
Copy link
Contributor Author

lxnt commented Mar 20, 2019

In the current form it reuses local/remote for l2tp and wireguard. In wireguard it also parses 'endpoint' as equivalent to 'remote' because I think this minimizes confusion.

re coverage - yes, I run check-coverage (btw it's broken on gcc8, but that's another topic)

The result on master branch looks like

Overall coverage rate:
  lines......: 21.4% (391 of 1830 lines)
  functions..: 33.9% (41 of 121 functions)

due to what I suspect --remove generate.info "/usr*" bit not working
so that every glib function is listed as not covered.
which makes writing tests let's say inconvenient

i'd just make a container with identical setup to codecov if I only knew what setup they have

EDIT: ok, it sort of works on xenial, so I'll use this for the time being.

@vorlonofportland
Copy link

vorlonofportland commented Mar 21, 2019 via email

@sil2100
Copy link
Contributor

sil2100 commented Apr 21, 2020

Since this was split to separate PRs, I think we might want to close this. Either me or Lukas will look at the new ones in the nearest time. Thanks!

@sil2100 sil2100 closed this Apr 21, 2020
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.

4 participants