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

*-mesh-vpn-wireguard-vxlan: should not rely on proper A and AAAA records of VPN-Gateway #71

Open
maurerle opened this issue Nov 28, 2023 · 0 comments

Comments

@maurerle
Copy link
Member

maurerle commented Nov 28, 2023

The current checkuplink script does currently only work if the Wireguard-Gateway has a functional A and AAAA DNS-Entry.
This should be the case in general, but is a weird limitation.

if ip -6 route show table 1 | grep -q 'default via'
then
local ipv6
ipv6="$(gluon-wan nslookup "$gateway" | grep 'Address:\? [0-9]' | grep -E -o '([a-f0-9:]+:+)+[a-f0-9]+')"
echo "[$ipv6]$(echo "$peer_endpoint" | grep -E -oe ":[0-9]+$")"
else
local ipv4
ipv4="$(gluon-wan nslookup "$gateway" | grep 'Address:\? [0-9]' | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")"
echo "$ipv4$(echo "$peer_endpoint" | grep -E -oe ":[0-9]+$")"
fi

This results in the following shortcomings:

  1. if the client-wan has ipv6, but the gateway has no AAAA entry, then it will break
  2. if the wireguard-gateway is already given as an ipv4 address and not as a DNS entry, the nslookup fails
maurerle pushed a commit to ffac/community-packages that referenced this issue Nov 28, 2023
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

No branches or pull requests

1 participant