Split Tunnelling: Miracast (Wi-Fi Direct)

Official client software for OpenVPN Access Server and OpenVPN Cloud.
Post Reply
sunkai
OpenVpn Newbie
Posts: 5
Joined: Fri Aug 03, 2012 4:46 pm

Split Tunnelling: Miracast (Wi-Fi Direct)

Post by sunkai » Mon Oct 23, 2017 4:17 pm

Miracast is the de facto standard for screen sharing from mobile devices. It operates akin to "HDMI over Wi-Fi Direct".

The current behaviour of OpenVPN Connect (Android) is that local Miracast device discovery can occur whilst connected to a remote VPN, but connections between Miracast devices fail. It is also the case that existing Miracast connections will fail when a VPN connection is made.

Is there a configuration of OpenVPN Connect (Android) that will allow Miracast connections to be made, whilst directing all other traffic through the VPN (i.e. split tunnelling)?

N.B. the Miracast connection may be made using the same Wi-Fi radio as the WLAN connection that is routing WAN traffic.

P.S. the Android app for 3rd-party VPN provider, "PureVPN", purports to allow application-level split tunnelling.

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

Re: Split Tunnelling: Miracast (Wi-Fi Direct)

Post by TinCanTech » Mon Oct 23, 2017 7:26 pm

What IP addresses do you use for the Miracast link ?

sunkai
OpenVpn Newbie
Posts: 5
Joined: Fri Aug 03, 2012 4:46 pm

Re: Split Tunnelling: Miracast (Wi-Fi Direct)

Post by sunkai » Tue Oct 31, 2017 12:53 pm

TinCanTech wrote:
Mon Oct 23, 2017 7:26 pm
What IP addresses do you use for the Miracast link ?
Good point. Ultimately, the Miracast receiver is a IPv4 LAN gateway, so I should be able to tell OpenVPN to ignore that subnet's traffic.

In this case, the subnet is 192.168.203.* (chosen by the Miracast receiver's hardware manufacturer).

I will try adding a static route to my OpenVPN Connect configuration of the form:

Code: Select all

route 192.168.203.0 255.255.255.0 192.168.203.1
As long as the IP address selected by the Miracast receiver does not change, then this should work.

sunkai
OpenVpn Newbie
Posts: 5
Joined: Fri Aug 03, 2012 4:46 pm

Re: Split Tunnelling: Miracast (Wi-Fi Direct)

Post by sunkai » Tue Oct 31, 2017 1:05 pm

I tried adding the static route to my OVPN configuration file, but still failed to connect to the Miracast receiver whilst connected in OpenVPN.

Is the configuration form above incorrect?

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

Re: Split Tunnelling: Miracast (Wi-Fi Direct)

Post by TinCanTech » Tue Oct 31, 2017 1:35 pm

sunkai wrote:
Tue Oct 31, 2017 12:53 pm
In this case, the subnet is 192.168.203.* (chosen by the Miracast receiver's hardware manufacturer).
And what is the IP address of the phone while connected to wifi ?

sunkai
OpenVpn Newbie
Posts: 5
Joined: Fri Aug 03, 2012 4:46 pm

Re: Split Tunnelling: Miracast (Wi-Fi Direct)

Post by sunkai » Fri Nov 03, 2017 2:00 pm

TinCanTech wrote:
Tue Oct 31, 2017 1:35 pm
sunkai wrote:
Tue Oct 31, 2017 12:53 pm
In this case, the subnet is 192.168.203.* (chosen by the Miracast receiver's hardware manufacturer).
And what is the IP address of the phone while connected to wifi ?
The "Network Connections" Android app reports the client device's "Last Used Local IP" as fluctuating between:

192.168.203.59
192.168.0.225

N.B. this is during normal operation, without OpenVPN Connect enabled.

Post Reply