Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
136 views
in Technique[技术] by (71.8m points)

How do I get wireguard to resolve internal dns names on google compute engine

I have an internal DNS zone on Google Cloud Platform with an A record for dev.internal which points to the IP of the VM say 10.0.0.17. When I am on the GCP VM node/server via ssh I can ping dev.internal and it resolves to 10.0.0.17.

I now setup a wireguard peer with my laptop machine. My server side settings are:

[Interface]
Address = 192.168.69.1/24
ListenPort = 51820
PrivateKey = SERVER_KEY
PostUp = iptables -A FORWARD -i wg0 -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o ens4 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -o wg0  -j ACCEPT; iptables -t nat -D POSTROUTING  -o ens4 -j MASQUERADE

[Peer]
PublicKey = CLIENT_KEY
AllowedIPs = 192.168.69.2
PersistentKeepalive = 25

and my client side (laptop -I am using Ubuntu 20.01) settings are

[Interface]
Address = 192.168.69.2/32
PrivateKey = CLIENT_PRIVATE_KEY
DNS = 192.168.69.1

[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = 35.XX.XX.XX:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 21

I confirm that the client and server peer is up, I go to ifconfig.co or whatsmyip from client and it shows me the 35.XX.XX.XX (server) ip.

On the client side I want to now access the 10.0.0.17 IP by resolving through the dev.internal zone on the VM.

ping dev.internal
ping: dev.internal: Name or service not known

What do I need to set on either the client or the server so that the client will be able to resolve the IP pointed to by the internal zone?

On Google Cloud the internal resolver is at 169.254.169.254.

I have tried it with and without DNS = 192.168.69.1 in the client and get the same result.

question from:https://stackoverflow.com/questions/65922282/how-do-i-get-wireguard-to-resolve-internal-dns-names-on-google-compute-engine

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...