connect to client VPN with google compute engine

Multi tool use
Multi tool use


connect to client VPN with google compute engine



I am planning to use google compute engine as my development environment.



I am writing code for a client and the code to run needs to call the client database that is behind VPN.



I can connect to the VPN with my desktop as I have the config files.



How can I do the same with google compute engine? Basically I need to connect the instance to the vpn. (The client is using OpenVPN)



EDIT:
I have tried to do as suggested but when I do it the VM freezes completely (actually I think what happen is that the machine is not reachable anymore with ssh). Am I doing something wrong?



This is what I have tried:


lucapuggio@avora:~/avora_vpn/openvpn-files$ sudo openvpn AVORA-duo.conf
Mon Jul 2 17:26:41 2018 OpenVPN 2.4.0 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 18 2017
Mon Jul 2 17:26:41 2018 library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.08
Enter Auth Username: luca.puggini
Enter Auth Password: ******
Mon Jul 2 17:26:57 2018 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Mon Jul 2 17:26:57 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]54.77.214.131:1194
Mon Jul 2 17:26:57 2018 Socket Buffers: R=[212992->212992] S=[212992->212992]
Mon Jul 2 17:26:57 2018 UDP link local: (not bound)
Mon Jul 2 17:26:57 2018 UDP link remote: [AF_INET]54.77.214.131:1194
Mon Jul 2 17:26:57 2018 TLS: Initial packet from [AF_INET]54.77.214.131:1194, sid=25e8b375 7fc49f4a
Mon Jul 2 17:26:57 2018 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Mon Jul 2 17:26:58 2018 VERIFY OK: depth=1, C=GB, ST=London, L=London, O=Avora Limited, OU=IT, CN=vpn-aws.avora.io, name=AvoraOpenVPNKey, emailAddress=sysadmin@avora.io
Mon Jul 2 17:26:58 2018 VERIFY OK: depth=0, C=GB, ST=London, L=London, O=Avora Limited, OU=IT, CN=aws-avora-openvpn01, name=AvoraOpenVPNKey, emailAddress=sysadmin@avora.io
Mon Jul 2 17:26:59 2018 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Mon Jul 2 17:26:59 2018 [aws-avora-openvpn01] Peer Connection Initiated with [AF_INET]54.77.214.131:1194
Mon Jul 2 17:27:00 2018 SENT CONTROL [aws-avora-openvpn01]: 'PUSH_REQUEST' (status=1)
Mon Jul 2 17:27:00 2018 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS 8.8.8.8,route 10.9.8.1,topology net30,ping 10,ping-restart 120,ifconfig 10.9.8.102 10.9.8.101'
Mon Jul 2 17:27:00 2018 OPTIONS IMPORT: timers and/or timeouts modified
Mon Jul 2 17:27:00 2018 OPTIONS IMPORT: --ifconfig/up options modified
Mon Jul 2 17:27:00 2018 OPTIONS IMPORT: route options modified
Mon Jul 2 17:27:00 2018 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Mon Jul 2 17:27:00 2018 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Mon Jul 2 17:27:00 2018 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jul 2 17:27:00 2018 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Mon Jul 2 17:27:00 2018 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Mon Jul 2 17:27:00 2018 ROUTE_GATEWAY 10.128.0.1
Mon Jul 2 17:27:00 2018 TUN/TAP device tun0 opened
Mon Jul 2 17:27:00 2018 TUN/TAP TX queue length set to 100
Mon Jul 2 17:27:00 2018 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Mon Jul 2 17:27:00 2018 /sbin/ip link set dev tun0 up mtu 1500
Mon Jul 2 17:27:00 2018 /sbin/ip addr add dev tun0 local 10.9.8.102 peer 10.9.8.101



EDIT2:
Apparently the correct way to connect to a vpn from a remote server is to use something like:
lucapuggio_gmail_com@avora:~$ sudo openvpn --route-nopull --config Avora/openvpn-files/AVORA-duo.conf --ping 10 --daemon


lucapuggio_gmail_com@avora:~$ sudo openvpn --route-nopull --config Avora/openvpn-files/AVORA-duo.conf --ping 10 --daemon



but when I do that I am still not able to access to the local resources





Install OpenVPN on your GCE instance and configure it similarly to how you configured your desktop? Maybe I don't understand your question.
– Matt Wilbert
Jul 2 at 2:34





@MattWilbert I have edited the question
– Donbeo
Jul 2 at 17:31





Questions on professional server- or networking-related infrastructure administration are off-topic for Stack Overflow unless they directly involve programming or programming tools. You may be able to get help on Server Fault.
– tambre
2 days ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

1t05oz,U76wpgAhtHmH,K5 j8hH kwfpd9X,W4 YM57O,K1GKc d IlvnOph rHmS
EvoSoj3QoTXhgj Qk,ZIE

Popular posts from this blog

Rothschild family

Cinema of Italy