Community discussions

MikroTik App
 
thokr
just joined
Topic Author
Posts: 3
Joined: Wed Jul 20, 2022 5:37 am

OSPF over L2TP not discovering routes

Wed Jul 20, 2022 6:41 am

I'm trying to set up OSPF over L2TP/IPsec tunnel between 2 routers.

I did read the wiki and studied some examples, everything appears to be configured correctly, but for some reason the L2TP route on the client isn't discovered. Maybe I still don't understand something, since it's my first time setting up OSPF. This is the simplest possible config with only one area.

Server (irrelevant addresses omitted):
# jul/20/2022 09:47:28 by RouterOS 6.47.10
# software id = K0WV-8ZEN
#
# model = RB4011iGS+
# serial number = <CENSORED>
[admin@MikroTik] /ip address> p
Flags: X - disabled, I - invalid, D - dynamic
 #   ADDRESS            NETWORK         INTERFACE
 0   172.22.10.20/23    172.22.10.0     bridge
 ...
 6   10.255.255.1/32    10.255.255.1    loopback
 7 D 172.22.6.1/32      172.22.6.2      <l2tp-server>
[admin@MikroTik] /routing ospf instance> p
Flags: X - disabled, * - default
 0  * name="default" router-id=10.255.255.1 distribute-default=never
      redistribute-connected=no redistribute-static=no redistribute-rip=no
      redistribute-bgp=no redistribute-other-ospf=no metric-default=1
      metric-connected=20 metric-static=20 metric-rip=20 metric-bgp=auto
      metric-other-ospf=auto in-filter=ospf-in out-filter=ospf-out
[admin@MikroTik] /routing ospf network> p
Flags: X - disabled, I - invalid
 #   NETWORK            AREA
 0   172.22.6.0/24      backbone
 1   172.22.10.0/23     backbone
 2   172.22.30.0/23     backbone
[admin@MikroTik] /routing ospf interface> p
Flags: X - disabled, I - inactive, D - dynamic, P - passive
 #    INTERFACE              COST PRIORITY NETWORK-TYPE   AUTHENTICATION AUTHENTICATION-KEY
 0 D  <l2tp-server>           10        1 point-to-point none
 1 D  bridge                  10        1 broadcast      none
[admin@MikroTik] /routing ospf neighbor> p
 0 instance=default router-id=10.255.255.1 address=172.22.6.2 interface=<l2tp-server>
   priority=1 dr-address=0.0.0.0 backup-dr-address=0.0.0.0 state="2-Way"
   state-changes=282622 ls-retransmits=0 ls-requests=0 db-summaries=0
[admin@MikroTik] /routing ospf route> p
 # DST-ADDRESS        STATE          COST             GATEWAY         INTERFACE
 0 172.22.6.2/32      intra-area     10               0.0.0.0         <l2tp-server>
 1 172.22.10.0/23     intra-area     10               0.0.0.0         bridge
Client:
# jul/20/2022 06:48:58 by RouterOS 6.48.6
# software id = 9FSR-W63L
#
# model = RouterBOARD mAP 2nD
# serial number = <CENSORED>
[admin@MikInetGW] /ip address> p
Flags: X - disabled, I - invalid, D - dynamic
 #   ADDRESS            NETWORK         INTERFACE
 0   172.22.30.21/23    172.22.30.0     bridge
 ...
 2   10.255.255.1/32    10.255.255.1    loopback
 ...
 4 D 172.22.6.2/32      172.22.6.1      l2tp-client
[admin@MikInetGW] /routing ospf instance> p
Flags: X - disabled, * - default
 0  * name="default" router-id=10.255.255.1 distribute-default=never
      redistribute-connected=no redistribute-static=no redistribute-rip=no
      redistribute-bgp=no redistribute-other-ospf=no metric-default=1
      metric-connected=20 metric-static=20 metric-rip=20 metric-bgp=auto
      metric-other-ospf=auto in-filter=ospf-in out-filter=ospf-out
[admin@MikInetGW] /routing ospf network> p
Flags: X - disabled, I - invalid
 #   NETWORK            AREA
 0   172.22.6.0/24      backbone
 1   172.22.10.0/23     backbone
 2   172.22.30.0/23     backbone
[admin@MikInetGW] /routing ospf interface> p
Flags: X - disabled, I - inactive, D - dynamic, P - passive
 #    INTERFACE                  COST PRI NETWORK-TYPE   AUT... AUTHENTICATIO...
 0 D  bridge                       10   1 broadcast      none
 1 D  l2tp-client                  10   1 point-to-point none
[admin@MikInetGW] /routing ospf neighbor> p
 0 instance=default router-id=10.255.255.1 address=172.22.6.1
   interface=l2tp-client priority=1 dr-address=0.0.0.0
   backup-dr-address=0.0.0.0 state="2-Way" state-changes=283890
   ls-retransmits=0 ls-requests=0 db-summaries=0
[admin@MikInetGW] /routing ospf route> p
 # DST-ADDRESS        STATE          COST         GATEWAY         INTERFACE
 0 172.22.6.1/32      intra-area     10           0.0.0.0         l2tp-client
 1 172.22.30.0/23     intra-area     10           0.0.0.0         bridge

As can be seen, the routers can reach each other via 172.22.6.0/24 but there's no route added that would use this network as a gateway to the other router network, for example:
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 5 A S  172.22.10.0/23                     172.22.6.1                1

If I manually add the static route above on the client everything works, but then it obviously defeats the purpose of OSPF. It should be discovered automatically.

Any help would be hugely appreciated!
 
mixig
Member
Member
Posts: 311
Joined: Thu Oct 27, 2011 2:19 pm

Re: OSPF over L2TP not discovering routes

Thu Jul 21, 2022 2:27 pm

Ospf is not establish, need to be in "FULL" state, in your case it is in "2-way" state.
 
thokr
just joined
Topic Author
Posts: 3
Joined: Wed Jul 20, 2022 5:37 am

Re: OSPF over L2TP not discovering routes  [SOLVED]

Thu Jul 21, 2022 8:56 pm

Thank you, I got it! The problem was that both routers had the same router-id. I got the wrong idea from the wiki they they can have same loopback address as their IDs.

Who is online

Users browsing this forum: No registered users and 17 guests