Community discussions

MikroTik App
 
Psynapsx
just joined
Topic Author
Posts: 4
Joined: Thu Jul 01, 2021 11:57 pm

L2TP IPSec without password and IPSec Secret

Wed Apr 20, 2022 7:02 pm

So I accidentally enabled L2TP server and opened 500,1701 and 4500 ports without first setting up my IPSec Secret and user password (in PPP - Secrets), but I set up my username.
I set “Use IPsec” as “required”.
I see one failed L2TP login attempt in the logs.
Should I worry? Is it possible that someone logged in to my router since there were no IPsec secret and user password in PPP - Secrets?
Is it even possible to connect without entering password and IPsec secret?
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: L2TP IPSec without password and IPSec Secret

Wed Apr 20, 2022 8:10 pm

L2TP server without IPSec secret exposes plain L2TP server, and if your firewall rules allow it (they shouldn't), it's possible to connect to it. But if you don't see any successful connection (at least I think it's logged too), it's ok.

You don't want to allow port 1701 unconditionally, only for packets encrypted by IPSec:
/ip firewall filter
add chain=input protocol=tcp dst-port=1701 ipsec-policy=in,ipsec action=accept
 
Psynapsx
just joined
Topic Author
Posts: 4
Joined: Thu Jul 01, 2021 11:57 pm

Re: L2TP IPSec without password and IPSec Secret

Wed Apr 20, 2022 8:17 pm

thank you
they would still have to find out my username to establish a connection, is this correct?
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: L2TP IPSec without password and IPSec Secret

Wed Apr 20, 2022 8:31 pm

Yes.
 
Zacharias
Forum Guru
Forum Guru
Posts: 3459
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: L2TP IPSec without password and IPSec Secret

Wed Apr 20, 2022 8:39 pm

/ip firewall filter
add chain=input protocol=tcp dst-port=1701 ipsec-policy=in,ipsec action=accept
@sob, do we actually need the dst-port=1701 here ?
Its UDP by the way, i guess you just missed that...
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: L2TP IPSec without password and IPSec Secret

Wed Apr 20, 2022 9:14 pm

Of course, udp, tcp was mistake, typing without thinking too much, muscle memory or something. ;)

And yes, port 1701 must be allowed, because it's what L2TP listens at. But small clarification about ipsec-policy, it's possible to skip that, because if you set use-ipsec=required (not just use-ipsec=yes) for L2TP server, it checks itself if connection uses IPSec. On the other hand, it doesn't hurt to keep it, because then nobody can interact with L2TP server at all without successfully establishing IPSec first.

Or if you meant that it would be possible to drop dst-port and only keep ipsec-policy, then yes and no. Just for L2TP, yes, because created policies are for just this one port anyway. But in case you have some other IPSec tunnels, this rule could allow access to anything on router, which may not be desired.
 
Zacharias
Forum Guru
Forum Guru
Posts: 3459
Joined: Tue Dec 12, 2017 12:58 am
Location: Greece

Re: L2TP IPSec without password and IPSec Secret

Wed Apr 20, 2022 9:17 pm

Or if you meant that it would be possible to drop dst-port and only keep ipsec-policy, then yes and no. Just for L2TP, yes, because created policies are for just this one port anyway. But in case you have some other IPSec tunnels, this rule could allow access to anything on router, which may not be desired.
Right, that's what i meant... What is inside the IPsec,in will be the L2TP packets anyway.