Sharing my VPN connection on macOS Sierra via WiFi Using MacBook Pro (Retina, 13-inch, Mid 2014) with macOS Sierra 10.12.5 (16F73), I have a VPN connection through Pulse Secure on my WiFi, and I would like to share it with my mobile device, so I got a D-Link DWA-131 Nano USB WiFi adapter, and tried to connect through the new adapter to VPN, whilst sharing the connection through AirPort WiFi using Internet Sharing.

The sharing works, internet works, but VPN is not shared, only internet connection, so I tried to share my VPN using pfctl but with no luck, I've done it before through Ethernet, but I'm not able to do it through WiFi.

Here's what I do:

# sysctl -w net.inet.ip.forwarding=1
# sysctl -w net.inet.ip.fw.enable=1
(this generates sysctl: unknown oid 'net.inet.ip.fw.enable', no idea what is needed)
# pfctl -d
# pfctl -f nat-rules -e


My nat-rules file contains:

nat on utun1 from en0:network to any -&gt; (utun1)


This is the only rule, it worked before when I was forwarding VPN from Ethernet to WiFi (different BSD device names of course).

Have you tried such thing before? It seems that the main problem is around creating a WiFi network without Internet Sharing, which doesn't seem to be possible
As a test, I'd try setting things up totally from the macOS GUI rather than using Terminal. You may already know how to do this, but broadly the steps would be:


Connect your Mac to the internet via your Pulse Secure
Set up your VPN connection in System Preferences > Network
Click on the Advanced... button
Ensure you tick the Send all traffic over VPN connection checkbox
Click OK
Ensure you also tick the checkbox for Show VPN status in menu bar
Now go to System Preferences > Sharing
Highlight (but do not tick) the Internet Sharing service in the lefthand pane
On the righthand side, select the VPN connection you created at Step 2 from the Share your connection from drop-down menu
Now select the Nano USB Wi-Fi port (i.e. tick the checkbox)
Click on the Wi-Fi Options... button
Give your new Wi-Fi network a name, password etc
Click OK
Now tick the Internet Sharing service in the lefthand pane


Now test this to confirm that whenever your Mac is connected to the VPN, it will share the connection via the Nano USB Wi-Fi. This means you should be able to connect your mobile device to the new Wi-Fi network you created at Step 12. To do this, follow the steps below.

Using the VPN connection

To make this work with your mobile device:


On the Mac, click on the new VPN Status icon in the menu bar
Select the Connect option pertaining to the VPN connection created previously
Once the connection is established, your Mac should start sharing the VPN via the Nano USB Wi-Fi
Now go to your mobile device and connect it to this Wi-Fi network