netmaker
netmaker copied to clipboard
[Bug]: Wireguard external client on Linux are failing
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).
- Configure your instance to be an egress gateway for network ranges as mentionned in the documentation
- activate ingress gateway on the same node
- generate an external client configuration.
- 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.