1 2 Previous Next 19 Replies Latest reply: Dec 7, 2017 3:03 AM by karthik RSS

    BGP redistribution into OSPF issue

    karthik

      Hello Everyone,

       

      Good day!!

       

      Scenario:

      We have three offices located in India in a different locations. Each office contains two routers. Between locations we are using VPLS connectivity.  R1 is connected to R2. We have OSPF and BGP configured between our Routers in all locations.

       

      All R1's are in one subnet (10.16.x.x/27) and R2's are in another subnet (10.16.x.x/27).

       

      EX:

      From each location we are advertising 10 prefixes to other, where BGP is learning perfectly. the same prefixes we are redistributing into OSPF with Route-map with AS path filtering as below.

       

      rt01#sho ip as-path-access-list 199

      AS path access list 199

           permit ^[0-9]+$                                    All directly connected AS’s prefixes. (The routes directly originated by the peers of your AS).

           permit ^[0-9]+_[0-9]+$                         “Exactly 2 Autonomous Systems path deep” (Any AS number is allowed as per the expression).

           permit _65113_                                    Any instances from AS 65113

           permit _65[12]00_                                Any  instances from AS 65100, 65200

       

      Question : For some reasons, i am only seeing one/few prefix's from other locations into OSPF as type 5 LSA's (external networks). Would request you all to share the tyour inputs.

       

      FYI: I will provide the logs/outputs required. i want this to be resolved.

       

       

      Thanks,

      Karthik Reddy

        • 1. Re: BGP redistribution into OSPF issue
          Daniel Dib CCIE #37149 CCDE #20160011

          Why do you want to filter based on AS path? What's in your BGP table? Which prefixes are making it in and which ones are not? That you expected to be there.

          • 2. Re: BGP redistribution into OSPF issue
            karthik

            I am filtering, because each of my router has 3 different MPLS connections for different purposes (ex: to reach my US offices and Dataceters we use one MPLS||||  second one We use for in country i.e. VPLS |||| 3rd one for other countries), where AS path filter matches as below.

             

            rt01#sho ip as-path-access-list 199

            AS path access list 199

                 permit ^[0-9]+$                                    All directly connected AS’s prefixes.

                 permit ^[0-9]+_[0-9]+$                         “Exactly 2 Autonomous Systems path deep".

                 permit _65[12]00_                                Any  instances from AS 65100, 65200

             

            65100 & 65200 are my DATA center prefixes.

             

            My BGP table contains prefixes from In country i.e Hyderabad, Chennai, Mumbai advertised routes, also the prefixes from Data centers.

             

            majorly the 10.x.x.x./xx networks are not appearing in OSPF learned by BGP.

             

            for example, Mumbai is directly peering with AS65016(Hyderabad) and learning 21 prefixes, out of 21 only 1 network is in OSPF.  Which matches AS path fiter ^[0-9]+$.

             

            Logs:

            rt01#show ip bgp neighbors 10.16.x.x received-routes

            BGP table version is 29446, local router ID is 10.5.110.14

            Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,

                          r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,

                          x best-external, a additional-path, c RIB-compressed,

                          t secondary path,

            Origin codes: i - IGP, e - EGP, ? - incomplete

            RPKI validation codes: V valid, I invalid, N Not found

             

             

                 Network          Next Hop            Metric LocPrf Weight Path

            *>   10.5.110.16/32   10.16.x.x               0             0 65016 i

            *    10.5.111.16/32   10.16.x.x               2             0 65016 i

            *>   10.12.128.0/28   10.16.x.x               3             0 65016 ?

            *>   192.168.2.128/25 10.16.x.x               3             0 65016 ?

             

            Total number of prefixes 21

             

            inMUMrt01# show ip ospf database topology | i 65016

            192.168.2.128   10.5.110.14     1779        0x80000031 0x00FE16 65016

            192.168.2.128   10.5.111.14     1     (DNA) 0x80000001 0x0058EB 65016


            Thanks,

            Karthik

            • 3. Re: BGP redistribution into OSPF issue
              Daniel Dib CCIE #37149 CCDE #20160011

              Please post the configuration of your route-map and verify that your routes are installed in the RIB as BGP routes (show ip route bgp).

              • 4. Re: BGP redistribution into OSPF issue
                Sergey

                Karthik,

                 

                Can you please show your redistribution route-map.

                • 5. Re: BGP redistribution into OSPF issue
                  karthik

                  Hi Sergey,

                   

                  please find the below:

                   

                  FYI: Mumbai is directly peering with Hyderabd (AS 65013), Chennai (As65016) Mumbai (As65014)

                   

                  redistribute bgp 65014 metric-type 1 subnets route-map BGP_TO_OSPF

                   

                  rt01#show route-map BGP_TO_OSPF

                  route-map BGP_TO_OSPF, permit, sequence 1

                    Match clauses:

                      as-path (as-path filter): 199

                    Set clauses:

                    Policy routing matches: 0 packets, 0 bytes

                  route-map BGP_TO_OSPF, permit, sequence 10

                    Match clauses:

                      as-path (as-path filter): 71

                    Set clauses:

                    Policy routing matches: 0 packets, 0 bytes

                  route-map BGP_TO_OSPF, permit, sequence 20

                    Match clauses:

                      as-path (as-path filter): 88

                    Set clauses:

                    Policy routing matches: 0 packets, 0 bytes

                  route-map BGP_TO_OSPF, permit, sequence 30

                    Match clauses:

                      as-path (as-path filter): 68

                    Set clauses:

                    Policy routing matches: 0 packets, 0 bytes

                   

                   

                  AS path access list 199

                       permit ^[0-9]+$

                       permit ^[0-9]+_[0-9]+$

                       permit _65013_

                       permit _65[12]00_

                   

                  AS path access list 71

                       permit ^65100_[0-9]*$

                   

                  AS path access list 88

                       permit _65008$

                       permit _65004$

                   

                  AS path access list 68

                       permit _65013$

                   

                  Thanks,

                  Karthik

                  • 6. Re: BGP redistribution into OSPF issue
                    karthik

                    Dan,

                     

                    Route-map and assigned AS path filter list is in below reply.

                     

                    I have the routes learned by BGP and in route table . here is the output.

                     

                    rt01# show ip route

                    B        10.12.128.0/28 [20/3] via 10.16.x.x, 2d05h

                    B        10.5.111.16/32 [200/0] via 110.16.x.x, 4d05h

                    B        10.5.110.16/32 [20/0] via 10.16.x.x, 2d05h

                    B        192.168.2.128 [20/3] via 10.16.x.x, 2d05h

                    • 7. Re: BGP redistribution into OSPF issue
                      smsnaqvi

                      Hi Karthik

                       

                      Can you draw a quick diagram and send it over please. Picture's worth a thousand words. And my question is as Daniel said that why are you using as-path filters to redistribute BGP routes into OSPF. Why not prefix-lists ? Waiting for your reply

                      • 8. Re: BGP redistribution into OSPF issue
                        karthik

                        Untitled.jpg

                         

                         

                         

                        I have shared the simple topology with limited sites.  Hyderabad  and Mumbai are learning the networks from Data centers also from in country VPLS. we are advertising the in-country networks to DC too.

                         

                        In this context Mumbai routers have network prefixes from DC and locally originated and Hyderabad local-networks and Hyderabad learned DC networks  in its routing table.

                         

                        So i cant just filter all these using prefix-lists, so we are using AS-PATH filters listed in image for redistribution.

                         

                        Thanks,

                        Karthik

                        • 9. Re: BGP redistribution into OSPF issue
                          Daniel Dib CCIE #37149 CCDE #20160011

                          I can't find anything obvious that is wrong. One thing to consider is that BGP does not redistribute iBGP paths by default. So if the best path is via iBGP, those won't get redistributed into OSPF unless you have bgp redistribute-internal under your BGP configuration. To find out what the issue is we need the following:

                           

                          show bgp ipv4 uni x.x.x.x (for one working prefix)

                          show bgp ipv4 uni x.x.x.x (for one non-working prefix)

                          show ip route x.x.x.x (for one working prefix)

                          show ip route x.x.x.x (for one non-working prefix)

                          complete OSPF configuration

                          complete BGP configuration

                          • 10. Re: BGP redistribution into OSPF issue
                            karthik

                            Hi Dan,

                             

                            Please check the below and suggest.

                             

                            show bgp ipv4 uni x.x.x.x (for one working prefix)

                             

                             

                            rt01#show ip bgp ipv4 unicast 192.168.2.128/25

                            BGP routing table entry for 192.168.2.128/25, version 41205

                            Paths: (4 available, best #2, table default)

                              Advertised to update-groups:

                                 1          6          7          9

                              Refresh Epoch 2

                              65016

                                36.7.x.x (inaccessible) from *2407:7A80:0:1:10.16.x.x (10.5.110.16)

                                  Origin incomplete, metric 3, localpref 100, valid, external

                                  rx pathid: 0, tx pathid: 0

                              Refresh Epoch 3

                              65016, (received & used)

                                10.16.52.7 from *10.16.52.7 (10.5.110.16)

                                  Origin incomplete, metric 3, localpref 100, valid, external, best

                                  Community: 65016:65016

                                  rx pathid: 0, tx pathid: 0x0

                              Refresh Epoch 2

                              65013 65016, (received & used)

                                10.16.7 from *10.16.52.2 (10.5.110.13)

                                  Origin incomplete, localpref 100, valid, external

                                  Community: 65016:65016

                                  rx pathid: 0, tx pathid: 0

                              Refresh Epoch 1

                              65016, (received & used)

                                10.16.x.x from 10.12.97.233 (10.5.111.14)

                                  Origin incomplete, metric 3, localpref 100, valid, internal

                                  Community: 65016:65016

                                  rx pathid: 0, tx pathid: 0

                             

                             

                            show bgp ipv4 uni x.x.x.x (for one non-working prefix)

                             

                             

                            rt01#show ip bgp ipv4 unicast 10.5.110.16/32

                            BGP routing table entry for 10.5.110.16/32, version 41193

                            Paths: (3 available, best #2, table default)

                              Advertised to update-groups:

                                 1          6          7          9

                              Refresh Epoch 2

                              65016

                                36.7.x.x (inaccessible) from *2407:7A80:0:1:110.16.x.x (10.5.110.16)

                                  Origin IGP, metric 0, localpref 100, valid, external

                                  rx pathid: 0, tx pathid: 0

                              Refresh Epoch 3

                              65016, (received & used)

                                10.16.x.x from *110.16.x.x (10.5.110.16)

                                  Origin IGP, metric 0, localpref 100, valid, external, best

                                  Community: 65016:65016

                                  rx pathid: 0, tx pathid: 0x0

                              Refresh Epoch 2

                              65013 65016, (received & used)

                                10.16.x.x from *10.16.x.x (10.5.110.13)

                                  Origin IGP, localpref 100, valid, external

                                  Community: 65016:65016

                                  rx pathid: 0, tx pathid: 0

                             

                             

                             

                             

                            show ip route x.x.x.x (for one working prefix)

                             

                             

                            rt01#show ip route 192.168.2.128

                            Routing entry for 192.168.2.128/25

                              Known via "bgp 65014", distance 20, metric 3

                              Tag 65016, type external

                              Redistributing via ospf 10

                              Advertised by ospf 10 metric-type 1 subnets route-map BGP_TO_OSPF

                              Last update from 10.16.x.x 2d11h ago

                              Routing Descriptor Blocks:

                              * 10.16.x.x, from 10.16.x.x, 2d11h ago

                                  Route metric is 3, traffic share count is 1

                                  AS Hops 1

                                  Route tag 65016

                                  MPLS label: none

                             

                             

                             

                             

                            show ip route x.x.x.x (for one non-working prefix)

                             

                             

                            rt01#show ip route 10.5.110.16

                            Routing entry for 10.5.110.16/32

                              Known via "bgp 65014", distance 20, metric 0

                              Tag 65016, type external

                              Redistributing via ospf 10

                              Last update from 10.16.x.x 2d11h ago

                              Routing Descriptor Blocks:

                              * 10.16.x.x, from 10.16.x.x, 2d11h ago

                                  Route metric is 0, traffic share count is 1

                                  AS Hops 1

                                  Route tag 65016

                                  MPLS label: none

                             

                             

                             

                             

                            complete OSPF configuration

                             

                             

                            MUMrt01#show run | be router ospf

                            router ospf 10

                            router-id 10.5.110.14

                            max-metric router-lsa on-startup wait-for-bgp

                            area 0.0.0.0 authentication message-digest

                            summary-address 10.8.0.0 255.255.128.0

                            summary-address 10.12.32.0 255.255.224.0

                            summary-address 10.8.128.0 255.255.128.0

                            summary-address 10.4.0.0 255.252.0.0

                            summary-address 10.8.0.0 255.248.0.0

                            summary-address 10.16.0.0 255.240.0.0

                            summary-address 10.28.0.0 255.255.0.0

                            summary-address 10.118.0.0 255.255.0.0

                            summary-address 10.233.0.0 255.255.224.0

                            summary-address 10.120.0.0 255.254.0.0

                            summary-address 10.142.0.0 255.254.0.0

                            summary-address 10.144.0.0 255.254.0.0

                            redistribute static subnets route-map STATIC

                            redistribute bgp 65014 metric-type 1 subnets route-map BGP_TO_OSPF

                            passive-interface default

                            no passive-interface GigabitEthernet0/0/5

                            no passive-interface TenGigabitEthernet0/1/0

                            no passive-interface TenGigabitEthernet0/1/1

                            no passive-interface TenGigabitEthernet0/1/2

                            network 10.5.110.14 0.0.0.0 area 0.0.0.0

                            network 10.12.70.48 0.0.0.3 area 0.0.0.0

                            network 10.12.76.128 0.0.0.3 area 0.0.0.0

                            network 10.12.76.132 0.0.0.3 area 0.0.0.0

                            network 10.12.97.232 0.0.0.3 area 0.0.0.0

                            default-information originate route-map OSPF_DEF_ROUTE

                            !

                             

                             

                            complete BGP configuration

                             

                             

                            router bgp 65014

                            bgp router-id 10.5.110.14

                            bgp log-neighbor-changes

                            bgp listen range 10.16.x.0/27 peer-group VPLS

                            bgp listen limit 8

                            timers bgp 10 30

                            neighbor VPLS peer-group

                            neighbor VPLS remote-as 65013 alternate-as 65125 65051 65016

                            neighbor VPLS description ATT-VPLS

                            neighbor VPLS fall-over bfd

                            neighbor 10.12.97.233 remote-as 65014

                            neighbor 10.12.97.233 description IBGP-DO NOT NEXT-HOP-SELF

                            neighbor 10.12.97.233 version 4

                            neighbor 172.x.x.x remote-as 65100

                            neighbor 172.x.x.x description AT&T_PE_DeloitteGlobal1

                            neighbor 172.x.x.x version 4

                            !

                            address-family ipv4

                              bgp dampening 1 2000 4000 3

                              network 0.0.0.0 route-map DEFAULT

                              network 10.5.110.14 mask 255.255.255.255

                              network 10.5.112.14 mask 255.255.255.255

                              network 10.12.76.128 mask 255.255.255.252

                              network 10.12.76.132 mask 255.255.255.252

                              network 10.12.88.0 mask 255.255.252.0

                              network 10.12.97.232 mask 255.255.255.252

                              network 10.12.97.248 mask 255.255.255.252

                              network 10.23.65.2 mask 255.255.255.255

                              network 172.x.x.x mask 255.255.255.252 route-map MPLS-PEER

                              aggregate-address 10.12.192.0 255.255.248.0 summary-only

                              aggregate-address 10.12.176.0 255.255.240.0 summary-only

                              aggregate-address 10.12.168.0 255.255.248.0 summary-only

                              aggregate-address 10.12.96.0 255.255.240.0 summary-only

                              aggregate-address 10.12.64.0 255.255.224.0 summary-only

                              redistribute ospf 10 match internal external 1 external 2 route-map TO_BGP_FROM_OSPF

                              neighbor VPLS activate

                              neighbor VPLS send-community both

                              neighbor VPLS soft-reconfiguration inbound

                              neighbor VPLS route-map FROM-ATT-VPLS in

                              neighbor VPLS route-map TO-ATT-VPLS out

                              neighbor 10.12.97.233 activate

                              neighbor 10.12.97.233 send-community both

                              neighbor 10.12.97.233 soft-reconfiguration inbound

                              neighbor 10.12.97.233 unsuppress-map Chennai

                              neighbor 172.x.x.x activate

                              neighbor 172.x.x.x send-community

                              neighbor 172.x.x.x soft-reconfiguration inbound

                              neighbor 172.x.x.x route-map FROM_ATT_US in

                              neighbor 172.x.x.x route-map TO_ATT_US out

                              distance 250 172.x.x.x 0.0.0.0 99

                              distance 230 10.16.x.x 0.0.0.0 66

                              distance 240 10.16.x.x 0.0.0.0 66

                            exit-address-family

                            !

                            • 11. Re: BGP redistribution into OSPF issue
                              karthik

                              I haven't shared the Route-map info of VPLS/MPLS neighbors, because there is no issue in learning BGP routes.

                               

                              The BGP distance commands we used to prefer the default route from neighbors in certain way designed. "for redundancy"

                              • 12. Re: BGP redistribution into OSPF issue
                                Sergey

                                Karthik,

                                 

                                Do you peer from R1 in Mumbai to both R1 and R2 in Hyderabad? If you do, that seems very odd to me, because there is no direct L2 attachment between R1 in Mumbai and R2 in Hyderabad. So everything that you learn from R2 in Hyderabad will have a next-hop that will require recursion and will most likely resolve into R2's address in Mumbai.

                                • 13. Re: BGP redistribution into OSPF issue
                                  karthik

                                  No Mumbai R1 is peering with Hyderabad R1 (10.16.52.0/27) and MumR2 is peering with Hyderabad R2 (10.16.53.0/27).

                                   

                                  Below outputs are without changing any Ip's. hope it help.

                                   

                                  show bgp ipv4 uni x.x.x.x (for one working prefix)

                                   

                                   

                                  rt01#show ip bgp ipv4 unicast 192.168.2.128/25

                                  BGP routing table entry for 192.168.2.128/25, version 41205

                                  Paths: (4 available, best #2, table default)

                                    Advertised to update-groups:

                                       1          6          7          9

                                    Refresh Epoch 2

                                    65016

                                      36.7.x.x(inaccessible) from *2407:7A80:0:1:10:16:52:7 (10.5.110.16)

                                        Origin incomplete, metric 3, localpref 100, valid, external

                                        rx pathid: 0, tx pathid: 0

                                    Refresh Epoch 3

                                    65016, (received & used)

                                      10.16.52.7 from *10.16.52.7 (10.5.110.16)

                                        Origin incomplete, metric 3, localpref 100, valid, external, best

                                        Community: 65016:65016

                                        rx pathid: 0, tx pathid: 0x0

                                    Refresh Epoch 2

                                    65013 65016, (received & used)

                                      10.16.52.7 from *10.16.52.2 (10.5.110.13)

                                        Origin incomplete, localpref 100, valid, external

                                        Community: 65016:65016

                                        rx pathid: 0, tx pathid: 0

                                    Refresh Epoch 1

                                    65016, (received & used)

                                      10.16.53.7 from 10.12.97.233 (10.5.111.14)

                                        Origin incomplete, metric 3, localpref 100, valid, internal

                                        Community: 65016:65016

                                        rx pathid: 0, tx pathid: 0

                                   

                                   

                                   

                                  show bgp ipv4 uni x.x.x.x (for one non-working prefix)

                                   

                                   

                                  rt01#show ip bgp ipv4 unicast 10.5.110.16/32

                                  BGP routing table entry for 10.5.110.16/32, version 41193

                                  Paths: (3 available, best #2, table default)

                                    Advertised to update-groups:

                                       1          6          7          9

                                    Refresh Epoch 2

                                    65016

                                      36.7.x.x (inaccessible) from *2407:7A80:0:1:10:16:52:7 (10.5.110.16)

                                        Origin IGP, metric 0, localpref 100, valid, external

                                        rx pathid: 0, tx pathid: 0

                                    Refresh Epoch 3

                                    65016, (received & used)

                                      10.16.52.7 from *10.16.52.7 (10.5.110.16)

                                        Origin IGP, metric 0, localpref 100, valid, external, best

                                        Community: 65016:65016

                                        rx pathid: 0, tx pathid: 0x0

                                    Refresh Epoch 2

                                    65013 65016, (received & used)

                                      10.16.52.7 from *10.16.52.2 (10.5.110.13)

                                        Origin IGP, localpref 100, valid, external

                                        Community: 65016:65016

                                        rx pathid: 0, tx pathid: 0

                                   

                                   

                                   

                                   

                                  show ip route x.x.x.x (for one working prefix)

                                   

                                   

                                  rt01#show ip route 192.168.2.128

                                  Routing entry for 192.168.2.128/25

                                    Known via "bgp 65014", distance 20, metric 3

                                    Tag 65016, type external

                                    Redistributing via ospf 10

                                    Advertised by ospf 10 metric-type 1 subnets route-map BGP_TO_OSPF

                                    Last update from 10.16.52.7 2d11h ago

                                    Routing Descriptor Blocks:

                                    * 10.16.52.7, from 10.16.52.7, 2d11h ago

                                        Route metric is 3, traffic share count is 1

                                        AS Hops 1

                                        Route tag 65016

                                        MPLS label: none

                                   

                                   

                                   

                                  show ip route x.x.x.x (for one non-working prefix)

                                   

                                   

                                  rt01#show ip route 10.5.110.16

                                  Routing entry for 10.5.110.16/32

                                    Known via "bgp 65014", distance 20, metric 0

                                    Tag 65016, type external

                                    Redistributing via ospf 10

                                    Last update from 10.16.52.7 2d11h ago

                                    Routing Descriptor Blocks:

                                    * 10.16.52.7, from 10.16.52.7, 2d11h ago

                                        Route metric is 0, traffic share count is 1

                                        AS Hops 1

                                        Route tag 65016

                                        MPLS label: none

                                  • 14. Re: BGP redistribution into OSPF issue
                                    Daniel Dib CCIE #37149 CCDE #20160011

                                    Hi,

                                     

                                    It looks like you are summarizing external routes in OSPF:

                                     

                                    summary-address 10.8.0.0 255.255.128.0
                                    summary-address 10.12.32.0 255.255.224.0
                                    summary-address 10.8.128.0 255.255.128.0
                                    summary-address 10.4.0.0 255.252.0.0
                                    summary-address 10.8.0.0 255.248.0.0
                                    summary-address 10.16.0.0 255.240.0.0
                                    summary-address 10.28.0.0 255.255.0.0
                                    summary-address 10.118.0.0 255.255.0.0
                                    summary-address 10.233.0.0 255.255.224.0
                                    summary-address 10.120.0.0 255.254.0.0
                                    summary-address 10.142.0.0 255.254.0.0
                                    summary-address 10.144.0.0 255.254.0.0
                                    

                                     

                                    So if you have routes in the 10.x range they will be summarized while 192.168.x for example would not. If you check your external LSAs in OSPF, do you have for example 10.4.0.0/14 there?

                                    1 2 Previous Next