OSPF Bug: incorrect network advertisement for point-to-point addresses

Tested in CHR 7.14.3 and 7.15rc4. Compared with CHR 6.49.6

TLDR

RouterOS v7 doesn't advertise network for point-to-point addresses (peer address). It advertises self-address instead.

Example

R1 is an ABR for A area. RA es an A intra-area router.

R1 configuration:

/routing ospf instance
add disabled=no name=ospf
/routing ospf area
add disabled=no instance=ospf name=backbone
add area-id=0.0.0.1 default-cost=1 disabled=no instance=ospf name=A no-summaries type=stub
/ip address
add address=10.0.0.1/24 interface=ether2 network=10.0.0.0
add address=10.255.255.1 interface=lo network=10.255.255.1
/ip dhcp-client
add interface=ether1
/routing ospf interface-template
add area=backbone disabled=no interfaces=ether1 passive
add area=A disabled=no interfaces=ether2 type=ptp
/system identity
set name=R1

RA configuration:

/routing ospf instance
add disabled=no name=ospf
/routing ospf area
add area-id=0.0.0.1 disabled=no instance=ospf name=A type=stub
/ip address
add address=10.0.0.2/24 interface=ether1 network=10.0.0.0
add address=10.255.255.2 interface=lo network=10.255.255.2
add address=10.100.100.100 interface=ether2 network=10.200.200.200
/routing ospf interface-template
add area=A disabled=no interfaces=ether1 type=ptp
add area=A disabled=no networks=10.200.200.0/24 passive
/system identity
set name=RA

When checking advertised routes on R1, we can see that RA has advertised the address instead of the network:

[admin@R1] > ip/route/print 
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF, d - DHCP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
    DST-ADDRESS        GATEWAY          DISTANCE
DAd 0.0.0.0/0          192.168.122.1           1
DAc 10.0.0.0/24        ether2                  0
DAo 10.100.100.100/32  10.0.0.2%ether2       110     <-------
DAc 10.255.255.1/32    lo                      0
DAc 192.168.122.0/24   ether1                  0

If we use CHR v6.49.6 for RA:

/interface bridge
add name=lo
/routing ospf area
add area-id=0.0.0.1 default-cost=1 inject-summary-lsas=yes name=A type=stub
/ip address
add address=10.0.0.2/24 interface=ether1 network=10.0.0.0
add address=10.100.100.100 interface=ether2 network=10.200.200.200
add address=10.255.255.2 interface=lo network=10.255.255.2
/routing ospf interface
add interface=all passive=yes
add interface=ether1 network-type=point-to-point
/routing ospf network
add area=A network=10.0.0.0/24
add area=A network=10.200.200.0/24
/system identity
set name=RA

The advertisement are correct, as we can see on R1:

[admin@R1] > ip/route/print 
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF, d - DHCP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
    DST-ADDRESS        GATEWAY          DISTANCE
DAd 0.0.0.0/0          192.168.122.1           1
DAc 10.0.0.0/24        ether2                  0
DAo 10.200.200.200/32  10.0.0.2%ether2       110 <------
DAc 10.255.255.1/32    lo                      0
DAc 192.168.122.0/24   ether1                  0

LSA

# CHR 6.49.6 
[admin@RA] > routing ospf lsa print detail 
 instance=default area=A type=router id=10.0.0.2 originator=10.0.0.2 sequence-number=0x80000003 age=142 checksum=0x7EA2 
   options="" body=
     flags=
     links (type, id, data, metric)
         Stub 10.200.200.200 255.255.255.255 10
         Point-To-Point 192.168.122.127 10.0.0.2 10
         Stub 10.0.0.0 255.255.255.0 10

 instance=default area=A type=router id=192.168.122.127 originator=192.168.122.127 sequence-number=0x80000008 age=147 
   checksum=0xA2B2 options="" body=
     flags=BORDER
     links (type, id, data, metric)
         Point-To-Point 10.0.0.2 10.0.0.1 1
         Stub 10.0.0.0 255.255.255.0 1

 instance=default area=A type=summary-network id=0.0.0.0 originator=192.168.122.127 sequence-number=0x80000001 age=767 
   checksum=0x31C9 options="" body=
     netmask=0.0.0.0
     metric=1

For RC version:

# CHR 7.15rc4
[admin@RA] > routing/ospf/lsa/print detail 
Flags: S - self-originated, F - flushing, W - wraparound; D - dynamic 
 0 SD instance=ospf area=A type="router" originator=10.255.255.2 id=10.255.255.2 sequence=0x8000000A age=14 checksum=0x4022 
      body=
        options=
            type=p2p id=192.168.122.127 data=10.0.0.2 metric=1
            type=stub id=10.0.0.0 data=255.255.255.0 metric=1
            type=stub id=10.100.100.100 data=255.255.255.255 metric=1

 1  D instance=ospf area=A type="router" originator=192.168.122.127 id=192.168.122.127 sequence=0x8000000B age=22 checksum=0x9CB5 
      body=
        options= bits=B
            type=p2p id=10.255.255.2 data=10.0.0.1 metric=1
            type=stub id=10.0.0.0 data=255.255.255.0 metric=1

 2  D instance=ospf area=A type="inter-area-prefix" originator=192.168.122.127 id=0.0.0.0 sequence=0x80000001 age=891 
      checksum=0x31C9 body=
        netmask=0.0.0.0
        metric=1

Have you checked with Mikrotik Support? (support@mikrotik.com)

/ip address
add address=10.100.100.100 interface=ether2 network=10.200.200.200

/24 is missing on the address definition!
Default is /32 which it advertises…

Like pe1chl said, but if you want to summarize those /32 routes then use “ospf area range”.

Still the same exact setting (right or wrong) in ip address:

add address=10.100.100.100 interface=ether2 network=10.200.200.200

leads to two different routes/stubs:
V6:

DAo 10.200.200.200/32 10.0.0.2%ether2 110 <------

links (type, id, data, metric)
Stub 10.200.200.200 255.255.255.255 10

V7:

DAo 10.100.100.100/32 10.0.0.2%ether2 110 <-------

type=stub id=10.100.100.100 data=255.255.255.255 metric=1

if not a bug, it is a least a different behaviour.

Besides the address/network, also the netmask is different (.255 in V7 vs the .10 in V6).

It can well be that the V7 is correct and the V6 is not, of course.

v7 is correct.

Well, the post is about Point-To-Point addreses (/32) in which address is local IP for the point-to-point and network is the-other-side IP.
I used this addresses in order to show the different behaviour in v6 and v7.

Not sure. Let me rewrite the LAB. Instead of this ‘artificial scenario’ y will try with a more usual ona. R1 will be a PPPoE Server with IP Pool 10.200.200.0/24. Several clients connected, same local-IP and a little change in OSPF configuration, default area instead of stub:

/ip pool
add name=pppoe-pool ranges=10.200.200.0/24
/ppp profile
add local-address=10.100.100.100 name=profile1 remote-address=pppoe-pool
/interface pppoe-server server
add disabled=no interface=ether2
/ip address
add address=10.0.0.2/24 interface=ether1 network=10.0.0.0
add address=10.255.255.2 interface=lo network=10.255.255.2
/ppp secret
add name=user password=password profile=profile1
/routing ospf instance
add disabled=no name=ospf 
/routing ospf area
add area-id=0.0.0.1 disabled=no instance=ospf name=A
/routing ospf interface-template
add area=A disabled=no interfaces=ether1 type=ptp
add area=A disabled=yes networks=10.200.200.0/24 passive
/system identity
set name=RA

When connecting three clients, this are IP addresses and routes:

[admin@RA] > ip/address/print 
Flags: D - DYNAMIC
Columns: ADDRESS, NETWORK, INTERFACE
#   ADDRESS            NETWORK         INTERFACE     
0   10.0.0.2/24        10.0.0.0        ether1        
1   10.255.255.2/32    10.255.255.2    lo            
2 D 10.100.100.100/32  10.200.200.255  <pppoe-user>  
3 D 10.100.100.100/32  10.200.200.254  <pppoe-user-1>
4 D 10.100.100.100/32  10.200.200.253  <pppoe-user-2>
[admin@RA] > ip/route/print 
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF
Columns: DST-ADDRESS, GATEWAY, DISTANCE
    DST-ADDRESS        GATEWAY          DISTANCE
DAo 0.0.0.0/0          10.0.0.1%ether1       110
DAc 10.0.0.0/24        ether1                  0
DAc 10.200.200.253/32  <pppoe-user-2>          0
DAc 10.200.200.254/32  <pppoe-user-1>          0
DAc 10.200.200.255/32  <pppoe-user>            0
DAc 10.255.255.2/32    lo                      0

When using v7, it is not the network the advertised thing but the address. NOT NETWORK BUT ADDRESS.

[admin@R1] > ip/route/print 
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF, d - DHCP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
    DST-ADDRESS        GATEWAY          DISTANCE
DAd 0.0.0.0/0          192.168.122.1           1
DAc 10.0.0.0/24        ether2                  0
DAo 10.100.100.100/32  10.0.0.2%ether2       110
DAc 10.255.255.1/32    lo                      0
DAc 192.168.122.0/24   ether1                  0

But if I disable network 10.200.200.0/24 (the one I wanted to be part of OSPF) and choose to redistribute CONNECTED:

[admin@RA] > routing/ospf/interface-template/print 
Flags: X - disabled, I - inactive 
 0   area=A interfaces=ether1 instance-id=0 type=ptp retransmit-interval=5s transmit-delay=1s hello-interval=10s 
     dead-interval=40s priority=128 cost=1 

 1 X area=A instance-id=0 networks=10.200.200.0/24 type=broadcast retransmit-interval=5s transmit-delay=1s hello-interval=10s 
     dead-interval=40s priority=128 cost=1 passive 

[admin@RA] > routing/ospf/instance/print                        
Flags: X - disabled, I - inactive 
 0   name="ospf" version=2 vrf=main router-id=main redistribute=connected

Now, the redistribution is correct: the NETWORK not the ADDRESS:

[admin@R1] > ip/route/print 
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF, d - DHCP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
    DST-ADDRESS        GATEWAY          DISTANCE
DAd 0.0.0.0/0          192.168.122.1           1
DAc 10.0.0.0/24        ether2                  0
DAo 10.200.200.253/32  10.0.0.2%ether2       110
DAo 10.200.200.254/32  10.0.0.2%ether2       110
DAo 10.200.200.255/32  10.0.0.2%ether2       110
DAc 10.255.255.1/32    lo                      0
DAo 10.255.255.2/32    10.0.0.2%ether2       110
DAc 192.168.122.0/24   ether1                  0

I know a lot of ISP that are using PPPoE server, with an AREA defined for the client Pool with AREA RANGE… and this configuration doesn’t work in v7 (and in my opinion, it is a BUG)

Please, if I am wrong, I will be happy to hear how to do it properly. Thanks!

Sent email and assigned #[SUP-154326]. No answer yet.

This caught me out a few weeks ago when converting from 6.x to 7.x. Although it isn’t mentioned anywhere in the documentation I could find /routing ospf interface-template has some hidden functionality where specifying type=ptp swaps the local and remote addresses, try
add area=A disabled=no networks=10.200.200.0/24 passive type=ptp

Very interesting… it is interesting… and it works! And yes… the interfaces are point-to-point so maybe this is the (correct) way to do it!

[admin@R1] > ip/route/print 
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF, d - DHCP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
    DST-ADDRESS        GATEWAY          DISTANCE
DAd 0.0.0.0/0          192.168.122.1           1
DAc 10.0.0.0/24        ether2                  0
DAo 10.100.100.100/32  10.0.0.2%ether2       110
DAc 10.255.255.1/32    lo                      0
DAc 192.168.122.0/24   ether1                  0

After modifying type in RA:

[admin@RA] > routing/ospf/interface-template/set 1 type=ptp

[admin@R1] > ip/route/print 
Flags: D - DYNAMIC; A - ACTIVE; c - CONNECT, o - OSPF, d - DHCP
Columns: DST-ADDRESS, GATEWAY, DISTANCE
    DST-ADDRESS        GATEWAY          DISTANCE
DAd 0.0.0.0/0          192.168.122.1           1
DAc 10.0.0.0/24        ether2                  0
DAo 10.200.200.253/32  10.0.0.2%ether2       110
DAo 10.200.200.254/32  10.0.0.2%ether2       110
DAo 10.200.200.255/32  10.0.0.2%ether2       110
DAc 10.255.255.1/32    lo                      0
DAc 192.168.122.0/24   ether1                  0

[/code}