# Openvpn configuration to avoid the default redirection (all through the VPN)

**URL:** <https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519>\
**Category:** Router\
**Created:** [March 27, 2019, 7:41pm UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519 "2019-03-27T19:41:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![epersonal](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@epersonal](https://forum.gl-inet.com/u/epersonal)\
**Post date:** [March 27, 2019, 7:41pm UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/1 "2019-03-27T19:41:56Z")

</div>

Is there any openvpn client configuration to avoid the default redirection behavior (all through the VPN)?  
That is, once the VPN is connected, the router continues redirecting the traffic through the WAN (eth0).  
Then I will define specifically which networks I want to be redirected through the VPN (tun0)

---

<div class="post-metadata">

**Author:** ![kyson-lok](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/kyson-lok/32/185_2.png) [@kyson-lok](https://forum.gl-inet.com/u/kyson-lok)\
**Post date:** [March 28, 2019, 1:18am UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/2 "2019-03-28T01:18:23Z")

</div>

Yup, it is enabled by default in v3.x firmware.

Once you start the OpenVPN, regardless of the connection is established, will disable all data traffic forward toward WAN, so if the connection is lost, the LAN devices no Internet.

---

<div class="post-metadata">

**Author:** ![epersonal](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@epersonal](https://forum.gl-inet.com/u/epersonal)\
**Post date:** [March 28, 2019, 7:08am UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/3 "2019-03-28T07:08:38Z")

</div>

Thanks for your answer, but it is not than I need.  
I want to use the VPN to connect with a secondary network.  
Really, I want to keep the use my local gateway for internet access. Only would pass through the VPN (tun0), when access to the specific IPs of the remote network.

---

<div class="post-metadata">

**Author:** ![glitch](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/g/0ea827/32.png) [@glitch](https://forum.gl-inet.com/u/glitch)\
**Post date:** [March 28, 2019, 7:53am UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/4 "2019-03-28T07:53:49Z")

</div>

What router model? If you have a Slate (AR750S) there is a beta/test frimware for policy routing in the testing directory.

---

<div class="post-metadata">

**Author:** ![epersonal](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@epersonal](https://forum.gl-inet.com/u/epersonal)\
**Post date:** [March 28, 2019, 9:02am UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/5 "2019-03-28T09:02:22Z")

</div>

My router is the ar750, for this device I didn’t see any firmware of this type

I have another router (different manufacturer) and my OpenVPN config file (\*.ovpn) run fine, routing through the VPN only a specific range 10.8.0.0.

Contrary, in this router, this file routing al traffic through the VPN. I think it is due to a two definition in IP Route list (0 0.0.0.0/1 and 128.0.0.0/1 for the tun0) that appear after VPN connection. I tried to del them, but it maintains the same behavior.

---

<div class="post-metadata">

**Author:** ![kyson-lok](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/kyson-lok/32/185_2.png) [@kyson-lok](https://forum.gl-inet.com/u/kyson-lok)\
**Post date:** [April 1, 2019, 8:35am UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/6 "2019-04-01T08:35:38Z")

</div>

We had disabled LAN forward to WAN when OpenVPN is started, to avoid data leakage. In your usage scenario, you have to ssh to the router, and edit the file **/etc/init.d/startvpn** and **/etc/vpn.user**. Please delete or comment on those lines, and restart the VPN client, but it might has potential data leakage.

![image](https://forum-static.gl-inet.com/original/2X/3/3263ac3c9af57edd09a96daffd5446ac954bba63.png)

 ![image](https://forum-static.gl-inet.com/original/2X/e/e98f4bff2523a609340f2bfa12b19774f5688bc7.png)

---

<div class="post-metadata">

**Author:** ![epersonal](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/e/f14d63/32.png) [@epersonal](https://forum.gl-inet.com/u/epersonal)\
**Post date:** [April 1, 2019, 5:55pm UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/7 "2019-04-01T17:55:25Z")

</div>

Hi, kyson-lok  
Thank you so much for your help.  
Your advice works perfectly, and it does just what I wanted.

Thanks again  
Have a nice day

---

<div class="post-metadata">

**Author:** ![mcbsys](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/mcbsys/32/1266_2.png) [@mcbsys](https://forum.gl-inet.com/u/mcbsys)\
**Post date:** [April 3, 2019, 1:39am UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/8 "2019-04-03T01:39:26Z")

</div>

I also want the router on the WAN for Internet, and only LAN-to-LAN traffic over the VPN.

After implementing the above changes, the router can browse the Internet locally, and the VPN Server can connect to the router.

However, even though I have configured the VPN server to act as a router (IPEnableRouter = 1 on Windows), and after adding a static route to a desktop computer behind the VPN server, I am not able to ping the router from the desktop.

If I revert the changes to the **/etc/init.d/startvpn** and **/etc/vpn.user** files, I can once again ping the router from the desktop computer.

It seems that the routing or the firewall is not allowing multiple hops to get to the router.

---

<div class="post-metadata">

**Author:** ![Mark2](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/m/e19adc/32.png) [@Mark2](https://forum.gl-inet.com/u/Mark2)\
**Post date:** [January 2, 2020, 10:27pm UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/9 "2020-01-02T22:27:42Z")

</div>

Hey, are you planning to add an option to turn this feature on and off from the VPN page?  
It’s really annoying to have to disable it every time a new firmware is available!

---

<div class="post-metadata">

**Author:** ![r33a](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/r/6bbea6/32.png) [@r33a](https://forum.gl-inet.com/u/r33a)\
**Post date:** [January 24, 2020, 10:44pm UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/10 "2020-01-24T22:44:13Z")

</div>

Hi, it looks like wireguard has the same problem. What files do I need to edit?  
Thanks

---

<div class="post-metadata">

**Author:** ![bruce](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bruce/32/35649_2.png) [@bruce](https://forum.gl-inet.com/u/bruce)\
**Post date:** [October 29, 2025, 4:09am UTC](https://forum.gl-inet.com/t/openvpn-configuration-to-avoid-the-default-redirection-all-through-the-vpn/6519/11 "2025-10-29T04:09:52Z")

</div>


