suiCCIEde

Ciscoman's notes (Записки цыщика c дипломом)

I'm Cisco Champion Community member for 2017!

I'm Cisco Champion Community member for 2017!
"Cisco Champions are passionate about Cisco and happy to share our knowledge, experience, and feedback."

вторник, 1 сентября 2020 г.

PyRIFier-Auto: Helpful automation script to keep your JunOS prefix-lists up-to-date based on RIPE database content

 I completely forgot to publish this update! Fixing it now. Two months ago I made a PyEZ script for my friends from ISP where I was working in the past. This script is based on script from JUNOS Automation Cookbook by Adam Chappell.  PyEZ RIPE Filter Automation, hence I gave it a name "PyRIFier-Auto". This is a simple Python RIPE database parsing tool that finds all routes for AS or AS-SET object and updates JunOS prefix list. It can be useful as cron based tasks to update your filters automatically. Below you can find example of usage:

usage: pyrifier-auto_0.1.3.py [-h] -t router -l prefix-list [-p port]

                              [-u username] [-k keyfile] -n as-set [-d]


Python RIPE Database Parsing Tool That Finds All ROUTES for AS or AS-SET and

Updates JUNOS Prefix Lists


optional arguments:

  -h, --help      show this help message and exit

  -t router       Target router to connect

  -l prefix-list  prefix-list name

  -p port         NETCONF TCP port, default is 830

  -u username     Remote username

  -k keyfile      Path to ssh key file, default is ~/.ssh/id_rsa

  -n as-set       BGP AS or AS-SET to resolve into corresponding routes

  -d              clear/delete prefix list before updating with new data


user@scripts:~$ ./pyrifier-auto.py -t 172.16.1.253 -l PL_TEST -n AS51144

[edit policy-options]
    prefix-list PL_SOME { ... }
+   prefix-list PL_TEST {
+       91.216.167.0/24;
+   }

The only supported authentication method so far is SSH key-based authentication. 

Repository is published on github: https://github.com/enk37/PyRIFier-Auto

Hope it helps somebody, will be happy to know this.

понедельник, 31 августа 2020 г.

Mikrotik RouterOS BGP peer processing serialization

 I've been testing Mikrotik RouterOS BGP implementation recently and noticed very interesting and behavior. Unlike other common network operation systems like Cisco IOS-XE, IOS-XR or Juniper JunOS, RouterOS establishes BGP peering with it's peers one by one every 5 seconds and this timer can not be adjusted. It does not depend on BGP keepalive/hold timers, number of prefixes advertised from the peers or number of peers according to my testing. It does not depend on number of CPUs allocated for VM (or available on hardware router) at least in the current 6.x versions. For example:

[admin@R1] /routing bgp peer> print status interval=10

Flags: X - disabled, E - established 

 0 E name="peer1" instance=default remote-address=192.168.100.2 remote-as=65000 tcp-md5-key=">

     nexthop-choice=default multihop=no route-reflect=no hold-time=3m ttl=default 

     in-filter="" out-filter="" address-families=ip default-originate=never 

     remove-private-as=no as-override=no passive=no use-bfd=no remote-id=192.168.100.2 

     local-address=192.168.100.1 uptime=2m5s prefix-count=5000 updates-sent=0 

     updates-received=5000 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m 

     used-hold-time=3m used-keepalive-time=1m state=established 


 1 E name="peer2" instance=default remote-address=192.168.100.3 remote-as=65000 tcp-md5-key=">

     nexthop-choice=default multihop=no route-reflect=no hold-time=3m ttl=default 

     in-filter="" out-filter="" address-families=ip default-originate=never 

     remove-private-as=no as-override=no passive=no use-bfd=no remote-id=192.168.100.3 

     local-address=192.168.100.1 uptime=2m prefix-count=5000 updates-sent=0 

     updates-received=5000 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m 

     used-hold-time=3m used-keepalive-time=1m state=established 


 2 E name="peer3" instance=default remote-address=192.168.100.4 remote-as=65000 tcp-md5-key=">

     nexthop-choice=default multihop=no route-reflect=no hold-time=3m ttl=default 

     in-filter="" out-filter="" address-families=ip default-originate=never 

     remove-private-as=no as-override=no passive=no use-bfd=no remote-id=192.168.100.4 

     local-address=192.168.100.1 uptime=1m55s prefix-count=5000 updates-sent=0 

     updates-received=5000 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m 

     used-hold-time=3m used-keepalive-time=1m state=established 


 3 E name="peer4" instance=default remote-address=192.168.100.5 remote-as=65000 tcp-md5-key=">

     nexthop-choice=default multihop=no route-reflect=no hold-time=3m ttl=default 

     in-filter="" out-filter="" address-families=ip default-originate=never 

     remove-private-as=no as-override=no passive=no use-bfd=no remote-id=192.168.100.5 

     local-address=192.168.100.1 uptime=1m50s prefix-count=5000 updates-sent=0 

     updates-received=5000 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m 

     used-hold-time=3m used-keepalive-time=1m state=established 


 4 E name="peer5" instance=default remote-address=192.168.100.6 remote-as=65000 tcp-md5-key=">

     nexthop-choice=default multihop=no route-reflect=no hold-time=3m ttl=default 

     in-filter="" out-filter="" address-families=ip default-originate=never 

     remove-private-as=no as-override=no passive=no use-bfd=no remote-id=192.168.100.6 

     local-address=192.168.100.1 uptime=1m45s prefix-count=5000 updates-sent=0 

     updates-received=5000 withdrawn-sent=0 withdrawn-received=0 remote-hold-time=3m 

     used-hold-time=3m used-keepalive-time=1m state=established


All peers are the same traffic generator advertising 5000 prefixes. BGP instance on RouterOS is enabled and then it starts to process peers one by one. Note exact 5 second difference between peers in the uptime field.

This was tested with 6.45.9 and 6.47 software versions. Unfortunately, I was not able to try 7.1beta2 currently available (apparently, there were some improvements in BGP for multi-core/CPU systems according to release notes). 

7.1beta2 I've installed as CHR and requested 60 day trial with unlimited functionality, but unlike 6.x, I cannot enable any other packages except routeros itself, hence BGP is not available for testing there. If you have any idea on how to enable BGP on 7.0beta7 or never, let me know. Appreciate in advance.

пятница, 28 февраля 2020 г.

How to solve ISE "Application Server not running" problem in EVE-NG

Sometimes you may face with situation when ISE Application Server fails to start and you may see the following situation when checking show application status ise output:


Usual tricks like application stop ise followed by application start ise safe or application reset-config ise won't help.  What's next? Re-image? No, not yet. No matter how many times you reload the ISE or wipe/redeploy your instance, state will persist. 

So, how to fix? First of all, check interface status first with show interface and you may see that interface does not have address assigned for some reason despite that it is presented in the configuration and interface is not shutted down:



Note that for me it happened only in case if ISE connected to network type "Cloud". So your fix will typical "shutdown/no shutdown":


After this, just execute usual application start ise and ISE will start normally:


Finally check the status again after few couple of minutes with command show application status ise and you will see that ISE processes are running:


I'll be glad to know if it helped somebody, leave comments please.
Cheers!

пятница, 8 февраля 2019 г.

How to remove all loopback from Cisco IOS configuration at once

Simple script to remove all loopbacks at one, e.g. especially if you created it with some other script as from here https://packetpushers.net/tcl-script-for-creating-many-loopback-interfaces/
or from here: https://blog.ine.com/2014/05/05/ios-random-ipv4-ipv6-route-generator-in-tcl

foreach line_a [split [ exec "sh ip int b | i Loopback" ] "\n"] { 
  if { [ regexp -inline {[0-9/.]+ } [ lindex $line_a 0 ] ] != "" } \
  { ios_config "no interface [ lindex $line_a 0 ]" } 
}

четверг, 21 июня 2018 г.

SRX to ASA converter

I didn't post for quiet a while, so probably it's good idea to share something.
Recently, I was working for few weekend to convert SRX configuration to ASA (don't ask me why and for what reason). I found that there are not a lot of tool available, and one script on github that I found was not working for my config and was lacking few important features, so I forked this project and wrote mine, here is it: https://github.com/enk37/SRX-to-ASA-Converter

Hope somebody will find it useful. Feel free to let me know if you need something to add in it or kind of bugs you may found.

четверг, 20 июля 2017 г.

OSPF tricks with path selection.

Hello dear readers. Do you remember good old INE's OSPF challenge? In reality it's not so old, but anyway. If you haven't hear about it yet, take a look here: http://blog.ine.com/2015/05/10/ospf-path-selection-challenge/
I remembered about this challenge because at the moment I'm preparing for HCIE lab (yes, I spelled this right, Huawei's Certified Internetwork Expert, yeah, just another one challenge for me) and repeating everything related to Routing&Switching that I used to know from my beloved Cisco. Actually much more interesting stuff hidden inside that topology and especially I'm taking about reverse path from R4 to R1. Just for sake of clarity I made this topology little bit more simple by removing R5 at all and here it is for your reference:




So what's going on here behind the scene with routing from R4 to R1's loopback?  Can you guess what will be the result in the R4 routing table and why? By default R4 will install two equal cost routes to routing table and won't take into account that one of paths is through NSSA area:

R4#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
  Known via "ospf 1", distance 110, metric 111, type inter area
  Last update from 10.1.24.2 on GigabitEthernet0/0.24, 00:00:15 ago
  Routing Descriptor Blocks:
  * 10.1.34.3, from 3.3.3.3, 00:00:15 ago, via GigabitEthernet0/0.34
      Route metric is 111, traffic share count is 1
    10.1.24.2, from 2.2.2.2, 00:00:15 ago, via GigabitEthernet0/0.24
      Route metric is 111, traffic share count is 1
R4#sh ip cef 1.1.1.1/32
1.1.1.1/32
  nexthop 10.1.24.2 GigabitEthernet0/0.24
  nexthop 10.1.34.3 GigabitEthernet0/0.34

For purpose of route calculation there is nothing special, we have to find cost to advertising router + cost to summary from area 0. 11+100 = 101+10, the result is the same 111:

R4#sh ip ospf database summary 1.1.1.1

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Summary Net Link States (Area 1)

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 28
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 1.1.1.1 (summary Network Number)
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000003
  Checksum: 0xF2D2
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 101


                Summary Net Link States (Area 2)

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 970
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 1.1.1.1 (summary Network Number)
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000002
  Checksum: 0x31ED
  Length: 28
  Network Mask: /32
        MTID: 0         Metric: 11

R4#sh ip os
R4#sh ip ospf da
R4#sh ip ospf database ro
R4#sh ip ospf database router 2.2.2.2

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Router Link States (Area 2)

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 114
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 2.2.2.2
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000006
  Checksum: 0x3EA7
  Length: 48
  Area Border Router
  AS Boundary Router
  Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 4.4.4.4
     (Link Data) Router Interface address: 10.1.24.2
      Number of MTID metrics: 0
       TOS 0 Metrics: 100

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.1.24.0
     (Link Data) Network Mask: 255.255.255.0
      Number of MTID metrics: 0
       TOS 0 Metrics: 100


R4#sh ip ospf database router 3.3.3.3

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Router Link States (Area 1)

  Routing Bit Set on this LSA in topology Base with MTID 0
  LS age: 52
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 3.3.3.3
  Advertising Router: 3.3.3.3
  LS Seq Number: 80000002
  Checksum: 0xC0C8
  Length: 48
  Area Border Router
  Number of Links: 2

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 4.4.4.4
     (Link Data) Router Interface address: 10.1.34.3
      Number of MTID metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 10.1.34.0
     (Link Data) Network Mask: 255.255.255.0
      Number of MTID metrics: 0
       TOS 0 Metrics: 10
 
 Ok, that was not so interesting. At least yet with Cisco IOS. Let's make thing little bit more complex. What if I add "maximum-paths 1" under ospf configuration? Which route will be selected and feed to the RIB and much more importantly why?
First let's take a look what was chosen by R4 after clear ip ospf process or reloading R4 router (just in these cases plus loss of both neighbors and then restoring at the same time, that's important but about that later):

R4#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
  Known via "ospf 1", distance 110, metric 111, type inter area
  Last update from 10.1.24.2 on GigabitEthernet0/0.24, 00:00:21 ago
  Routing Descriptor Blocks:
  * 10.1.24.2, from 2.2.2.2, 00:00:21 ago, via GigabitEthernet0/0.24
      Route metric is 111, traffic share count is 1
R4#sh ip cef 1.1.1.1/32
1.1.1.1/32
  nexthop 10.1.24.2 GigabitEthernet0/0.24
As you can see, somehow link to 2.2.2.2 router was chosen.  But why? Here is the debug to explain:

*Jul 21 21:52:25.083: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on GigabitEthernet0/0.34 from LOADING to FULL, Loading Done
*Jul 21 21:52:25.083: OSPF-1 SPF  : Do not schedule partial SPF type 3, LSID 1.1.1.1, adv_rtr 2.2.2.2, area 2: INTRA/INTER spf scheduled
*Jul 21 21:52:25.083: OSPF-1 SPF  : Do not schedule partial SPF type 3, LSID 10.1.12.0, adv_rtr 2.2.2.2, area 2: INTRA/INTER spf scheduled
*Jul 21 21:52:25.083: OSPF-1 SPF  : Do not schedule partial SPF type 3, LSID 10.1.13.0, adv_rtr 2.2.2.2, area 2: INTRA/INTER spf scheduled
*Jul 21 21:52:25.083: OSPF-1 SPF  : Do not schedule partial SPF type 3, LSID 10.1.34.0, adv_rtr 2.2.2.2, area 2: INTRA/INTER spf scheduled
*Jul 21 21:52:25.083: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on GigabitEthernet0/0.24 from LOADING to FULL, Loading Done
*Jul 21 21:52:30.083: OSPF-1 INTRA: Running SPF for area 1, SPF-type Full
*Jul 21 21:52:30.083: OSPF-1 INTRA: Initializing to run spf
*Jul 21 21:52:30.083: OSPF-1 INTRA: spf_intra() - rebuilding the tree
*Jul 21 21:52:30.083: OSPF-1 INTRA:  It is a router LSA 4.4.4.4. Link Count 2
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 0, id 3.3.3.3, link data 10.1.34.4, type 1
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 3.3.3.3, gateway 10.1.34.3, dist 10
*Jul 21 21:52:30.083: OSPF-1 INTRA:    Putting LSA on the clist LSID 3.3.3.3, Type 1, Adv Rtr. 3.3.3.3
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 1, id 10.1.34.0, link data 255.255.255.0, type 3
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 10.1.34.255, gateway 10.1.34.0, dist 10
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.34.4, interface GigabitEthernet0/0.34
*Jul 21 21:52:30.083: OSPF-1 INTRA:      Downheap LSA ID 3.3.3.3, Type 1, Adv 3.3.3.3 on clist from index 1 to 1
*Jul 21 21:52:30.083: OSPF-1 INTRA: Update ABR Router Route 3.3.3.3 via GigabitEthernet0/0.34/10.1.34.3, metric 10, area 1
*Jul 21 21:52:30.083: OSPF-1 SPF  : Added ABR path to router 3.3.3.3 via 10.1.34.3, area 1, Area SPF 8, PDB SPF 31, Type Full
*Jul 21 21:52:30.083: OSPF-1 INTRA:  It is a router LSA 3.3.3.3. Link Count 2
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 0, id 4.4.4.4, link data 10.1.34.3, type 1
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Ignore newdist 20 olddist 0
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 1, id 10.1.34.0, link data 255.255.255.0, type 3
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 10.1.34.255, gateway 10.1.34.0, dist 20
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 21:52:30.083: OSPF-1 INTRA: Adding Stub nets
*Jul 21 21:52:30.083: OSPF-1 INTRA: Route update succeeded for 10.1.34.0/255.255.255.0, metric 10, Next Hop: GigabitEthernet0/0.34/10.1.34.4 area 1
*Jul 21 21:52:30.083: OSPF-1 INTRA: Entered intra-area route sync for area 1
*Jul 21 21:52:30.083: OSPF-1 INTRA: Entered intra-area route sync for area 1
*Jul 21 21:52:30.083: OSPF-1 INTRA: Running SPF for area 2, SPF-type Full
*Jul 21 21:52:30.083: OSPF-1 INTRA: Initializing to run spf
*Jul 21 21:52:30.083: OSPF-1 INTRA: spf_intra() - rebuilding the tree
*Jul 21 21:52:30.083: OSPF-1 INTRA:  It is a router LSA 4.4.4.4. Link Count 2
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 0, id 2.2.2.2, link data 10.1.24.4, type 1
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 2.2.2.2, gateway 10.1.24.2, dist 100
*Jul 21 21:52:30.083: OSPF-1 INTRA:    Putting LSA on the clist LSID 2.2.2.2, Type 1, Adv Rtr. 2.2.2.2
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 1, id 10.1.24.0, link data 255.255.255.0, type 3
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 10.1.24.255, gateway 10.1.24.0, dist 100
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.24.4, interface GigabitEthernet0/0.24
*Jul 21 21:52:30.083: OSPF-1 INTRA:      Downheap LSA ID 2.2.2.2, Type 1, Adv 2.2.2.2 on clist from index 1 to 1
*Jul 21 21:52:30.083: OSPF-1 INTRA: Update ABR/ASBR Router Route 2.2.2.2 via GigabitEthernet0/0.24/10.1.24.2, metric 100, area 2
*Jul 21 21:52:30.083: OSPF-1 SPF  : Added ABR/ASBR path to router 2.2.2.2 via 10.1.24.2, area 2, Area SPF 11, PDB SPF 31, Type Full
*Jul 21 21:52:30.083: OSPF-1 INTRA:  It is a router LSA 2.2.2.2. Link Count 2
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 0, id 4.4.4.4, link data 10.1.24.2, type 1
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Ignore newdist 200 olddist 0
*Jul 21 21:52:30.083: OSPF-1 INTRA:   Processing link 1, id 10.1.24.0, link data 255.255.255.0, type 3
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 10.1.24.255, gateway 10.1.24.0, dist 200
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 21:52:30.083: OSPF-1 INTRA: Adding Stub nets
*Jul 21 21:52:30.083: OSPF-1 INTRA: Route update succeeded for 10.1.24.0/255.255.255.0, metric 100, Next Hop: GigabitEthernet0/0.24/10.1.24.4 area 2
*Jul 21 21:52:30.083: OSPF-1 INTRA: Entered intra-area route sync for area 2
*Jul 21 21:52:30.083: OSPF-1 INTRA: Entered intra-area route sync for area 2
*Jul 21 21:52:30.083: OSPF-1 INTER: Check and generate summary LSA into all areas
*Jul 21 21:52:30.083: OSPF-1 INTER: Running spf for summaries area 1
*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 1.1.1.1, mask 255.255.255.255,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 248, seq 0x80000003, area 1
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 1.1.1.1, gateway 0.0.0.0, dist 111
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 21:52:30.083: OSPF-1 INTER: Add succeeded for summary route to 1.1.1.1/255.255.255.255, metric 111
*Jul 21 21:52:30.083: OSPF-1 INTER:   next-hop GigabitEthernet0/0.34/10.1.34.3, area 1

*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 10.1.12.0, mask 255.255.255.0,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 253, seq 0x80000001, area 1
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 10.1.12.0, gateway 0.0.0.0, dist 120
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 21:52:30.083: OSPF-1 INTER: Add succeeded for summary route to 10.1.12.0/255.255.255.0, metric 120
*Jul 21 21:52:30.083: OSPF-1 INTER:   next-hop GigabitEthernet0/0.34/10.1.34.3, area 1
*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 10.1.13.0, mask 255.255.255.0,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 253, seq 0x80000001, area 1
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 10.1.13.0, gateway 0.0.0.0, dist 110
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 21:52:30.083: OSPF-1 INTER: Add succeeded for summary route to 10.1.13.0/255.255.255.0, metric 110
*Jul 21 21:52:30.083: OSPF-1 INTER:   next-hop GigabitEthernet0/0.34/10.1.34.3, area 1
*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 10.1.24.0, mask 255.255.255.0,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 253, seq 0x80000001, area 1
*Jul 21 21:52:30.083: OSPF-1 INTER: Intra-area or connected route exists
*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 4, LSID 2.2.2.2, mask 0.0.0.0,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 253, seq 0x80000001, area 1
*Jul 21 21:52:30.083: OSPF-1 INTER: Entered inter-area route sync for area 1
*Jul 21 21:52:30.083: OSPF-1 INTER: Entered inter-area route sync for area 1
*Jul 21 21:52:30.083: OSPF-1 INTER: Running spf for summaries area 2
*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 1.1.1.1, mask 255.255.255.255,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 1190, seq 0x80000002, area 2
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 1.1.1.1, gateway 0.0.0.0, dist 111
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 21:52:30.083: OSPF-1 INTER: Add succeeded for summary route to 1.1.1.1/255.255.255.255, metric 111
*Jul 21 21:52:30.083: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2

*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 10.1.12.0, mask 255.255.255.0,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 1190, seq 0x80000002, area 2
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add better path to LSA ID 10.1.12.0, gateway 0.0.0.0, dist 110
*Jul 21 21:52:30.083: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 21:52:30.083: OSPF-1 INTER: Add succeeded for summary route to 10.1.12.0/255.255.255.0, metric 110
*Jul 21 21:52:30.083: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2
*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 10.1.13.0, mask 255.255.255.0,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 1152, seq 0x80000003, area 2
*Jul 21 21:52:30.083: OSPF-1 INTER: Lower cost inter-area route exists
*Jul 21 21:52:30.083: OSPF-1 INTER: Start processing: type 3, LSID 10.1.34.0, mask 255.255.255.0,
*Jul 21 21:52:30.083: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 253, seq 0x80000001, area 2
*Jul 21 21:52:30.083: OSPF-1 INTER: Intra-area or connected route exists
*Jul 21 21:52:30.083: OSPF-1 INTER: Entered inter-area route sync for area 2
*Jul 21 21:52:30.083: OSPF-1 INTER: Entered inter-area route sync for area 2
*Jul 21 21:52:30.083: OSPF-1 EXTER: Started Building Type 5 External Routes
*Jul 21 21:52:30.083: OSPF-1 EXTER: Started Building Type 7 External Routes
*Jul 21 21:52:30.083: OSPF-1 EXTER: Started Building Type 7 External Routes
*Jul 21 21:52:30.083: OSPF-1 EXTER: Entered External route sync for area dummy area
*Jul 21 21:52:30.083: OSPF-1 EXTER: Entered External route sync for area dummy area
*Jul 21 21:52:30.083: OSPF-1 EXTER: Entered NSSA route sync for area 1
*Jul 21 21:52:30.083: OSPF-1 EXTER: Entered NSSA route sync for area 1
*Jul 21 21:52:30.083: OSPF-1 EXTER: Entered NSSA route sync for area 2
*Jul 21 21:52:30.083: OSPF-1 EXTER: Entered NSSA route sync for area 2
I highlighted two most important parts of it. Obviously this is just a matter of algorithm and has nothing to do with RFC. Summaries for area 2 calculated right after area 1. What if I replace area 1 with area 3 or any larger ID number? Not hard to guess. Once again, let's take a look at the results and the debug. For sake of clarify I removed SPF debug for everything except summaries and once again highlighted most important and relevant part:

*Jul 21 22:00:16.775: OSPF-1 INTER: Check and generate summary LSA into all areas
*Jul 21 22:00:16.775: OSPF-1 INTER: Running spf for summaries area 2
*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 1.1.1.1, mask 255.255.255.255,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 1657, seq 0x80000002, area 2
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add better path to LSA ID 1.1.1.1, gateway 0.0.0.0, dist 111
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:00:16.775: OSPF-1 INTER: Add succeeded for summary route to 1.1.1.1/255.255.255.255, metric 111
*Jul 21 22:00:16.775: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2

*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 10.1.12.0, mask 255.255.255.0,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 1657, seq 0x80000002, area 2
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add better path to LSA ID 10.1.12.0, gateway 0.0.0.0, dist 110
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:00:16.775: OSPF-1 INTER: Add succeeded for summary route to 10.1.12.0/255.255.255.0, metric 110
*Jul 21 22:00:16.775: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2
*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 10.1.13.0, mask 255.255.255.0,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 1619, seq 0x80000003, area 2
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add better path to LSA ID 10.1.13.0, gateway 0.0.0.0, dist 210
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:00:16.775: OSPF-1 INTER: Add succeeded for summary route to 10.1.13.0/255.255.255.0, metric 210
*Jul 21 22:00:16.775: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2
*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 10.1.34.0, mask 255.255.255.0,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 33, seq 0x80000001, area 2
*Jul 21 22:00:16.775: OSPF-1 INTER: Intra-area or connected route exists
*Jul 21 22:00:16.775: OSPF-1 INTER: Entered inter-area route sync for area 2
*Jul 21 22:00:16.775: OSPF-1 INTER: Entered inter-area route sync for area 2
*Jul 21 22:00:16.775: OSPF-1 INTER: Running spf for summaries area 3
*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 1.1.1.1, mask 255.255.255.255,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 41, seq 0x80000002, area 3
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add better path to LSA ID 1.1.1.1, gateway 0.0.0.0, dist 111
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 22:00:16.775: OSPF-1 INTER: Add succeeded for summary route to 1.1.1.1/255.255.255.255, metric 111
*Jul 21 22:00:16.775: OSPF-1 INTER:   next-hop GigabitEthernet0/0.34/10.1.34.3, area 3

*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 10.1.12.0, mask 255.255.255.0,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 41, seq 0x80000002, area 3
*Jul 21 22:00:16.775: OSPF-1 INTER: Lower cost inter-area route exists
*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 10.1.13.0, mask 255.255.255.0,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 41, seq 0x80000002, area 3
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add better path to LSA ID 10.1.13.0, gateway 0.0.0.0, dist 110
*Jul 21 22:00:16.775: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 22:00:16.775: OSPF-1 INTER: Add succeeded for summary route to 10.1.13.0/255.255.255.0, metric 110
*Jul 21 22:00:16.775: OSPF-1 INTER:   next-hop GigabitEthernet0/0.34/10.1.34.3, area 3
*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 3, LSID 10.1.24.0, mask 255.255.255.0,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 41, seq 0x80000002, area 3
*Jul 21 22:00:16.775: OSPF-1 INTER: Intra-area or connected route exists
*Jul 21 22:00:16.775: OSPF-1 INTER: Start processing: type 4, LSID 2.2.2.2, mask 0.0.0.0,
*Jul 21 22:00:16.775: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 41, seq 0x80000002, area 3
*Jul 21 22:00:16.775: OSPF-1 INTER: Entered inter-area route sync for area 3
*Jul 21 22:00:16.775: OSPF-1 INTER: Entered inter-area route sync for area 3
As we expected now R3 is the preferred next-hop for  R4 to 1.1.1.1/32:

R4#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
  Known via "ospf 1", distance 110, metric 111, type inter area
  Last update from 10.1.34.3 on GigabitEthernet0/0.34, 00:04:06 ago
  Routing Descriptor Blocks:
  * 10.1.34.3, from 3.3.3.3, 00:04:06 ago, via GigabitEthernet0/0.34
      Route metric is 111, traffic share count is 1
R4#sh ip cef 1.1.1.1/32
1.1.1.1/32
  nexthop 10.1.34.3 GigabitEthernet0/0.34

 But if I flap only one interface to R2 that causes neighbor loss:

*Jul 21 22:05:45.189: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on GigabitEthernet0/0.24 from LOADING to FULL, Loading Done
*Jul 21 22:05:46.086: OSPF-1 SPF  : Detect change in LSA type 1, LSID 2.2.2.2 from 2.2.2.2 area 2
*Jul 21 22:05:51.068: OSPF-1 INTRA: Running SPF for area 2, SPF-type Full
*Jul 21 22:05:51.068: OSPF-1 INTRA: Initializing to run spf
*Jul 21 22:05:51.068: OSPF-1 INTRA: spf_intra() - rebuilding the tree
*Jul 21 22:05:51.068: OSPF-1 INTRA:  It is a router LSA 4.4.4.4. Link Count 2
*Jul 21 22:05:51.068: OSPF-1 INTRA:   Processing link 0, id 2.2.2.2, link data 10.1.24.4, type 1
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 2.2.2.2, gateway 10.1.24.2, dist 100
*Jul 21 22:05:51.068: OSPF-1 INTRA:    Putting LSA on the clist LSID 2.2.2.2, Type 1, Adv Rtr. 2.2.2.2
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:05:51.068: OSPF-1 INTRA:   Processing link 1, id 10.1.24.0, link data 255.255.255.0, type 3
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 10.1.24.255, gateway 10.1.24.0, dist 100
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.24.4, interface GigabitEthernet0/0.24
*Jul 21 22:05:51.068: OSPF-1 INTRA:      Downheap LSA ID 2.2.2.2, Type 1, Adv 2.2.2.2 on clist from index 1 to 1
*Jul 21 22:05:51.068: OSPF-1 INTRA: Update ABR/ASBR Router Route 2.2.2.2 via GigabitEthernet0/0.24/10.1.24.2, metric 100, area 2
*Jul 21 22:05:51.068: OSPF-1 SPF  : Added ABR/ASBR path to router 2.2.2.2 via 10.1.24.2, area 2, Area SPF 15, PDB SPF 40, Type Full
*Jul 21 22:05:51.068: OSPF-1 INTRA:  It is a router LSA 2.2.2.2. Link Count 2
*Jul 21 22:05:51.068: OSPF-1 INTRA:   Processing link 0, id 4.4.4.4, link data 10.1.24.2, type 1
*Jul 21 22:05:51.068: OSPF-1 INTRA:   Ignore newdist 200 olddist 0
*Jul 21 22:05:51.068: OSPF-1 INTRA:   Processing link 1, id 10.1.24.0, link data 255.255.255.0, type 3
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 10.1.24.255, gateway 10.1.24.0, dist 200
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:05:51.068: OSPF-1 INTRA: Adding Stub nets
*Jul 21 22:05:51.068: OSPF-1 INTRA: Route update succeeded for 10.1.24.0/255.255.255.0, metric 100, Next Hop: GigabitEthernet0/0.24/10.1.24.4 area 2
*Jul 21 22:05:51.068: OSPF-1 INTRA: Entered intra-area route sync for area 2
*Jul 21 22:05:51.068: OSPF-1 INTRA: Entered intra-area route sync for area 2
*Jul 21 22:05:51.068: OSPF-1 INTRA: Running SPF for area 3, SPF-type Prefix Recalculation
*Jul 21 22:05:51.068: OSPF-1 INTER: Check and generate summary LSA into all areas
*Jul 21 22:05:51.068: OSPF-1 INTER: Running spf for summaries area 2
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 1.1.1.1, mask 255.255.255.255,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 97, seq 0x80000003, area 2
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 1.1.1.1, gateway 0.0.0.0, dist 111
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:05:51.068: OSPF-1 INTER: Add succeeded for summary route to 1.1.1.1/255.255.255.255, metric 111
*Jul 21 22:05:51.068: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 10.1.12.0, mask 255.255.255.0,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 97, seq 0x80000003, area 2
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 10.1.12.0, gateway 0.0.0.0, dist 110
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:05:51.068: OSPF-1 INTER: Add succeeded for summary route to 10.1.12.0/255.255.255.0, metric 110
*Jul 21 22:05:51.068: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 10.1.13.0, mask 255.255.255.0,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 97, seq 0x80000004, area 2
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 10.1.13.0, gateway 0.0.0.0, dist 210
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.24.2, interface GigabitEthernet0/0.24
*Jul 21 22:05:51.068: OSPF-1 INTER: Add succeeded for summary route to 10.1.13.0/255.255.255.0, metric 210
*Jul 21 22:05:51.068: OSPF-1 INTER:   next-hop GigabitEthernet0/0.24/10.1.24.2, area 2
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 10.1.34.0, mask 255.255.255.0,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 2.2.2.2, age 367, seq 0x80000001, area 2
*Jul 21 22:05:51.068: OSPF-1 INTER: Intra-area or connected route exists
*Jul 21 22:05:51.068: OSPF-1 INTER: Entered inter-area route sync for area 2
*Jul 21 22:05:51.068: OSPF-1 INTER: Entered inter-area route sync for area 2
*Jul 21 22:05:51.068: OSPF-1 INTER: Running spf for summaries area 3
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 1.1.1.1, mask 255.255.255.255,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 376, seq 0x80000002, area 3
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 1.1.1.1, gateway 0.0.0.0, dist 111
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 22:05:51.068: OSPF-1 INTER: Add succeeded for summary route to 1.1.1.1/255.255.255.255, metric 111
*Jul 21 22:05:51.068: OSPF-1 INTER:   next-hop GigabitEthernet0/0.34/10.1.34.3, area 3
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 10.1.12.0, mask 255.255.255.0,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 376, seq 0x80000002, area 3
*Jul 21 22:05:51.068: OSPF-1 INTER: Lower cost inter-area route exists
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 10.1.13.0, mask 255.255.255.0,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 376, seq 0x80000002, area 3
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add better path to LSA ID 10.1.13.0, gateway 0.0.0.0, dist 110
*Jul 21 22:05:51.068: OSPF-1 SPF  :    Add path: next-hop 10.1.34.3, interface GigabitEthernet0/0.34
*Jul 21 22:05:51.068: OSPF-1 INTER: Add succeeded for summary route to 10.1.13.0/255.255.255.0, metric 110
*Jul 21 22:05:51.068: OSPF-1 INTER:   next-hop GigabitEthernet0/0.34/10.1.34.3, area 3
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 3, LSID 10.1.24.0, mask 255.255.255.0,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 376, seq 0x80000002, area 3
*Jul 21 22:05:51.068: OSPF-1 INTER: Intra-area or connected route exists
*Jul 21 22:05:51.068: OSPF-1 INTER: Start processing: type 4, LSID 2.2.2.2, mask 0.0.0.0,
*Jul 21 22:05:51.068: OSPF-1 INTER:   adv_rtr 3.3.3.3, age 376, seq 0x80000002, area 3
*Jul 21 22:05:51.068: OSPF-1 INTER: Entered inter-area route sync for area 3
*Jul 21 22:05:51.068: OSPF-1 INTER: Entered inter-area route sync for area 3
*Jul 21 22:05:51.068: OSPF-1 SPF  : Delete  path to router 2.2.2.2 via 10.1.34.3, Area 3, Area SPF 4, PDB SPF 39, SPF Type Prefix Recalculation

R4#sh ip route 1.1.1.1
Routing entry for 1.1.1.1/32
  Known via "ospf 1", distance 110, metric 111, type inter area
  Last update from 10.1.24.2 on GigabitEthernet0/0.24, 00:05:41 ago
  Routing Descriptor Blocks:
  * 10.1.24.2, from 2.2.2.2, 00:05:41 ago, via GigabitEthernet0/0.24
      Route metric is 111, traffic share count is 1
R4#sh ip cef 1.1.1.1/32
1.1.1.1/32
  nexthop 10.1.24.2 GigabitEthernet0/0.24

As you can see, now R4 changed it's behavior and will prefer route to R2, no matter in which order we flap routes. Interesting enough? Rate corner case, but at least we know rules. Such tasty small details.

Now I'm going to tell you something about Huawei's VRP. The same topology, only one thing changed - I added Loopback 0 on R4 with address 4.4.4.4/32 and imported it into both areas to demonstrate an interesting behavior in contrast with Cisco's IOS that will show a big difference in INE's OSPF challenge I've mentioned earlier. Here is the topology for your reference:



 The main difference is that VRP violates RFC3101 and R2 translate Type 7 LSA into Type 5 that leads to ECMP:

dis ospf lsdb ase 4.4.4.4

         OSPF Process 1 with Router ID 1.1.1.1
                 Link State Database


  Type      : External
  Ls id     : 4.4.4.4
  Adv rtr   : 4.4.4.4 
  Ls age    : 696
  Len       : 36
  Options   :  E 
  seq#      : 80000001
  chksum    : 0xcde2
  Net mask  : 255.255.255.255
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 0.0.0.0
  Tag       : 1
  Priority  : Medium

  Type      : External
  Ls id     : 4.4.4.4
  Adv rtr   : 2.2.2.2 
  Ls age    : 263
  Len       : 36
  Options   :  E 
  seq#      : 80000001
  chksum    : 0xf59b
  Net mask  : 255.255.255.255            
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 10.1.24.4
  Tag       : 1
  Priority  : Medium

dis ip routing-table 4.4.4.4
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 2
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        4.4.4.4/32  O_ASE   150  1           D   10.1.12.2       Ethernet0/0/0
                    O_ASE   150  1           D   10.1.13.3       Ethernet0/0/1

But let's talk about original question. What about reverse path from R4 to R1's loopback 1.1.1.1/32? Please note that I also changed cost of R1's loopback 0 to 1 to match IOS because by default cost of any Loopback interface on VRP equals 0.

display ospf lsdb summary 1.1.1.1

         OSPF Process 1 with Router ID 4.4.4.4
                         Area: 0.0.0.2
                 Link State Database

  Type      : Sum-Net
  Ls id     : 1.1.1.1
  Adv rtr   : 2.2.2.2 
  Ls age    : 487
  Len       : 28
  Options   : None
  seq#      : 80000003
  chksum    : 0x7fc7
  Net mask  : 255.255.255.255
  Tos 0  metric: 10
  Priority  : Medium
                         Area: 0.0.0.3
                 Link State Database

                                         
  Type      : Sum-Net
  Ls id     : 1.1.1.1
  Adv rtr   : 3.3.3.3 
  Ls age    : 451
  Len       : 28
  Options   :  E 
  seq#      : 80000001
  chksum    : 0xce1a
  Net mask  : 255.255.255.255
  Tos 0  metric: 100
  Priority  : Medium


display ospf lsdb router 2.2.2.2

         OSPF Process 1 with Router ID 4.4.4.4
                         Area: 0.0.0.2
                 Link State Database


  Type      : Router
  Ls id     : 2.2.2.2
  Adv rtr   : 2.2.2.2 
  Ls age    : 116
  Len       : 48
  Options   :  ASBR  ABR 
  seq#      : 8000000b
  chksum    : 0x8e7a
  Link count: 2
   * Link ID: 4.4.4.4     
     Data   : 10.1.24.2   
     Link Type: P-2-P       
     Metric : 100
   * Link ID: 10.1.24.0   
     Data   : 255.255.255.0
     Link Type: StubNet     
     Metric : 100
     Priority : Low
                         Area: 0.0.0.3
                 Link State Database


display ospf lsdb router 3.3.3.3

         OSPF Process 1 with Router ID 4.4.4.4
                         Area: 0.0.0.3
                 Link State Database


  Type      : Router
  Ls id     : 3.3.3.3
  Adv rtr   : 3.3.3.3 
  Ls age    : 119
  Len       : 48                         
  Options   :  ABR  E 
  seq#      : 80000008
  chksum    : 0x960d
  Link count: 2
   * Link ID: 4.4.4.4     
     Data   : 10.1.34.3   
     Link Type: P-2-P       
     Metric : 10
   * Link ID: 10.1.34.0   
     Data   : 255.255.255.0
     Link Type: StubNet     
     Metric : 10
     Priority : Low

By default VRP performs EMCP, but won't even if I specify it explicitly with:

[R4-ospf-1]maximum load-balancing 2
[R4-ospf-1]dis ip ro 1.1.1.1
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 1
Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.1/32  OSPF    10   110         D   10.1.34.3       Ethernet0/0/1
 
In any case VRP prefers route from area with highest ID number, no matter in which order you flap neighbors. If link to R3 is in area 3, then R3 will be preferred next-hop.

And finally, this is not related to ospf path selection tricks, more about differences between vendors, take a look at VRP R4 ospf routes, do you see something suspicious? Sure, I highlighted it:

dis ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 4        Routes : 4       

OSPF routing table status :
         Destinations : 4        Routes : 4

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        0.0.0.0/0   O_NSSA  150  1           D   10.1.24.2       Ethernet0/0/0
        1.1.1.1/32  OSPF    10   110         D   10.1.34.3       Ethernet0/0/1
      10.1.12.0/24  OSPF    10   110         D   10.1.24.2       Ethernet0/0/0
      10.1.13.0/24  OSPF    10   110         D   10.1.34.3       Ethernet0/0/1

OSPF routing table status :
         Destinations : 0        Routes : 0

Here is R2's ospf config for reference, no magic:

display current-configuration configuration ospf
#
ospf 1
 area 0.0.0.0
 area 0.0.0.2
  nssa
#
In contrast with IOS, R2 generated default route for NSSA area:

display ospf lsdb nssa self-originate

         OSPF Process 1 with Router ID 2.2.2.2
                         Area: 0.0.0.0
                 Link State Database

                         Area: 0.0.0.2
                 Link State Database


  Type      : NSSA
  Ls id     : 0.0.0.0
  Adv rtr   : 2.2.2.2 
  Ls age    : 1728
  Len       : 36
  Options   : None
  seq#      : 80000001
  chksum    : 0xc404
  Net mask  : 0.0.0.0
  TOS 0  Metric: 1
  E type    : 2
  Forwarding Address : 0.0.0.0
  Tag       : 1
  Priority  : Low

That's really interesting and important to know when comparing platforms and vendors. Hope that was interesting for you. Don't forget to leave a comment below!

P.S. Thanks to my colleague Denis for pointing me to some spelling mistakes.

Постоянные читатели

Поиск по этому блогу