

Maybe I should declare in GUI (the CLI’s commands are awful) in IP -> Firewall -> Filter notes -> add new… IN interface pppoe-out/dynamic (instead WAN/ether1) ? I watched many tutorials (especially on Youtube), but no one helped me. I am using a pppoe connection to connect to my ISP from my router and I would like to set up a L2TP-IPsec server too on the same router. It’s an old post, so, please accept my humble apologies for bothering you.

If you want to avoid pasting commands into the cli you can create these firewall rules in winbox, here are some screenshots. ip firewall filterĪdd action=accept chain=input dst-port=500,1701,4500 in-interface=ether1 protocol=udp \Ĭomment="allow L2TP VPN (500,4500,1701/udp)" The ruleset can be further condensed by combining the 3 udp rules into one. These rules must be placed above any deny rules on the “input” chain. L2TP/IPSec Firewall Rule Set /ip firewall filterĪdd action=accept chain=input in-interface=ether1 protocol=ipsec-esp \Īdd action=accept chain=input dst-port=1701 in-interface=ether1 protocol=udp \Īdd action=accept chain=input dst-port=4500 in-interface=ether1 protocol=udp \Īdd action=accept chain=input dst-port=500 in-interface=ether1 protocol=udp \ (Default UDP stream timeout is 3 minutes.When you configure a L2TP/IPSec VPN on a MikroTik RouterOS device you need to add several IP Firewall (Filter) rules to allow clients to connect from outside the network. If allowing established and related connections in firewall, the L2TP server will be availible for as long as the connection is in the conn track table, watch out for that.

Schedule the script to run every 2 or 3 seconds, and the L2TP server is secured. Make sure to secure the L2TP server firewall rule with src-address-list=L2TP_Allowed. However, nothing a script cant solve right? Here is my script for securing the L2TP server to IPSec clients only. In firewall, you have to allow access to the L2TP server, but there is no IPSec policy matcher. The one problem is that there is no way to secure the L2TP server to IPSec clients ONLY, if you have people that connect from different public IPs constantly.
