Hi, I'd like to write a network extension for a vpn product, that also filter several types of packets before they arrive to the tunnel represeted by the tunnel virtual interface (utun0)
Is there anyway I can set the packet filtering to occur before the tunnel ? is it the default case ?
Can I use the same network extension for both NEPacketTunnelProvider
and NEFilterPacketProvider
/ NEFilterDataProvider
?
thanks !
Is there anyway I can set the packet filtering to occur before the tunnel ? is it the default case ?
There is no API to guarantee that you will always receive the flows or packets in your content filter APIs (NEFilterPacketProvider
/ NEFilterDataProvider
) before they reach your packet tunnel. However, one technique that you could try is install you filter providers first and then your packet tunnel provider second. In the tests that I have done between content filter providers and the proxy providers, if the content filter providers are installed first then the traffic will flow through those providers first and into the proxy providers second.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com