Gateway into VPN tunnel

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
valentino.b
OpenVpn Newbie
Posts: 5
Joined: Fri Mar 25, 2022 10:50 am

Gateway into VPN tunnel

Post by valentino.b » Fri Mar 25, 2022 11:01 am

Hi all, I write this post because I would like a clarification about "how" OpenVPN works

I use ExpressVPN or CyberGost or PrivateVPN or... (=VPNproviders) with my OpenVPN client and it works :D
Here shorturl.at/qtRW6 an example of a standard cfg file for OpenVPN client.

Just a clarification.
I have an ISP and I serf using the public IP of my ISP (checked with whatismyipaddress.com or DNSleaktest.com)
Using this .ovpn file, ALL my traffic goes to internet via VPNproviders
My public IP address becomes VPNproviders public address.

I use the VPN client (OpenVPN) on a daily basis to connect to my customer's servers.
My computer, in addition to having a private IP of my home network, takes
a private IP of my customer network.
In this way, I can reach all of customer's servers ;)

This works as long as I try to connect to customer's "local" servers because if I try
to go on the internet (to do a Google search, for example) my computer uses
the gateway of my ISP.
Due to this, my computer has
- public IP of my ISP (checked with whatismyipaddress.com or DNSleaktest.com)
- and private IPs of my local network + customer network (because VPN is active)

Now....
Using VPNproviders I understood that ALL traffic is routed through the VPNproviders and
this means that my public IP will become VPNproviders IP.
But reading the configuration file that I downloaded (linked above)
I didn't understand which commands allow VPNproviders to rotate all traffic through VPNproviders
So, VPNproviders become my new gateway.

Can you help me to understand?
There are some OpenVPN commands that are used for this goal (-route, -gateway, -metric, -vpn_gateway
- net_gateway, ....) but is not clear for me how VPNproviders ask to my OpenVPN client to use only the tunnel
for all traffic.

I hope you can help me to better understand.


Valentino

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

Re: Gateway into VPN tunnel

Post by TinCanTech » Fri Mar 25, 2022 3:00 pm

The server pushes --redirect-gateway

valentino.b
OpenVpn Newbie
Posts: 5
Joined: Fri Mar 25, 2022 10:50 am

Re: Gateway into VPN tunnel

Post by valentino.b » Mon Mar 28, 2022 2:37 pm

Thank you @TinCanTech
but into .ovpn file linked not exists --redirect-gateway

So, probably is a parameter server side.
Can you help me to identify what is needed?

valentino.b
OpenVpn Newbie
Posts: 5
Joined: Fri Mar 25, 2022 10:50 am

Re: Gateway into VPN tunnel

Post by valentino.b » Mon Mar 28, 2022 2:57 pm

I added push "redirect-gateway def1 bypass-dhcp" server side
but nothing changes :?

TinCanTech
OpenVPN Protagonist
Posts: 11139
Joined: Fri Jun 03, 2016 1:17 pm

Re: Gateway into VPN tunnel

Post by TinCanTech » Mon Mar 28, 2022 3:09 pm

valentino.b wrote:
Fri Mar 25, 2022 11:01 am
I use the VPN client (OpenVPN) on a daily basis to connect to my customer's servers
I am available for hire.

valentino.b
OpenVpn Newbie
Posts: 5
Joined: Fri Mar 25, 2022 10:50 am

Re: Gateway into VPN tunnel

Post by valentino.b » Mon Mar 28, 2022 5:32 pm

Using, server side

Code: Select all

push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
traffic does not travel to the new gateway (nor to the default gateway)

C:\>tracert www.google.it

www.google.it [142.251.209.35]

1 * * * Richiesta scaduta.
2 * * * Richiesta scaduta.

valentino.b
OpenVpn Newbie
Posts: 5
Joined: Fri Mar 25, 2022 10:50 am

Re: Gateway into VPN tunnel

Post by valentino.b » Mon Mar 28, 2022 8:00 pm

I solved. :mrgreen:
The «problem» is not linked to cfg file but in Windows settings

Post Reply