In order to set up Static IP Tunnels on MikroTik, you will need:
- A Static IP Tunnel
- A MikroTik router or CHR virtual machine
First, log into the console via WinBox or SSH.
Subsequently, add the L2TP tunnel:
/interface l2tp-client
add add-default-route=yes connect-to=nyc.vpn.fourplex.net disabled=no name=l2tp user=username password=password
Notes:
- Substitute the username and password with the username and password given via the signup email or in your user portal.
- If you have an IPv6-only tunnel, omit the add-default-route=yes
After you enabled the L2TP tunnel, increase the "distance" of the DHCP client.
/ip dhcp-client
set default-route-distance=10
This will make the L2TP tunnel the default route instead of your local network.
Enabling IPv6
If you wish to have IPv6 (recommended), you will need to add the default route manually. To do so:
/ipv6 route
add gateway=l2tp
Now, you can add IPv6 addresses to your router:
/ipv6 address
add address=prefix::1/64 interface=lan
Note: Assuming you want to divide the /56 into multiple /64, replace prefix with the IPv6 prefix you want on your LAN.
Enabling NAT
If you wish to have devices behind your MikroTik router, you will need to enable NAT.
/ip firewall nat
add action=masquerade chain=srcnat out-interface=l2tp src-address=nat_prefix
Note: Replace nat_prefix with the subnet you want clients to connect from.
You can also add port forwarding which is outside the scope of this document.