-
Notifications
You must be signed in to change notification settings - Fork 74
NEPacketTunnelProvider is not intercepting packets having local destination. #11
Comments
How do you mean by `accessing a URL based on local IP address`? And how do
you verify that PacketFlow.readPackets didn't read that packet?
…On 17 March 2018 at 02:45, alisolutions ***@***.***> wrote:
After enabling the NEPacketTunnelProvider, If I access a URL based on
local IP address on Safari. PacketFlow.readPackets does not read that
packet. And on Safari I got the response without any error.
Do I need to set any extra configuration to enable local traffic
intercepting?
Please let me know of you need any other info.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAkQ8Z58rIeDzMdAhCnJ3IURZw1cuPX1ks5te8HpgaJpZM4Stz5->
.
|
I hosted an image on tomcat installed on my machine. When I access that image on my device I did not get any breakpoint event in self.packetFlow.readPackets handler. Whereas if I try to access any other resource I did get that. |
Hmm, that's weird
The configuration regarding enable/disable tunneling for specific target
hosts is here
https://github.com/lxdcn/NEPacketTunnelVPNDemo/blob/master/NEPacketTunnelVPNDemoTunnel/PacketTunnelProvider.swift#L54
.
You can tweak the configuration according to this
https://developer.apple.com/documentation/networkextension/neipv4route, and
DNS together, try and see if you can intercept traffic both from your PC
and Internet.
…On 19 March 2018 at 19:24, alisolutions ***@***.***> wrote:
I hosted an image on tomcat installed on my machine. When I access that
image on my device I did not get any breakpoint event in
self.packetFlow.readPackets handler. Whereas if I try to access any other
resource I did get that.
Please let me know you if you need any other info.
Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAkQ8WRbltQB48xSUpFX-PUi4x8qypPQks5tf08VgaJpZM4Stz5->
.
|
I have included local host IP like this, do I need to configure something else as well? |
Looks good, just give it a go.
…On 19 March 2018 at 19:36, alisolutions ***@***.***> wrote:
I have included local host IP like this, do I need to configure something
else as well?
tunnelNetworkSettings.iPv4Settings?.includedRoutes = [NEIPv4Route.init(destinationAddress:
"172.16.15.36", subnetMask: "255.0.0.0")]
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAkQ8WzvDRi_BZUylWAKWhiV5EG-xe5Aks5tf1IKgaJpZM4Stz5->
.
|
It not working with the above code.
Whereas 172.16.15.36 is the ip address of my machine. |
I fixed it. Actually, we need to add local machine ip address in the ipv4 settings as well. Like in the following code where my machine ip is 172.16.15.36. |
Cool!
…On 27 March 2018 at 00:04, alisolutions ***@***.***> wrote:
I fixed it. Actually, we need to add local machine ip address in the ipv4
settings as well. Like in the following where my machine ip is 172.16.15.36.
tunnelNetworkSettings.ipv4Settings = NEIPv4Settings(addresses:
[conf["ip"] as! String, "172.16.15.36"], subnetMasks: [conf["subnet"] as!
String])
And of course, we need to include that ip in the includedRoutes as well.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAkQ8XsnQbKxRAJmtkM_vVvQ0TPnGpXfks5tiMsjgaJpZM4Stz5->
.
|
@alisolutions 172.16.15.36 is ip of current device (not server)? |
@tuannv19 Yes, this is IP of current device. |
@alisolutions thanks you. |
After enabling the NEPacketTunnelProvider, If I access a URL based on local IP address on Safari. PacketFlow.readPackets does not read that packet. And on Safari I got the response without any error.
Do I need to set any extra configuration to enable local traffic intercepting?
Please let me know of you need any other info.
The text was updated successfully, but these errors were encountered: