netmaker icon indicating copy to clipboard operation
netmaker copied to clipboard

[Bug]: Wireguard external client on Linux are failing

Open Doooooo0o opened this issue 3 years ago • 0 comments

Contact Details

https://github.com/theonlydoo

What happened?

Using a single node netmaker instance for both ingress and egress. :warning: your netmaker instance has to be on another network (i.e. on the internet).

  1. Configure your instance to be an egress gateway for network ranges as mentionned in the documentation
  2. activate ingress gateway on the same node
  3. generate an external client configuration.
  4. download your external config on a client and run sudo wg-quick up mysuperconf.conf

Witness a full Internet loss.

:wrench: to fix this situation, client config generation should add those two lines:

PreUp = bash -c "ip r add $templated_and_known_public_ip_address $(ip r get 1.1.1.1|awk -F 'src' '{ print $1 }'|awk -F '1.1.1.1' '{ print $2 }')"
PostDown = bash -c "ip r del $templated_and_known_public_ip_address $(ip r get 1.1.1.1|awk -F 'src' '{ print $1 }'|awk -F '1.1.1.1' '{ print $2 }')"

Note: I'm not using a straightforward awk because sometimes DHCP leases are adding some stuff at the end of the line. (i.e. metric, etc.)

This is not necessary on Android (I haven't had the occasion to try it out on iOS), since WG client is doing its own thing.

Version

v0.14.1

What OS are you using?

Linux, Unlisted

Relevant log output

No response

Contributing guidelines

  • [X] Yes, I did.

Doooooo0o avatar Jun 03 '22 13:06 Doooooo0o