Can't connect to L2TP over IPSec VPN from Mac 10.12.4
First step: Ensure that outgoing L2TP connections work properly. To do that, run the following commands in Terminal (you can copy and paste if you want):

/usr/bin/nc -uvw5 portquiz.net 500
/usr/bin/nc -uvw5 portquiz.net 1701
/usr/bin/nc -uvw5 portquiz.net 4500


You should get something that looks like this (note the three "succeeded" lines):

found 0 associations
found 1 connections:
     1: flags=82&lt;CONNECTED,PREFERRED&gt;
    outif en0
    src 192.168.1.2 port 56916
    dst 178.33.250.62 port 500
    rank info not available
    TCP aux info available

Connection to portquiz.net port 500 [tcp/isakmp] succeeded!
found 0 associations
found 1 connections:
     1: flags=82&lt;CONNECTED,PREFERRED&gt;
    outif en0
    src 192.168.1.2 port 56917
    dst 178.33.250.62 port 1701
    rank info not available
    TCP aux info available

Connection to portquiz.net port 1701 [tcp/l2f] succeeded!
found 0 associations
found 1 connections:
     1: flags=82&lt;CONNECTED,PREFERRED&gt;
    outif en0
    src 192.168.1.2 port 56918
    dst 178.33.250.62 port 4500
    rank info not available
    TCP aux info available

Connection to portquiz.net port 4500 [tcp/ipsec-msft] succeeded!


If that works, then you should be able to connect, and the problem is likely the server, or a configuration problem (I've used the macOS L2TP client for a long time and haven't experienced any issues). If not, something is blocking an outgoing port.