Where did the data packets written into NEPacketTunnelFlow go?

I read the tcp packets from NEPacketTunnelFlow by readPacketsWithCompletionHandler, and then I modified the destination IP address and port of the IP packet,and write the changed packet to NEPacketTunnelFlow by writePackets withProtocols.

I start a TCP Server, listen on the destination IP address and port.

But, the TCP server is not receive packet.

And I cannot read the changed packet from NEPacketTunnelFlow by readPacketsWithCompletionHandler.

where is the packet go?

and I set config: tunnelNetworkSettings.IPv4Settings.includedRoutes = @[[NEIPv4Route defaultRoute]];

where is the packet go?

I believe I answered part of your question over here. Try writing that modified packet to the network with a destination of your TCP server. Then receive that packet from the network and then try writing it back to your virtual interface.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Where did the data packets written into NEPacketTunnelFlow go?
 
 
Q