NEPacketTunnel Pass-through

Hi,


I've built a basic NEPacketTunnelProvider that can successfully pass traffic from an iOS client to my VPN concentrator. I'm also able to configure the VPN tunnel to only route traffic to particular IPs or domains just like I can with the built in VPNs.


My question, though, is how I can inspect a packet from the packetFlow and then decide to not put that packet on my VPN tunnel. My core example is that I'd like to be able to identify latency and bandwidth sensitive traffic (like streaming video) and not pass this over the VPN so that the user gets the best experience.

One solution I thought of was to dynamically update the excluded IPs and then drop the packets and have the client attempt to reconnect. This has two problems. The first is that some clients give up too easily. The second, and more concerning, is that the exclusion list will grow without bounds unless I carefully manage it. This seems error prone.

My second attempt was to try to use a raw socket but as other posters have discovered the extension is not running as root and thus does not have permissions to create a raw socket.


So, my question: Is there a recommended way for the NEPacketTunnelProvider to choose to put some packets out the local interface (bond0) instead of the VPN tunnel?


Thanks,

-J

Accepted Answer

My question, though, is how I can inspect a packet from the packetFlow and then decide to not put that packet on my VPN tunnel.

The Network Extension architecture is just not set up to do that. I don’t think you’ll be able to achieve reasonable results given how things currently stand. I recommend that you file an enhancement describing your requirements.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

This has been filed as bug #

24816937

Hi Jeremy,


Please update if you find a solution to this issue, thanks!

This has been filed as bug #25897245


Eskimo, could you please give us an estimate to when this will be fixed (if at all) ?


Thank you!

Eskimo, could you please give us an estimate to when this will be fixed (if at all) ?

Sorry, but no. I’m not allowed to comment on The Future™.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
NEPacketTunnel Pass-through
 
 
Q