networkextension

I created a tunnel “utun1” on the A device (the local ipv4 ip address of the tunnel “utun1” is 6.6.6.6) and then created a socket in the packettunnel process (socket binding 6.6.6.6:8088) and called the accept() function, then the A device Turn on the personal hotspot (hotspot name iPhone Wi-Fi), and then connect the B device to Wi-Fi (iPhone Wi-Fi). Create a socket on device B and try connet (6.6.6.6:8088), my question is why the socket of device B cannot connect to 6.6.6.6:8088
Answered by Systems Engineer in 631509022
As for your specific question I suspect that because you are connecting via a personal hotspot interface that you are coming in through that interface and are not able to reach the tun1 interface directly from Device B. What are you looking to achieve here? Are you trying to share Device A's VPN?

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
Accepted Answer
As for your specific question I suspect that because you are connecting via a personal hotspot interface that you are coming in through that interface and are not able to reach the tun1 interface directly from Device B. What are you looking to achieve here? Are you trying to share Device A's VPN?

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
hello,Matt Eaton
The function I want to achieve is to turn on VPN (tunnel6.6.6.6/32) on the iPhone and turn on the personal hotspot. 2. Turn on an HTTP proxy service (6.6.6.6.:8088) on the iPhone, and then switch to connect to the personal hotspot of the iPhone. And set up proxy server 6.6.6.6: 8088 to realize VPN sharing.
An iPhone is not meant to be used as a Proxy Server to route traffic through a VPN. You will run into nothing but edge cases trying to do this. If you have an app that is receiving local network traffic through a standard means of communication, i.e., Bonjour/NWConnection. And the receiving app also has a Network Extension Packet Tunnel configured for it's process, then there is nothing technically stopping the receiving app from sending that local network traffic through the tunnel. However, all of this may be a very elaborate way to recognize that each device that needs to use a Packet Tunnel should really have one configured on their device and should not be trying to share another device's tunnel.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com
As far as I know, there are already apps that implement this function on the App Store. The specific function is that the mobile phone turns on the personal hotspot and turns on the VPN (tunnel provider) and opens an HTTP server (6.6.6.6:8090) in the process where the tunnel provider is located, and then uses "NINTENDO SWITCH" (game host) to connect to the hotspot of the mobile phone and Set up a proxy server (6.6.6.6:8090) to achieve acceleration.

Have you found a solution?I had same problem

networkextension
 
 
Q