Able to connect to VPN using SimpleTunnel App but can't data packets

Hi,


I am using SimpleTunnel sample app to create a VPN server and using iOS device as VPN client. I followed following steps to connect to VPN:


- Run tunnel_server target on my mac by passing arguments like port number and config file location.

- Got this response:

2015-09-28 15:36:12.783 tunnel_server[28665:711450] Starting network service on port 4147

2015-09-28 15:36:13.649 tunnel_server[28665:711450] Network service published successfully

- Run PacketTunnel app on iOS device.

- Added configuration in PacketTunnel screen by changing server address to my mac's IP address, plus the port number I have given for tunnel_server(4147).

- Now tried to connect to VPN from mac, status changed from connecting to Connected. Here is the log:

2015-09-28 15:36:22.504 tunnel_server[28665:711450] Accepted a new connection

2015-09-28 15:36:22.546 tunnel_server[28665:711450] Allocated address Optional("192.168.2.2")

- I can see VPN sign in status bar.


Now if I try to open www.apple.com on Safari in iOS device, it is timing out. But at the same time if I try to do same on mac, I am able to see Apple's site. Both iOS Device and Mac are connected to the same network.


Can anybody tell what I am doing wrong here or just missing anything?


Thanks in Advance.

Replies

on Mac ,you need

sudo sysctl net.inet.ip.forwarding=1
sudo sysctl net.inet.ip.fw.enable=1
and change pf.conf like this
vpn_net = "192.168.3.0/24"
ext_if = "en0"
int_if = "utun1"
no nat on ! $ext_if from $vpn_net to ($int_if)
nat on ! $ext_if from $vpn_net to ! ($int_if) -> ($int_if)

/usr/libexec/natpmpd can't support utun device

only pf don't work

Hi yarshure,


I tried these commands on my Mac, but still I can't use open any websites on iOS after connecting the the tunnel_server. What's the possible reason?


Thanks!

Hi Yarshure,


I have done according you, but remain can't open any websites on Safari.


Can you OK?

Hi balram1990,


I started working on nepackettunnelprovider by downloading the sample applicatoin provided by apple. I change the complet code into lastest swfit 3 syntax. When i tyried to run the server code i am getting the output like this.

2017-02-21 12:33:21.872 tunnel_server[2208:2233407] Starting network service on port 550.

I tried to turn on the vpn on client side it showing the conneting state its not getting connected.

But u are saying when we run the server we will get the ouptuts like this.

2015-09-28 15:36:12.783 tunnel_server[28665:711450] Starting network service on port 4147

2015-09-28 15:36:13.649 tunnel_server[28665:711450] Network service published successfully

For me i am not getting the second output Network service published successfully.

would u please help me to understand what would be wrong on my side.(As i understand no delegate is getting trigered).

Hi


sorry to bump the issue, I couldn't even establish the connection because the command "sudo sysctl net.inet.ip.fw.enable=1" failed in macOS Sierra with error msg "sysctrl: unknown oid 'net.inet.ip.fw.enable'"


Is there a replacement command for this? or is this command no longer required?