I'd like to point out that I'm not getting an error when creating the socket.
OK, thanks for clarifying that.
I'm simply unable to communicate through it, and TCP Dumping on the server is showing 0 traffic.
You could be having a routing problem. Pasted in below is the standard explanation I send to folks about this.
Note When dealing with packet tunnel providers it’s generally best to take packet traces on the iOS device using RVI. QA1176 Getting a Packet Trace explains how to do this. Make sure to pay attention to the packet metadata, as discussed in the Q&A.
When you bring up a VPN interface the system must configure the routing tables such that traffic destined for the VPN server does not go via the VPN. If it did it would get stuck in a routing loop: a packet would go to the packet tunnel provider, which would wrap it and send it on to the VPN server, and the kernel would route that back to the packet tunnel provider, which would wrap it, and so on. This is especially important when the VPN claims the default route.
Your packet tunnel provider is responsible for telling the system about the routing table changes it requires. Specifically:
You pass the address of your VPN server to
-[NEPacketTunnelNetworkSettings initWithTunnelRemoteAddress:]
You can also pass specific included (
includedRoutes
) and excluded (excludedRoutes
) routes via the NEIPv6Settings
and NEIPv4Settings
objects referenced by the NEPacketTunnelNetworkSettings object
The routing information derived from the above is added to the routing table when the VPN comes up (and removed when it goes down).
You typically use this in one of two ways:
In a split tunnel setup, where you only claim specific routes, you can use
includedRoutes
to extend the range of networks that go via the VPN (otherwise it would just be the network defined by the VPN interface itself). For example, most enterprises have a bunch of internal networks, and if they don’t list those networks here then only servers on the same network as the VPN server would be accessible!In a full tunnel setup, where you claim the default route, you can use
excludedRoutes
to prevent traffic going via the VPN. For example, if your enterprise has an Internet-facing secure mail server, you might want to exclude that traffic from the VPN because:
It’s not necessary, because traffic to the mail server is secure anyway
It reduces load on the VPN servers
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"