I create a Digital Ocean instance that runs on Ubuntu 18.04. After that, I create a VPN service that uses the L2TP protocol on this instance by following this repository. This script uses Libreswan
as the IPsec server, and xl2tpd
as the L2TP provider. I try to connect from my macOS and it works.
After that, I create a firewall for my machine. I block all inbound connections and only allow port 22. Here is my data after running ufw status verbose
command:
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
So it seems all things work perfectly. I expect that I cannot connect again to my VPN (because L2TP works on the UDP port 500). But I can connect to my VPN service successfully.
Please tell me which part that I have configured wrong.