Community discussions

MikroTik App
 
lacibsd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Mar 10, 2016 9:48 pm

send all traffic through l2tp VPN

Mon Jul 27, 2020 8:13 pm

router-A is connected to router-B via L2TP/IPSec. I can connect successfully to router-B, I receive the local network's IP, I see the active connection on router-B.
I want to send all traffic from router-A via this connection, I tried a few things for the past hour, none seems to be working. Do you have a working tutorial?

router -A
model: 951Ui-2nD
current-firmware: 6.46.5

Router-B
model: RB760iGS
current-firmware: 6.44.5

Thank you!
 
User avatar
evince
Member
Member
Posts: 355
Joined: Thu Jul 05, 2012 12:11 pm
Location: Harzé - Belgique
Contact:

Re: send all traffic through l2tp VPN

Tue Jul 28, 2020 12:58 pm

Hello, add a default route 0.0.0.0/0 gw=your_l2tp_tunnel and a nat rule.
 
lacibsd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Mar 10, 2016 9:48 pm

Re: send all traffic through l2tp VPN

Tue Jul 28, 2020 3:48 pm

Hi,

This is what I have now, where 1.2.3.4 is the VPN server's public IP
ip route print
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADS  0.0.0.0/0                          192.168.0.1               1
 1  DS  0.0.0.0/0                          l2tp-vpn                 1
 2 ADC  10.10.14.1/32      10.10.14.36     l2tp-vpn                 0
 3 ADS  1.2.3.4/32                   192.168.0.1               0
 4 ADC  192.168.0.0/24     192.168.0.101   ether1                    0
 5 ADC  192.168.88.0/24    192.168.88.1    bridge                    0

ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
 0    ;;; defconf: masquerade
      chain=srcnat action=masquerade out-interface-list=WAN ipsec-policy=out,none

 1    chain=srcnat action=masquerade routing-mark=traffic_for_VPN out-interface=l2tp-vpn log=no log-prefix=""
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: send all traffic through l2tp VPN

Tue Jul 28, 2020 4:03 pm

You currently have 2 default routes in the routing table:
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADS  0.0.0.0/0                          192.168.0.1               1
 1  DS  0.0.0.0/0                          l2tp-vpn                  1

You can see that the one using your "normal" gateway has the "A" mark.
This means "Active". Disable the default route over "192.168.0.1", the the other one (over your VPN) will become Active.
 
lacibsd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Mar 10, 2016 9:48 pm

Re: send all traffic through l2tp VPN

Tue Jul 28, 2020 4:38 pm

If I try to disable it I get:
ip route disable numbers=0
failure: can change only static routes
 
lacibsd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Mar 10, 2016 9:48 pm

Re: send all traffic through l2tp VPN

Tue Jul 28, 2020 4:52 pm

I was able to remove the route, however now I can't get out of the LAN from 192.168.88.0/24, while I can still reach my gw on L2TP server and the internet from the MikroTik (L2TP client)
[user@MikroTik] <SAFE> ip route remove numbers=0
[user@MikroTik] <SAFE> ip route print
Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 ADS  0.0.0.0/0                          l2tp-vpn                 1
 1 ADC  10.10.14.1/32      10.10.14.36     l2tp-vpn                 0
 2 ADS  1.2.3.4/32                   192.168.0.1               0
 3 ADC  192.168.0.0/24     192.168.0.101   ether1                    0
 4 ADC  192.168.88.0/24    192.168.88.1    bridge                    0
[user@MikroTik] <SAFE> ping 10.10.14.1
  SEQ HOST                                     SIZE TTL TIME  STATUS
    0 10.10.14.1                                 56  64 17ms
    1 10.10.14.1                                 56  64 10ms
    2 10.10.14.1                                 56  64 11ms
    3 10.10.14.1                                 56  64 11ms
    sent=4 received=4 packet-loss=0% min-rtt=10ms avg-rtt=12ms max-rtt=17ms

[user@MikroTik] <SAFE> ping 8.8.8.8
  SEQ HOST                                     SIZE TTL TIME  STATUS
    0 8.8.8.8                                    56 119 20ms
    1 8.8.8.8                                    56 119 20ms
    2 8.8.8.8                                    56 119 21ms
    3 8.8.8.8                                    56 119 20ms
    sent=4 received=4 packet-loss=0% min-rtt=20ms avg-rtt=20ms max-rtt=21ms
 
User avatar
tomaskir
Trainer
Trainer
Posts: 1162
Joined: Sat Sep 24, 2011 2:32 pm
Location: Slovakia

Re: send all traffic through l2tp VPN

Mon Aug 03, 2020 9:16 pm

Post your config:
/export compact hide-sensitive
 
User avatar
nichky
Forum Guru
Forum Guru
Posts: 1279
Joined: Tue Jun 23, 2015 2:35 pm

Re: send all traffic through l2tp VPN

Mon Aug 03, 2020 11:02 pm

try to increase the distance of 0.1
 
lacibsd
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 56
Joined: Thu Mar 10, 2016 9:48 pm

Re: send all traffic through l2tp VPN

Wed Aug 05, 2020 2:19 am

At this time the VPN server is having issues and I wasn't told an estimate for remediation.
Therefore I can't try further settings yet.
Thank you for your help!

Who is online

Users browsing this forum: Bing [Bot], jhbarrantes, mtkvvv and 72 guests