Friday, February 14, 2014

How to summarize external routes learned from another IGP into the OSPF backbone.

For example, if I had an ASBR in Area 0 redistributing 192.168.10.0/24, 192.168.11.0/24, and 192.168.12.0/24  from RIP into OSPF, I only want to advertise the 192.168.8.0/21 into the backbone.

Junos can summarize at the ABR using "area-range" or "nssa area-range" commands, but this is used to summarize an external route from another Area into the backbone, not from an ASBR. 

You can either do the following:

1. move the router into another area. (not practical)

or

1. Create an aggregate/generated route covering the desired routes
2. Instead of importing the IGP routes in the routing policy, import the aggregate/generated route

-----------------------------
user@R3# run show route protocol rip                                               

inet.0: 40 destinations, 40 routes (40 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.10.0/24     *[RIP/100] 22:17:43, metric 2, tag 0
                    > to 192.168.0.30 via ge-0/0/3.0
192.168.11.0/24     *[RIP/100] 22:17:43, metric 2, tag 0
                    > to 192.168.0.30 via ge-0/0/3.0
192.168.12.0/24     *[RIP/100] 22:17:43, metric 2, tag 0
                    > to 192.168.0.30 via ge-0/0/3.0
224.0.0.9/32       *[RIP/100] 02:05:02, metric 1
                      MultiRecv

inet6.0: 36 destinations, 39 routes (36 active, 0 holddown, 0 hidden)

[edit]
user@R3# show protocols ospf 
export RIP->OSPF;
area 0.0.0.0 {
    interface ge-2/0/0.0;
    interface ge-2/0/1.0;
    interface lo0.0;
}
area 0.0.0.2 {
    nssa
    interface vlan.100 {
        bfd-liveness-detection {
            minimum-interval 100;
        }
    }
}

jnpr@R3# show routing-options 
aggregate {
    route 192.168.8.0/21;
}

jnpr@R3# show policy-options policy-statement RIP->OSPF 
term AGG {
    from {
        protocol aggregate;
        route-filter 192.168.8.0/21 exact;
    }
    then accept;
}
term LAST {
    then reject;
}




[edit]
user@R3# run show route protocol aggregate detail 

inet.0: 40 destinations, 40 routes (40 active, 0 holddown, 0 hidden)
192.168.8.0/21 (1 entry, 1 announced)
        *Aggregate Preference: 130
                Next hop type: Reject
                Address: 0x1147eec
                Next-hop reference count: 4
                State: <Active Int Ext>
                Age: 2:36:04 
                Task: Aggregate
                Announcement bits (2): 0-KRT 2-OSPF 
                AS path: I (LocalAgg)
                Flags:          Depth: 0 Active
                AS path list:
                AS path: I Refcount: 3
                Contributing Routes (3):
                192.168.10.0/24 proto RIP
                192.168.11.0/24 proto RIP
                192.168.12.0/24 proto RIP

looking at the prefix from another router in area 0

user@R2# run show route 192.168.8/21  

inet.0: 37 destinations, 38 routes (37 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.8.0/21      *[OSPF/150] 02:32:53, metric 0, tag 0
                    > to 192.168.0.22 via ge-1/1/2.0

Looking at the prefix from another router in area 2 (NSSA)

user@R4# run show ospf database nssa    

    OSPF database, Area 0.0.0.2
 Type       ID               Adv Rtr           Seq      Age  Opt  Cksum  Len 
NSSA     0.0.0.0          192.168.255.1     0x80000004  1209  0x20 0xec70  36
NSSA     192.168.8.0       192.168.255.3     0x80000001    16  0x20 0x809e  36
NSSA    *192.168.20.0      192.168.255.7     0x8000001d   360  0x28 0x7d95  36
NSSA    *192.168.21.0      192.168.255.7     0x8000001c  1563  0x28 0x749e  36
NSSA    *192.168.123.252   192.168.255.7     0x8000001c   961  0x28 0x2c83  36

user@R4# run show route 192.168.8/21 

inet.0: 37 destinations, 37 routes (37 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both

192.168.8.0/21      *[OSPF/150] 00:02:12, metric 0, tag 0

                    > to 192.168.0.60 via vlan.100

No comments:

Post a Comment