2

Does anyone know how to exclude "Chromecast" connection from VPN in Android? In simple when i connect my android device with Chromecast, the network for it particularly should go through normal route and not via VPN even if it is connected. I know there is no facility to exclude particular IPs in android using split tunnelling but there is a way to exclude it if we know the package name like i do for some of applications. Hence, once if I get the package name or particular IP address of "Chromecast", i can exclude it. Would love to discuss on it with someone who has technically worked on it.

Thanks in advance,

user45678
  • 1,504
  • 6
  • 29
  • 58

3 Answers3

2

If you have full control of the VPN service being used, it is simply a matter of calling addDisallowedApplication when building the VPN Tun interface. You simply supply the package name to the method to exclude it from the VPN.

If you do not have the package name, the solution would be to add each subnet individually by calling addRoute and exclude reserved networks.

I was in this exact predicament and by excluding localhost and private networks, I could use Chromecast while using VPN.

If you are not implementing the VPN service yourself, then I am afraid this answer will not be helpful.

Simon Langhoff
  • 1,395
  • 3
  • 18
  • 28
  • Did you have to exclude all Private networks segments? Do you know if there are security issues by adding those Routes? Thanks! – george_mx Feb 26 '18 at 22:20
0

I managed to make it work as you described but only with one VPN provider: ProtonVPN. If your VPN app proposes split tunnelling with exclusion based on IP, it should also work. This solution however doesn't use the package name (solution you suggested in your question). I hope it will still help...

The workaround is as follow:

  1. Switch on your Chromecast (needed for step 2);
  2. Identify the IP address of your Chromecast. The simplest way I found to do that is to log in to the router as an admin (192.168.1.1, don't forget to disconnect your VPN on the device you are using to access that address ;) ). There you will be able to find the list of the devices currently connected to the WiFi. Spot the Chromecast and the associated IP address (192.168.1.*);
  3. Go the settings of your VPN Android app and check for the split tunnelling feature. You will need to be disconnected from the VPN to change this setting.
  4. Add the Chromecast IP to the "Excluded IP addresses"

Now your VPN app will connect directly to the Chromecast when needed. Surprisingly (to me) I didn't need to add the Google Home app or the app that I'm casting to the excluded app list.

I guess that if you restart your router (some of them do that regurlarly by themeselves for update purpose) the IP associated to the Chromecast might change and you will need to re-do the operation. However switching off then on the Chromecast (with power supply interuption in the meantime) does not change the IP address of the Chromecast.

If somebody knows a way to add all the local addresses easily, please share it ;)

Source of the idea: https://www.reddit.com/r/ProtonVPN/comments/9riylh/chromecast_while_on_protonvpn/

Adam Michalik
  • 9,678
  • 13
  • 71
  • 102
adelille
  • 26
  • 4
0

If your VPN provider allows split tunneling using IP addresses (e.g., ProtonVPN), given that it is your Chromecast, another, simple, way to get the IP address of your Chromecast is via the Google Home app:

  1. Open the Google Home app.
  2. Tap on your Chromecast's tile.
  3. At the top right, tap on the gear icon (i.e., settings).
  4. Tap on "Device information".
  5. At the bottom of this page, under "Technical information", you will see the Chromecast's IP address.

This alternative way can be useful, for example, when you cannot connect to the router as an admin.