Community discussions

MikroTik App
 
BlueTechnomage
newbie
Topic Author
Posts: 46
Joined: Wed Nov 01, 2017 9:27 pm
Location: USA

Vlans to run over L2TP/IPsec.

Thu Nov 02, 2017 6:39 pm

HI all

So I have been using MikroTik Routeboard for a while now. But can’t figure out how to get my Vlans to run over L2TP/IPsec.

All the Sites Have DHCP from the routers at each site and the L2TP is connect to all sites.

All the computers are communicate with each other.

But the Vlans for Site 2 and 3 will not communicate Back to HQ.

Except for the VOIP, They work on their own.

Setup is as follows

I have 3 sites

Site HQ
L2TP Server
Ethernet1\Public IP: xxx.xxx.xxx.202

DHCP
Ethernet2\Local IP: Computers 192.168.1.1/24
Ethernet2\Vlan2: Guest Wireless 10.10.10.0/24
Ethernet2\Vlan3: VOIP 10.10.2.0/24
Ethernet2\Vlan4: Data Systems 10.10.3.0/24
All of those work and connect to the internet.


Site 2
L2TP client
Ethernet1\Public IP: xxx.xxx.xxx.30

DHCP
Ethernet2\Local IP: Computers 192.168.1.1/24
All of those work and connect to the internet.

Ethernet2\Vlan2: Guest Wireless 10.10.11.0/24
Ethernet2\Vlan3: VOIP 10.10.2.0/24
Ethernet2\Vlan4: Data Systems 10.10.5.0/24
Connect to the internet but not back to HQ

Site 3
L2TP client
Ethernet1\Public IP: xxx.xxx.xxx.14

DHCP
Ethernet2\Local IP: Computers 192.168.3.1/24
All of those work and connect to the internet.

Ethernet2\Vlan2: Guest Wireless 10.10.12.0/24
Ethernet2\Vlan3: VOIP 10.10.2.0/24
Ethernet2\Vlan4: Data Systems 10.10.6.0/24
Connect to the internet but not back to HQ

I also tried making the Vlans ip address in the same Network as HQ Vlans and they still will not connect over the L2TP.

I try to make a Bridge but it does not show L2TP as one of the interface options to pick from.
And I have try a few other things as well but to no success.

So is there some way that I can create a bridge that will run over the L2TP or is that just wishful thinking.

Vlans 2 and 4 need to Connect back to HQ to the Servers. The servers has a Local IP and the Vlans IP address on them as well.
Any ideas or suggestions would be appreciated.

Thanks.
 
User avatar
Anumrak
Forum Guru
Forum Guru
Posts: 1174
Joined: Fri Jul 28, 2017 2:53 pm

Re: Vlans to run over L2TP/IPsec.

Thu Nov 02, 2017 7:17 pm

For layer 2 traffic you need to manage EoIP tunnel or MPLS/VPLS. For your scheme would be better EoIP.
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Thu Nov 02, 2017 9:02 pm

I'm in need of some clarification on your issue. Do you want to stretch the VLANs from remote sites back to HQ so you have layer 2 connectivity between the sites? Do you want layer 3 connectivity between the locations from the additional networks present on the remote site VLANs (ping from that VLAN to HQ)?
 
BlueTechnomage
newbie
Topic Author
Posts: 46
Joined: Wed Nov 01, 2017 9:27 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Fri Nov 03, 2017 7:44 pm

I'm in need of some clarification on your issue. Do you want to stretch the VLANs from remote sites back to HQ so you have layer 2 connectivity between the sites? Do you want layer 3 connectivity between the locations from the additional networks present on the remote site VLANs (ping from that VLAN to HQ)?
The vlans at each site does not have to be in the same network as long as they can sent back there data to HQ Servers.

As long as the Server can see and ping it will be good.

I hope that answers your question.
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Fri Nov 03, 2017 8:08 pm

I'm in need of some clarification on your issue. Do you want to stretch the VLANs from remote sites back to HQ so you have layer 2 connectivity between the sites? Do you want layer 3 connectivity between the locations from the additional networks present on the remote site VLANs (ping from that VLAN to HQ)?
The vlans at each site does not have to be in the same network as long as they can sent back there data to HQ Servers.

As long as the Server can see and ping it will be good.

I hope that answers your question.
Yes it does, so we'll target layer 3 connectivity and we won't strectch the VLANs over the WAN links. Because you have working L2TP/IPSec connections now your problem is most likely just a routing problem. With L2TP/IPSec you shouldn't need any NAT exclusion rules because it creates an interface and is capable of routing packets naturally. If you were doing a strict IPSec transport mode tunnel you would likely need to use NAT exclusion rules to site to site traffic is NAT'd out to the Internet, this is called a policy based VPN.

You can keep your existing L2TP implementation, with PPP you have the ability to add routes on the server side (HQ, likely). This is done in the /ppp secret menu. You'd use the "route" attribute. This can be leveraged to automatically activate and deactivate a route for each remote-site by having a user for each site and placing a route for each VLAN at the site in the "routes" attribute.

At your client sites, you'll need to use static routes if you don't set the default route to the HQ. You'll need a static route for each network at all remote site networks other than itself and the HQ networks. An alternative for IPv4 would be to specify all RFC1918 addressing to go out over the tunnels. This would keep the benefit of Internet traffic going out locally while tunneling all traffic back to HQ that should be "local."

Dynamic Routing
If you don't want to manage all the routing information, you can use BGP or static OSPF neighbors over L2TP. If you don't feel comfortable with that you can switch to another tunneling technology like GRE that supports multicast which allows a protocol like OSPF or RIP to work as expected. That said, GRE requires static IPs at each remote site and HQ. You can use dynamic addressing with GRE but it requires scripting or manual adjustments to handle Internet IP changes. Like L2TP the GRE tunnels can be wrapped with a transport mode IPSec connection for security.
 
BlueTechnomage
newbie
Topic Author
Posts: 46
Joined: Wed Nov 01, 2017 9:27 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Mon Nov 06, 2017 6:16 pm

I'm in need of some clarification on your issue. Do you want to stretch the VLANs from remote sites back to HQ so you have layer 2 connectivity between the sites? Do you want layer 3 connectivity between the locations from the additional networks present on the remote site VLANs (ping from that VLAN to HQ)?
The vlans at each site does not have to be in the same network as long as they can sent back there data to HQ Servers.

As long as the Server can see and ping it will be good.

I hope that answers your question.
Yes it does, so we'll target layer 3 connectivity and we won't strectch the VLANs over the WAN links. Because you have working L2TP/IPSec connections now your problem is most likely just a routing problem. With L2TP/IPSec you shouldn't need any NAT exclusion rules because it creates an interface and is capable of routing packets naturally. If you were doing a strict IPSec transport mode tunnel you would likely need to use NAT exclusion rules to site to site traffic is NAT'd out to the Internet, this is called a policy based VPN.

You can keep your existing L2TP implementation, with PPP you have the ability to add routes on the server side (HQ, likely). This is done in the /ppp secret menu. You'd use the "route" attribute. This can be leveraged to automatically activate and deactivate a route for each remote-site by having a user for each site and placing a route for each VLAN at the site in the "routes" attribute.

At your client sites, you'll need to use static routes if you don't set the default route to the HQ. You'll need a static route for each network at all remote site networks other than itself and the HQ networks. An alternative for IPv4 would be to specify all RFC1918 addressing to go out over the tunnels. This would keep the benefit of Internet traffic going out locally while tunneling all traffic back to HQ that should be "local."

Dynamic Routing
If you don't want to manage all the routing information, you can use BGP or static OSPF neighbors over L2TP. If you don't feel comfortable with that you can switch to another tunneling technology like GRE that supports multicast which allows a protocol like OSPF or RIP to work as expected. That said, GRE requires static IPs at each remote site and HQ. You can use dynamic addressing with GRE but it requires scripting or manual adjustments to handle Internet IP changes. Like L2TP the GRE tunnels can be wrapped with a transport mode IPSec connection for security.
So I do like what you said about /ppp secret menu routes attribute. Info.

I would like to use the /ppp secret menu routes attribute. I never used them before. The only things I have used is the ip routes menu. I messed with ppp secret menu routes attribute but it does not give you options and what goes there. I don't know how to use it do I put the interface in there or do I put an IP address in there. I could not find any information on what goes in there.

If you let me know what's goes in there or how to use if that would be great.

I appreciate all your help and input. :D
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Mon Nov 06, 2017 6:36 pm

An example with the networks of 192.168.101.0/24 with a gateway of 192.168.255.1/30 and 192.168.201.0/24 with a gateway of 192.168.255.5/30.
ppp secret set 0 routes="192.168.101.0/24 192.168.255.1 1,192.168.201.0/24 192.168.255.5 1"
https://wiki.mikrotik.com/wiki/Manual:PPP_AAA

^^ Search for "routes"

This needs to be performed on the device acting as the L2TP server. It will only inject routes on the L2TP server so the client needs to either accept a default route back to the server or have local static routes.
 
BlueTechnomage
newbie
Topic Author
Posts: 46
Joined: Wed Nov 01, 2017 9:27 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Tue Nov 07, 2017 8:38 pm

An example with the networks of 192.168.101.0/24 with a gateway of 192.168.255.1/30 and 192.168.201.0/24 with a gateway of 192.168.255.5/30.
ppp secret set 0 routes="192.168.101.0/24 192.168.255.1 1,192.168.201.0/24 192.168.255.5 1"
https://wiki.mikrotik.com/wiki/Manual:PPP_AAA

^^ Search for "routes"

This needs to be performed on the device acting as the L2TP server. It will only inject routes on the L2TP server so the client needs to either accept a default route back to the server or have local static routes.

I set up as you said and on the Server side and the client and on the server side I see in the Route list the that the Vlans are there from the other sites but it say unreachable but I can ping there gateway and from the mikrotik at HQ. Put other PC's cannot ping the vlans form the other sites at HQ. I don’t know where to go from here?
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Tue Nov 07, 2017 8:41 pm

Post a /ip route print from the hq and one of the branches. Maybe a little drawing showing the networks involved too.
 
BlueTechnomage
newbie
Topic Author
Posts: 46
Joined: Wed Nov 01, 2017 9:27 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Tue Nov 07, 2017 9:53 pm

Post a /ip route print from the hq and one of the branches. Maybe a little drawing showing the networks involved too.
HQ Route list

Image

The one that say 10.3.0.0 and 10.10.10.0 are from the Vlans test site.


Client route list

Image


Network layout simple

Image
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.  [SOLVED]

Tue Nov 07, 2017 10:06 pm

Post a /ip route print from the hq and one of the branches. Maybe a little drawing showing the networks involved too.
HQ Route list

Image

The one that say 10.3.0.0 and 10.10.10.0 are from the Vlans test site.


Client route list

Image


Network layout simple

Image
For the HQ side with PPP Secrets based routes you'll need a gateway that is test site's router IP that is reachable from HQ. This usually manifests itself as the IP assigned to the link connecting the routers, the L2TP connection in your case. If you're assigning this statically in the PPP Secret as well via remote-address then specify this as the gateway.

Please post the results of (terminal):
/ppp export hide-sensitive
 
BlueTechnomage
newbie
Topic Author
Posts: 46
Joined: Wed Nov 01, 2017 9:27 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Tue Nov 07, 2017 10:19 pm

Post a /ip route print from the hq and one of the branches. Maybe a little drawing showing the networks involved too.
HQ Route list

Image

The one that say 10.3.0.0 and 10.10.10.0 are from the Vlans test site.


Client route list

Image


Network layout simple

Image
For the HQ side with PPP Secrets based routes you'll need a gateway that is test site's router IP that is reachable from HQ. This usually manifests itself as the IP assigned to the link connecting the routers, the L2TP connection in your case. If you're assigning this statically in the PPP Secret as well via remote-address then specify this as the gateway.

Please post the results of (terminal):
/ppp export hide-sensitive

add comment="Site1 VPN" local-address=192.168.1.1 name=user1 remote-address=\
192.168.2.1 service=l2tp
add comment=Site2 local-address=192.168.1.1 name=user2 remote-address=\
192.168.3.1 service=l2tp
add comment=Test local-address=192.168.1.1 name=user3 remote-address=\
192.168.88.1 routes="10.10.10.0/24 10.10.10.1 1, 10.3.0.0/24 10.3.0.1 1" \
service=l2tp
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Tue Nov 07, 2017 10:26 pm

Post a /ip route print from the hq and one of the branches. Maybe a little drawing showing the networks involved too.
HQ Route list

Image

The one that say 10.3.0.0 and 10.10.10.0 are from the Vlans test site.


Client route list

Image


Network layout simple

Image
For the HQ side with PPP Secrets based routes you'll need a gateway that is test site's router IP that is reachable from HQ. This usually manifests itself as the IP assigned to the link connecting the routers, the L2TP connection in your case. If you're assigning this statically in the PPP Secret as well via remote-address then specify this as the gateway.

Please post the results of (terminal):
/ppp export hide-sensitive

add comment="Site1 VPN" local-address=192.168.1.1 name=user1 remote-address=\
192.168.2.1 service=l2tp
add comment=Site2 local-address=192.168.1.1 name=user2 remote-address=\
192.168.3.1 service=l2tp
add comment=Test local-address=192.168.1.1 name=user3 remote-address=\
192.168.88.1 routes="10.10.10.0/24 10.10.10.1 1, 10.3.0.0/24 10.3.0.1 1" \
service=l2tp
So, when using L2TP in the fashion you are (as a site to site VPN) when I do not need to present the same subnet in both sites (stretched) I typically make the local-address and remote-address part of unique non-overlapping ranges. This keeps things clean and won't require the use of Proxy ARP.

To do this, grab an unused private IP, say 10.255.255.0/24. Assign IPs from this /24 to each site. I also prefer to create a unique local-address for each client for this particular use case since everything else is statically defined. It helps in troubleshooting with traceroute and knowing 100% for sure the correct IP is chosen for routes.

So, hypothetically, if we use 10.255.255.0/24. Let's do:

Site1 local-address: 10.255.255.11
Site1 remote-address: 10.255.255.61
Site2 local-address: 10.255.255.12
Site2 remote-address: 10.255.255.62
Site3 (test) local-address: 10.255.255.13
Site3 (test) remote-address: 10.255.255.63

You would then adjust the routes section in PPP secrets to be "10.3.0.0/24 10.255.255.63 251,10.10.10.0/24 10.255.255.63 251"

I set a higher than normal distance here as a precaution to allow any future dynamic protocols to take precedence.
 
BlueTechnomage
newbie
Topic Author
Posts: 46
Joined: Wed Nov 01, 2017 9:27 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Wed Nov 08, 2017 5:09 pm

Post a /ip route print from the hq and one of the branches. Maybe a little drawing showing the networks involved too.
HQ Route list

Image

The one that say 10.3.0.0 and 10.10.10.0 are from the Vlans test site.


Client route list

Image


Network layout simple

Image
For the HQ side with PPP Secrets based routes you'll need a gateway that is test site's router IP that is reachable from HQ. This usually manifests itself as the IP assigned to the link connecting the routers, the L2TP connection in your case. If you're assigning this statically in the PPP Secret as well via remote-address then specify this as the gateway.

Please post the results of (terminal):
/ppp export hide-sensitive

add comment="Site1 VPN" local-address=192.168.1.1 name=user1 remote-address=\
192.168.2.1 service=l2tp
add comment=Site2 local-address=192.168.1.1 name=user2 remote-address=\
192.168.3.1 service=l2tp
add comment=Test local-address=192.168.1.1 name=user3 remote-address=\
192.168.88.1 routes="10.10.10.0/24 10.10.10.1 1, 10.3.0.0/24 10.3.0.1 1" \
service=l2tp
So, when using L2TP in the fashion you are (as a site to site VPN) when I do not need to present the same subnet in both sites (stretched) I typically make the local-address and remote-address part of unique non-overlapping ranges. This keeps things clean and won't require the use of Proxy ARP.

To do this, grab an unused private IP, say 10.255.255.0/24. Assign IPs from this /24 to each site. I also prefer to create a unique local-address for each client for this particular use case since everything else is statically defined. It helps in troubleshooting with traceroute and knowing 100% for sure the correct IP is chosen for routes.

So, hypothetically, if we use 10.255.255.0/24. Let's do:

Site1 local-address: 10.255.255.11
Site1 remote-address: 10.255.255.61
Site2 local-address: 10.255.255.12
Site2 remote-address: 10.255.255.62
Site3 (test) local-address: 10.255.255.13
Site3 (test) remote-address: 10.255.255.63

You would then adjust the routes section in PPP secrets to be "10.3.0.0/24 10.255.255.63 251,10.10.10.0/24 10.255.255.63 251"

I set a higher than normal distance here as a precaution to allow any future dynamic protocols to take precedence.


idlemind

Thank you for all your help. I appreciate. :D :D :D
 
idlemind
Forum Guru
Forum Guru
Posts: 1146
Joined: Fri Mar 24, 2017 11:15 pm
Location: USA

Re: Vlans to run over L2TP/IPsec.

Wed Nov 08, 2017 6:22 pm

idlemind
Thank you for all your help. I appreciate. :D :D :D
No problem! Good luck on your adventures!

Who is online

Users browsing this forum: eworm, mfischer, scartzulesc and 126 guests