Connecting to a SoftEther VPN server as client from OSX / Yosemite

If you’re here, you may already know that the OSX VPN client doesn’t work very well. Apparently Apple upgraded and nuked some of its dependencies, and the details are…complicated. Anyway, after spending several hours tailing system.log and digging through Apple support posts, this is all I have to say about that. This post (a Linux guide) helped immensely.

Luckily, SoftEther produces a command line utility:


Use it to establish a connection. Grab the full source from here, and run:

sudo ./configure && make && make install

Ok, now you need to start the vpn client:

sudo vpnclient

…And configure it:

sudo vpncmd localhost /CLIENT /CMD NicCreate tun0

If you get an error here, install tuntap so you can create virtual interfaces.

Now, set your account details:
sudo vpncmd localhost /CLIENT /CMD AccountCreate YOUR_MADE_UP_VPN_ALIAS

This will prompt you to enter details for account create. Be very careful here to enter the correct options.

Set your password (if you're using a certificate, you'd need to do that here instead):
sudo vpncmd localhost /CLIENT /CMD AccountPasswordSet YOUR_MADE_UP_VPN_ALIAS /PASSWORD:123456 /TYPE:standard

Bring your network interface online

sudo vpncmd localhost /CLIENT /CMD NicEnable tun0

Connect your account

sudo vpncmd localhost /CLIENT /CMD AccountConnect YOUR_MADE_UP_VPN_ALIAS

You can check the status via AccountStatusGet.

Once your connection has been established, you need to enable routing.

This will get you an IP from the VPN gateway:
sudo ipconfig set tap0 DHCP

This will add a path to your VPN gateway through your local router device:

sudo route delete default && route -n add VPN_IP_HERE/24 LOCAL_ROUTER_IP

Finally, this will make the VPN gateway the default, and you should have access to your entire VPN network:

sudo route add default DEFAULT_GATEWAY_OF_DEVICE_ON_TAP0

Here is a quick script for disconnecting (run as sudo):

vpncmd localhost /CLIENT /CMD AccountDisconnect YOUR_MADE_UP_VPN_ALIAS
vpnclient stop
route delete default
sudo route -n delete VPN_IP_HERE/24
sudo route add default LOCAL_ROUTER_IP_HERE
This entry was posted in Networking. Bookmark the permalink. Trackbacks are closed, but you can post a comment.

One Comment

  1. Kirk Kerekes
    Posted May 4, 2017 at 2:15 pm | Permalink

    Does this still work under Sierra?

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>