Community discussions

MikroTik App
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 10:13 am

hello for all my Friends here...! so i tried alot to setup a tunneling protocol between My Windows 10 machine and Ros951ui -(i am talking about L2TP protocol)- but with no avail .
i don't know if i miss something but well... i apply a lot of configuration out there in youtub , google...etc.but all this doesn't working .
so please anyone setup L2TP or any other VPN protocol in Ros and get an active connection until now..?
please if anyone can help and thanks in advance.
this is my config in the pictures below

in the server name or address section in my windows vpn setting -red colour- i put my public ip address not my out interface so does that make a different ..?
You do not have the required permissions to view the files attached to this post.
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 689
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 10:45 am

MT official DOC
2022-09-07_12-08-56.jpg
Firewall
2022-09-07_12-10-14.jpg
You do not have the required permissions to view the files attached to this post.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 11:08 am

MT official DOC
2022-09-07_12-08-56.jpg

Firewall
2022-09-07_12-10-14.jpg
very thanksful Mr own3r1138 for your replay..!
but what this address 172.17...represent..? do i have to have a docker in my case ..? also can you please send your config on your windows pc..?
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 689
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 11:22 am

but what this address 172.17...represent..? do i have to have a docker in my case ..? also can you please send your config on your windows pc..?
Keep in mind that my setup is a bit different from what you want to do my server acts as a VPN server like any third-party VPN service. There is no LAN at this setup but besides this, the L2TP server configuration is the same.
  • 172.17.
No, You don't need it it's just an extra DNS server.
  • do I have to have a docker in my case
No
  • also can you please send your config on your windows pc
Note: check the official document my P1/P2 is different from the default setting. I'm going to share this part too.
/ip ipsec profile
set [ find default=yes ] dh-group=ecp256,modp2048,modp1024 enc-algorithm=aes-256 hash-algorithm=sha256
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc,aes-256-gcm pfs-group=none
Windows Powershell command
#IPsec L2TP SHA256 CBC/GCM-AES256 ECP256
#Set-VpnConnectionIPsecConfiguration -ConnectionName "" -RevertToDefault

#GCM
Add-VpnConnection -Name "L2TP-GCM" -ServerAddress "Public-IP" -TunnelType "l2tp" 
Set-VpnConnection -Name "L2TP-GCM" -RememberCredential $True -SplitTunneling $False -EncryptionLevel Required -L2tpPsk "IPsec-secret" -PassThru -Force
Set-VpnConnectionIPsecConfiguration -ConnectionName "L2TP-GCM" -AuthenticationTransformConstants GCMAES256 -CipherTransformConstants GCMAES256 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup ECP256 -PassThru -Force

#CBC
Add-VpnConnection -Name "L2TP-CBC" -ServerAddress "Public-IP" -TunnelType "l2tp" 
Set-VpnConnection -Name "L2TP-CBC" -RememberCredential $True -SplitTunneling $False -EncryptionLevel Required -L2tpPsk "IPsec-secret" -PassThru -Force
Set-VpnConnectionIPsecConfiguration -ConnectionName "L2TP-CBC" -AuthenticationTransformConstants SHA256 -CipherTransformConstants AES256 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup ECP256 -PassThru -Force
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 11:46 am

but what this address 172.17...represent..? do i have to have a docker in my case ..? also can you please send your config on your windows pc..?
Keep in mind that my setup is a bit different from what you want to do my server acts as a VPN server like any third-party VPN service. There is no LAN at this setup but besides this, the L2TP server configuration is the same.
  • 172.17.
No, You don't need it it's just an extra DNS server.
  • do I have to have a docker in my case
No
  • also can you please send your config on your windows pc
Note: check the official document my P1/P2 is different from the default setting. I'm going to share this part too.
/ip ipsec profile
set [ find default=yes ] dh-group=ecp256,modp2048,modp1024 enc-algorithm=aes-256 hash-algorithm=sha256
/ip ipsec proposal
set [ find default=yes ] auth-algorithms=sha256 enc-algorithms=aes-256-cbc,aes-256-gcm pfs-group=none
Windows Powershell command
#IPsec L2TP SHA256 CBC/GCM-AES256 ECP256
#Set-VpnConnectionIPsecConfiguration -ConnectionName "" -RevertToDefault

#GCM
Add-VpnConnection -Name "L2TP-GCM" -ServerAddress "Public-IP" -TunnelType "l2tp" 
Set-VpnConnection -Name "L2TP-GCM" -RememberCredential $True -SplitTunneling $False -EncryptionLevel Required -L2tpPsk "IPsec-secret" -PassThru -Force
Set-VpnConnectionIPsecConfiguration -ConnectionName "L2TP-GCM" -AuthenticationTransformConstants GCMAES256 -CipherTransformConstants GCMAES256 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup ECP256 -PassThru -Force

#CBC
Add-VpnConnection -Name "L2TP-CBC" -ServerAddress "Public-IP" -TunnelType "l2tp" 
Set-VpnConnection -Name "L2TP-CBC" -RememberCredential $True -SplitTunneling $False -EncryptionLevel Required -L2tpPsk "IPsec-secret" -PassThru -Force
Set-VpnConnectionIPsecConfiguration -ConnectionName "L2TP-CBC" -AuthenticationTransformConstants SHA256 -CipherTransformConstants AES256 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup ECP256 -PassThru -Force
Very thanksful for the second time..! The problem that i encounter that i don't know in the client side - my pc-what ip address i have to put my public ip or my out interface ip on my mikrotik router or what..? This issue is still fuzzy for me. Well its the first time that i try to setup a vpn on mikrotik.
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 689
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 11:58 am


Very thanksful for the second time..! The problem that i encounter that i don't know in the client side - my pc-what ip address i have to put my public ip or my out interface ip on my mikrotik router or what..? This issue is still fuzzy for me. Well its the first time that i try to setup a vpn on mikrotik.
You're welcome. It should be your public IP.
What are the purposes of your VPN setup? A remote connection?
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 12:37 pm


Very thanksful for the second time..! The problem that i encounter that i don't know in the client side - my pc-what ip address i have to put my public ip or my out interface ip on my mikrotik router or what..? This issue is still fuzzy for me. Well its the first time that i try to setup a vpn on mikrotik.
You're welcome. It should be your public IP.
What are the purposes of your VPN setup? A remote connection?

Very thanksful for the second time..! The problem that i encounter that i don't know in the client side - my pc-what ip address i have to put my public ip or my out interface ip on my mikrotik router or what..? This issue is still fuzzy for me. Well its the first time that i try to setup a vpn on mikrotik.
You're welcome. It should be your public IP.
What are the purposes of your VPN setup? A remote connection?
Yes i want to access to my server that's connected to my mikrotik 951ui from outside - (different LAN) -
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 689
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 1:10 pm

Yes i want to access to my server that's connected to my mikrotik 951ui from outside - (different LAN) -
It's best to share a network diagram, and export config (remove any public IP, sensitive data)

It should be your public IP at least till I know more about your "different LAN"
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 5:22 pm

Yes i want to access to my server that's connected to my mikrotik 951ui from outside - (different LAN) -
It's best to share a network diagram, and export config (remove any public IP, sensitive data)

It should be your public IP at least till I know more about your "different LAN"
Hello MR own3r1138..! so what i have to write on my terminal in order to export all my data..?
this is my network diagram.
Eth1 represent out interface with ip 192.168.2.2
all other interface represent LAN in Bridge interface with ip=192.168.1.1
in my D-link router-DMZ section i put the ip address of my out interface of Mikrotik 192.168.2.1
so both mikrotik and D-Link in same DMZ
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19325
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 5:48 pm

Forget DMZ, its not a wise security move
What you need to do is port forward the applicable ports from the DLINK router to 192.168.2.2
For example if you were using wireguard it would be the wireguard port, if it was L2TP it would be port 1701 etc...........
On the mikrotik you need to add access to these ports on the INPUT CHAIN.

This is assuming you want the MT to be a server/receiver for initial vpn connectivity.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 7:28 pm

Forget DMZ, its not a wise security move
What you need to do is port forward the applicable ports from the DLINK router to 192.168.2.2
For example if you were using wireguard it would be the wireguard port, if it was L2TP it would be port 1701 etc...........
On the mikrotik you need to add access to these ports on the INPUT CHAIN.

This is assuming you want the MT to be a server/receiver for initial vpn connectivity.
hello anav..! yes i setup an access rule im my mikrotik as you mention
for the DMZ it has been there for a while -in my network- and until now i didn't encounter such a big issue in security. the purpose of DMZ in my case is to setup the forwarding rule
in my mikrotik instead of Dlink router. and that's rule work fine until now.
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 689
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 8:10 pm

@Techsystem

Simply open your terminal and type "export hide-sensitive". Copy& paste it into the text editor. Then, remove any public IP address or sensitive data. It's ready to be published.
As Anav said you have two main options. I like the first option the most if it's possible. Also, your public IP is still a valid answer.
  • If your upstream service is PPPOE you could set your TP-link to bridge mode and set your PPPOE in MT.
  • Port forwarding.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Wed Sep 07, 2022 9:31 pm

@Techsystem

Simply open your terminal and type "export hide-sensitive". Copy& paste it into the text editor. Then, remove any public IP address or sensitive data. It's ready to be published.
As Anav said you have two main options. I like the first option the most if it's possible. Also, your public IP is still a valid answer.
  • If your upstream service is PPPOE you could set your TP-link to bridge mode and set your PPPOE in MT.
  • Port forwarding.
Well how can i do that from mikrotik side..? - set my dlink router as abridge and set my pppoe in MT-..?
i don't think that i find such an option on pppoe section. Please olif there is any quide or anything that explain the setup proccess. So you mean in this case i dont need to use DMZ any more if i do that..?
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Thu Sep 08, 2022 5:56 am

Hello again Mr own3r1138..! so this is my MT config.
You do not have the required permissions to view the files attached to this post.
Last edited by Techsystem on Thu Sep 08, 2022 9:37 am, edited 1 time in total.
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 689
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Thu Sep 08, 2022 7:36 am

I checked your export file you should remove your software id and serial number from your export. First, find out how can you continue with your setup then we talk about the MT config.
So you mean in this case i dont need to use DMZ any more if i do that..?
Well, Firstly, it makes your setup more complex which is unnecessary. Secondly, nowadays doesn't add any benefit with regard to security.
Thirdly, in general, MT is more caple than ISP-provided routers.
set my dlink router as abridge
First, you have to check if this is something that you can achieve.
Mine is TP-link However, TP and D-link GUIs' are much like each other.
2022-09-08_08-50-59.jpg
set my pppoe in MT
The easiest way is to set it up from the quick-set menu.
2022-09-08_08-19-44.jpg
You do not have the required permissions to view the files attached to this post.
 
User avatar
Techsystem
Member
Member
Topic Author
Posts: 338
Joined: Tue Dec 21, 2021 5:12 am
Location: UAE - Dubai

Re: setup L2TP or any VPN protocol between my pc and Ros

Thu Sep 08, 2022 9:34 am

I checked your export file you should remove your software id and serial number from your export
don't worry i chang it
.

so what about my l2tp config ,,? is there is any problem on it
 
User avatar
own3r1138
Long time Member
Long time Member
Posts: 689
Joined: Sun Feb 14, 2021 12:33 am
Location: Pleiades
Contact:

Re: setup L2TP or any VPN protocol between my pc and Ros

Thu Sep 08, 2022 10:09 am

Overall, It could be cleaner than what it is now.

Your VPN IP pool range should be different from your LAN IP pool. You should also add this to your address list. or use ARP.
MT wiki recommends that the VPN range should be different.
name=l2tp ranges=192.168.1.200-192.168.1.230
CLI.
add address=192.168.1.1/24 interface=LAN network=192.168.1.0
add address=192.168.100.1/24 interface=LAN network=192.168.100.0
ip pool
add name=l2tp ranges=192.168.100.2-192.168.100.254

These are unused.
/ip pool
add name=dhcp_pool1 ranges=192.168.10.2-192.168.10.200
add name=dhcp_pool2 ranges=192.168.10.2-192.168.10.200
/ip firewall filter
add action=accept chain=input in-interface=ether1 protocol=ipsec-ah
/ip firewall nat
add action=dst-nat chain=dstnat dst-address=192.168.2.2 dst-port=8291 protocol=tcp to-addresses=192.168.2.2 to-ports=8291
Could you clarify these rules, Please?
dns-server=192.168.130.1
dhcp-server add address=192.168.10.0/24
From your export file.
/ppp profile
set *0 change-tcp-mss=default dns-server=192.168.1.1,192.168.130.1
/ip dhcp-server network
add address=192.168.10.0/24 dns-server=8.8.8.8 gateway=192.168.10.1

Who is online

Users browsing this forum: No registered users and 66 guests