d) Under PPP -> Interface -> L2TP Server -> Enable and select the profile you created above. Furthermore "use ipsec-yes" and make a note of the IPSEC secret you put there.
/interface l2tp-server server
set allow-fast-path=yes default-profile=L2TP-Profile enabled=yes use-ipsec=yes
You can set allow-fast-path here, the cost is that you won't be able to apply special firewall rules to these packets. It is possible that your WAN connection is so slow, that using fast path has no real benefits. Sometimes it is better not to use fast path.
e) OPTIONAL
Under PPP-> Interface you can add a new "L2TP server binding" where you choose a name and put the user you created above. This step is optional because ROS will create the interface automatically but if you create it yourself you can name it and use it on the firewall policies.
/interface l2tp-server
add name=L2TP-IF user=remote
This is something that I did not know. Nice!
![Smile :-)](./images/smilies/icon_smile.gif)
If you want, you can also use fixed remote IP addresses instead of using a pool.
/ppp secret
add name=user1 password=password1 profile=ipsec_vpn_maybe_your_default remote-address=192.168.5.121 service=l2tp
It gives another way to construct per-user firewall rules (e.g. filter by fixed remote ip instead of interface name).
3) IPSEC
Once you enable the L2TP/IPSEC server above some config gets auto deployed under IP-> IPSEC. some people say it works directly but for me it needed a lot of tweaking and it really took me 2 days to get it to work. under IP-> IPSEC you should have:
a) under Profiles a default profile which I modified to use some of the protocols I wanted
/ip ipsec profile
set [ find default=yes ] dh-group=modp1024 enc-algorithm=aes-256,aes-192,aes-128 name=test-profile
The L2TP server in routeros can use the default ipsec configuration. It is "all or nothing". It means that you either use the default ipsec settings and let L2TP server generate policies for you, OR alternatively you can create your ipsec tunnel over l2tp manually. The former is easier to setup, but it is not so flexible. The later is more flexible (for example, you can create different profiles/algorigthms for different peers), but it is more difficult and time consuming to setup.
If you decide to use the default ipsec profile and proposal, then you need to configure it in a way so that every l2tp client will be able to use it. There is tradeoff: some clients cannot use the most secure algorithms supported by ROS. So before your configure your default ipsec proposal/profile, you need to know what kind of clients will be connecting, and their supported algorithms. There is a list of supported algos here:
*
https://wiki.mikrotik.com/wiki/Manual:I ... figuration
*
https://wiki.mikrotik.com/wiki/Manual:I ... figuration
*
https://wiki.mikrotik.com/wiki/Manual:I ... figuration
*
https://wiki.mikrotik.com/wiki/Manual:I ... figuration
*
https://wiki.mikrotik.com/wiki/Manual:I ... figuration
For example, Windows 10 does not support any hash algo except SHA1 in phase2. That means, if you don't allow SHA1 for phase 2, then Windows 10 clients won't be able to connect.
c) under peers - an automatically deployed peer named "l2tp-in-server" which should be linked to the default profile (which I renamed test-profile) - cannot be modified
d) under groups - a default group which i renamed L2TP
e) under proposals - you have the default but I selected only the protocols I wanted ( sha1 for Auth and all aes-xxx-cbc for Encr). Pfs group2 (mod 1024)
Yes, L2TP server is generating/using default settings and you can't change that. If you really need to fine-tune ipsec settings, then you need to disable ipsec on the l2tp server, and setup ipsec (policies, peers, identities, profile and proposal) manually.