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

WireGuard: wg-quick error for some configs #323

Open
matteodelabre opened this issue Mar 29, 2021 · 2 comments
Open

WireGuard: wg-quick error for some configs #323

matteodelabre opened this issue Mar 29, 2021 · 2 comments
Labels
bug Something isn't working packages Add or improve packages of the repository

Comments

@matteodelabre
Copy link
Member

Running wg-quick up <config> for configs containing the following keys causes errors:

  • DNS = …: the wg-quick script tries to call resolvconf, which is not available on the base system nor on Entware. The system’s DNS seems to be managed by systemd, so we would need to have resolvectl installed and symlink resolvconf to resolvectl for this to work.
  • AllowedIPs = …/0: using a wildcard in the AllowedIPs field causes the script to try using some tricks relying on policy-based routing to make all packets go through the WireGuard interface. I’m not sure why this is needed. In any case, the ip command bundled in BusyBox does not seem to be able to configure policy-based routing, which is what causes the error we’re seeing.

To fix these issues, we could:

  • Patch the wg-quick script to inform users that the said keys are not supported.
  • Patch the wg-quick to use a workaround for honoring those keys.
  • Provide the missing utilities in some Toltec package.
@matteodelabre matteodelabre added bug Something isn't working packages Add or improve packages of the repository labels Mar 29, 2021
@matteodelabre
Copy link
Member Author

The ip-full package from Entware provides a full-featured ip command supporting policy based routing. The following command, issued by wg-quick, fails, though (which suggests that the kernel does not support it).

[#] ip -4 rule add not fwmark 51820 table 51820
RTNETLINK answers: Operation not supported

@matteodelabre
Copy link
Member Author

Continuing the investigation around wildcards in the AllowedIPs field: before it was changed to rely on policy based routing, the script used to create two /1 routes and invoke an utility called tungate to enforce the routing of packets through these routes. Note that this is IPv4 only, but the comments say it should be easy to adapt to IPv6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working packages Add or improve packages of the repository
Projects
None yet
Development

No branches or pull requests

1 participant