Video AirPlay from iOS to tvOS doesn't work with VPN on when enforceRoutes is enabled

Hey!

We discovered an unexpected side-effect of enabling enforceRoutes in our iOS VPN application - video airplay from iOS to tvOS stopped working (Unable to Connect popup appears instead).

Our flags combination is:

  • includeAllNetworks = false
  • enforceRoutes = true
  • excludeLocalNetworks = true

Interestingly, music content can be AirPlayed with the same conditions.

Also, video AirPlay from iOS device to the macOS works flawlessly.

Do you know if this is a known issue? Do you have any advice if we can fix this problem on our side, while keeping enforcRoutes flag enabled?

Thanks you for this very interesting post about VPNs and local networks. There is some great documentation about the vpn and network traffic that may help you.

https://developer.apple.com/documentation/networkextension/routing-your-vpn-network-traffic

I believe, you may be able t resolve this while keeping enforceRoutes = true, you must explicitly add Link-Local, Multicast, and Broadcast subnets to your excludedRoutes for both IPv4 and IPv6.

Even if your VPN only routes IPv4, AirPlay and AWDL rely heavily on IPv6 for discovery and peer-to-peer transport. If you don't provide IPv6 settings with exclusions, the strict routing policy can still disrupt the dual-stack network.

It’s been a while since I had to configure a VPN connection, and now is different with IP 6. Even if your tunnel does not carry IPv6 traffic, you should configure NEIPv6Settings specifically to exclude the IPv6 ranges that AWDL uses.

I would like to invite other developers that are working on VPN and how to route local traffic.

https://developer.apple.com/documentation/networkextension/routing-your-vpn-network-traffic#Route-additional-traffic-through-a-personal-VPN-or-packet-tunnel-provider

Albert Pascual
  Worldwide Developer Relations.

Video AirPlay from iOS to tvOS doesn't work with VPN on when enforceRoutes is enabled
 
 
Q