[Solved] Android - Do not route through the VPN

Samples of working configurations.

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

Locked
RBE
OpenVpn Newbie
Posts: 6
Joined: Fri Jan 28, 2022 7:43 am

[Solved] Android - Do not route through the VPN

Post by RBE » Tue Feb 08, 2022 9:07 pm

Hi All.

I am experiencing an issue on Android and iOS where I am unable to browse the Internet when connected to my OpenVPN server. Connection to the server works perfectly, but if I wish to access the Internet I need to disconnect from the VPN. I have looked through all of the options in the OpenVPN Connect app and I cannot find anything that would account for this behavior. Must all traffic be routed through the VPN on such clients, or is a split connection still possible?

Android Client Config

# Config for OpenVPN 2.x
# Enables connection to GUI

management /data/user/0/de.blinkt.openvpn/cache/mgmtsocket unix
management-client
management-query-passwords
management-hold

setenv IV_GUI_VER "de.blinkt.openvpn 0.7.33"
setenv IV_SSO openurl,webauth,crtext
setenv IV_PLAT_VER "30 11 arm64-v8a motorola nairo moto g 5G plus"

tls-cert-profile preferred
machine-readable-output
allow-recursive-routing
ifconfig-nowarn

client
verb 4
connect-retry 2 300
resolv-retry 60
dev tun
remote XXX.XXX.XXX.XXX 1194 udp

<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<key>
-----BEGIN ENCRYPTED PRIVATE KEY-----
-----END ENCRYPTED PRIVATE KEY-----
</key>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<tls-crypt>
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-crypt>
route-ipv6 ::/0
route 0.0.0.0 0.0.0.0 vpn_gateway
nobind
remote-cert-tls server

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

Re: No Internet when connected to VPN

Post by TinCanTech » Tue Feb 08, 2022 11:22 pm

RBE wrote:
Tue Feb 08, 2022 9:07 pm
route 0.0.0.0 0.0.0.0 vpn_gateway
This makes everything go over the tunnel.

RBE
OpenVpn Newbie
Posts: 6
Joined: Fri Jan 28, 2022 7:43 am

Re: No Internet when connected to VPN

Post by RBE » Wed Feb 09, 2022 1:32 am

Knowing that it now becomes obvious where the problem lies. I unclicked the default IPv4 route button and now it all works as expected - thank you.

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

Re: [Solved] Android - Do not route through the VPN

Post by TinCanTech » Wed Feb 09, 2022 2:42 am

That is one example.

Others would be:
  • Do not use: redirect-gateway
From the server:
  • Do not use: push "route 0.0.0.0 0.0.0.0"
  • Do not use: push "redirect-gatway"
In the client
  • Use

    Code: Select all

     pull-filter ignore "redirect-gateway"
     pull-filter ignore "route 0.0.0.0 0.0.0.0" 

Locked