S
S
savchenko912020-04-19 22:31:29
VPN
savchenko91, 2020-04-19 22:31:29

How to configure VPN on Google Cloud Platform so that Internet traffic does not go through the tunnel and I see DNS?

Server config

push "route 10.30.0.0 255.255.255.0"
push "dhcp-option DOMAIN cloud-dns-hostmaster.google.com"
push "dhcp-option DOMAIN ns-gcp-private.googledomains.com"
push "dhcp-option DNS 169.254.169.254"
local 10.30.0.5
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh.pem
auth SHA512
tls-crypt tc.key
topology subnet
server 10.8.0.0 255.255.255.0
;push "redirect-gateway def1 bypass-dhcp"
ifconfig-pool-persist ipp.txt
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem

client config
client
dev tun
proto udp
remote 77.77.777.77 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
auth SHA512
cipher AES-256-CBC
ignore-unknown-option block-outside-dns
block-outside-dns
verb 3


I used the most popular openvpn-install.sh script downloaded from Github. I did not change the client file, but added the first 3 lines about routing and DNS to the server file.
I commented out the push "redirect-gateway def1 bypass-dhcp" line because I don't want my Internet traffic to go through the tunnel. I need vpn solely to see the network and internal domains.
Surely you know that inside the network virtual machines can be accessed by domain name, for example: instancename.europe-west4-acproject-270619.internal
on my local machine, I can see the network and can ping VMs by internal IP, but not by domain names.
what to do? :-)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question