bgp-path-pref

Hi,

I am stuck with bgp path preferance..There are 6 routers:--(R1,R2,R3,R4,R5,R6)

 

      R1 connected to R2,R3             R2 connected to R1,R4               R3 connected to R1,R4,R5         R4 connected to R2,R3,R6

R3 to R5 is EBGP, R4 to R6 is EBGP and R1,R2,R3,R4 are all IBGP with IGP-OSPF running. R1 is the route-refelector and others are clients.the ospf routes are redistributed into BGP only in R3 and R4 and in other routers there are no redistribution.

the scenario i am trying is R1 should use the path R1-R2-R4-R6.

i have configured weight in R4 for the external routes and i have configured higher cost vlaue (ip ospf cost)  in R1(interface pointing to R3) so that the routes with less metric can take over the desired path. but still the path i am getting is R1-R3-R5 which should not be the case.

R1---R3---R5

|       |

|       |

R2---R4---R6

can anyone help me on this issue..

thanks in advance..

Comments

  • What is the destination route? 

    Post show ip bgp output for that route on R1 and also show ip route <R3's neighbourship ip>

  • 150.1.19.x is the network between R4 and R6

    150.2.19.x is the subnet between R3 and R5

    197.68.x.x are the backbone routes..

     

     

    show ip bgp for all 4 routers...

    ==R1==

    *>i197.68.1.0       150.2.19.254             0    100      0 254 i
    * i                 150.1.19.254             0    100      0 254 253 i
    *>i197.68.4.0       150.2.19.254             0    100      0 254 i
    * i                 150.1.19.254             0    100      0 254 253 i
    *>i197.68.5.0       150.2.19.254             0    100      0 254 i
    * i                 150.1.19.254             0    100      0 254 253 i
    *>i197.68.21.0      150.2.19.254             0    100      0 254 i
    * i                 150.1.19.254             0    100      0 254 253 i
    *>i197.68.22.0      150.2.19.254             0    100      0 254 i
    * i                 150.1.19.254             0    100      0 254 253 i



    ==R3==

    *>i197.68.1.0       150.2.19.254             0    100      0 254 i
    *>i197.68.4.0       150.2.19.254             0    100      0 254 i
    *>i197.68.5.0       150.2.19.254             0    100      0 254 i
    *>i197.68.21.0      150.2.19.254             0    100      0 254 i
    *>i197.68.22.0      150.2.19.254             0    100      0 254 i


    ==R4==

    * i197.68.1.0       150.2.19.254             0    100      0 254 i
    *>                  150.1.19.254             0           400 254 253 i
    * i197.68.4.0       150.2.19.254             0    100      0 254 i
    *>                  150.1.19.254             0           400 254 253 i
    * i197.68.5.0       150.2.19.254             0    100      0 254 i
    *>                  150.1.19.254             0           400 254 253 i
    * i197.68.21.0      150.2.19.254             0    100      0 254 i
    *>                  150.1.19.254             0           400 254 253 i
    * i197.68.22.0      150.2.19.254             0    100      0 254 i
    *>                  150.1.19.254             0           400 254 253 i


    ==R2==

    *> 197.68.1.0       150.2.19.254             0             0 254 i
    *> 197.68.4.0       150.2.19.254             0             0 254 i
    *> 197.68.5.0       150.2.19.254             0             0 254 i
    *> 197.68.21.0      150.2.19.254             0             0 254 i
    *> 197.68.22.0      150.2.19.254             0             0 254 i



    show ip route for all 4 routers..


    ==R1==

         19.0.0.0/8 is variably subnetted, 25 subnets, 2 masks
    O       19.19.7.7/32 [110/67] via 19.19.35.5, 03:07:24, Serial0/2/0
    O       19.19.6.6/32 [110/66] via 19.19.35.5, 03:07:24, Serial0/2/0
    O       19.19.5.5/32 [110/65] via 19.19.35.5, 03:07:39, Serial0/2/0
    O       19.19.4.4/32 [110/2] via 19.19.34.4, 03:07:39, Virtual-Access1.1
    O       19.19.2.2/32 [110/2001] via 19.19.23.2, 03:05:27, Serial0/3/0
    O       19.19.1.1/32 [110/2065] via 19.19.23.2, 03:05:27, Serial0/3/0
    O       19.19.12.0/24 [110/2064] via 19.19.23.2, 03:05:27, Serial0/3/0
    O       19.19.15.0/24 [110/128] via 19.19.35.5, 03:07:24, Serial0/2/0
    O       19.19.17.0/24 [110/67] via 19.19.35.5, 03:07:24, Serial0/2/0
    O E2    19.19.45.0/24 [110/20] via 19.19.35.5, 03:07:39, Serial0/2/0
    O       19.19.56.0/24 [110/65] via 19.19.35.5, 03:07:24, Serial0/2/0
    O       19.19.67.0/24 [110/66] via 19.19.35.5, 03:07:24, Serial0/2/0
         150.1.0.0/24 is subnetted, 1 subnets
    O       150.1.19.0 [110/68] via 19.19.35.5, 03:07:24, Serial0/2/0
         150.2.0.0/24 is subnetted, 1 subnets
    O       150.2.19.0 [110/2001] via 19.19.23.2, 03:05:28, Serial0/3/0
    CCR3#


    ==R2==


    sh ip rou os
         19.0.0.0/8 is variably subnetted, 20 subnets, 2 masks
    O       19.19.7.7/32 [110/3] via 19.19.56.6, 03:08:45, FastEthernet0/0
    O       19.19.6.6/32 [110/2] via 19.19.56.6, 03:08:45, FastEthernet0/0
    O IA    19.19.4.4/32 [110/52] via 19.19.35.3, 03:08:25, Serial0/3/0
    O       19.19.3.3/32 [110/51] via 19.19.35.3, 03:08:35, Serial0/3/0
    O       19.19.2.2/32 [110/2051] via 19.19.35.3, 03:06:33, Serial0/3/0
    O       19.19.1.1/32 [110/2115] via 19.19.35.3, 03:06:33, Serial0/3/0
    O       19.19.12.0/24 [110/2114] via 19.19.35.3, 03:06:33, Serial0/3/0
    O       19.19.17.0/24 [110/3] via 19.19.56.6, 03:08:45, FastEthernet0/0
    O       19.19.23.0/24 [110/2050] via 19.19.35.3, 03:06:33, Serial0/3/0
    O IA    19.19.34.0/24 [110/51] via 19.19.35.3, 03:08:25, Serial0/3/0
    O IA    19.19.34.4/32 [110/1836] via 19.19.35.3, 03:08:25, Serial0/3/0
    O       19.19.67.0/24 [110/2] via 19.19.56.6, 03:08:45, FastEthernet0/0
         150.1.0.0/24 is subnetted, 1 subnets
    O       150.1.19.0 [110/4] via 19.19.56.6, 03:08:50, FastEthernet0/0
         150.2.0.0/24 is subnetted, 1 subnets
    O       150.2.19.0 [110/2051] via 19.19.35.3, 03:06:37, Serial0/3/0







    ==R3==


    sh ip rou os
         19.0.0.0/8 is variably subnetted, 24 subnets, 2 masks
    O IA    19.19.7.7/32 [110/66] via 19.19.12.1, 1d05h, Serial0/0/0
    O IA    19.19.6.6/32 [110/67] via 19.19.12.1, 1d05h, Serial0/0/0
    O       19.19.5.5/32 [110/129] via 19.19.23.3, 03:09:22, Serial0/2/0
    O IA    19.19.4.4/32 [110/66] via 19.19.23.3, 03:09:22, Serial0/2/0
    O       19.19.3.3/32 [110/65] via 19.19.23.3, 03:09:22, Serial0/2/0
    O       19.19.1.1/32 [110/65] via 19.19.12.1, 1d05h, Serial0/0/0
    O IA    19.19.15.0/24 [110/128] via 19.19.12.1, 1d05h, Serial0/0/0
    O IA    19.19.17.0/24 [110/65] via 19.19.12.1, 1d05h, Serial0/0/0
    O IA    19.19.34.0/24 [110/65] via 19.19.23.3, 03:09:22, Serial0/2/0
    O       19.19.35.0/24 [110/128] via 19.19.23.3, 03:09:22, Serial0/2/0
    O IA    19.19.34.4/32 [110/1850] via 19.19.23.3, 03:09:22, Serial0/2/0
    O E2    19.19.45.0/24 [110/20] via 19.19.23.3, 03:09:22, Serial0/2/0
    O IA    19.19.56.0/24 [110/67] via 19.19.12.1, 1d05h, Serial0/0/0
    O IA    19.19.67.0/24 [110/66] via 19.19.12.1, 1d05h, Serial0/0/0
         150.1.0.0/24 is subnetted, 1 subnets
    O IA    150.1.19.0 [110/65] via 19.19.12.1, 1d05h, Serial0/0/0



    ==R4==

         19.0.0.0/8 is variably subnetted, 18 subnets, 2 masks
    O       19.19.7.7/32 [110/2] via 19.19.17.7, 03:10:08, FastEthernet0/0
    O       19.19.6.6/32 [110/3] via 19.19.17.7, 03:10:08, FastEthernet0/0
    O       19.19.5.5/32 [110/193] via 19.19.12.2, 03:09:58, Serial0/2/0
    O IA    19.19.4.4/32 [110/55] via 19.19.17.7, 03:09:48, FastEthernet0/0
    O       19.19.3.3/32 [110/129] via 19.19.12.2, 03:09:58, Serial0/2/0
    O       19.19.2.2/32 [110/65] via 19.19.12.2, 1d05h, Serial0/2/0
    O       19.19.23.0/24 [110/128] via 19.19.12.2, 1d05h, Serial0/2/0
    O IA    19.19.34.0/24 [110/54] via 19.19.17.7, 03:09:48, FastEthernet0/0
    O       19.19.35.0/24 [110/192] via 19.19.12.2, 03:09:58, Serial0/2/0
    O IA    19.19.34.4/32 [110/1839] via 19.19.17.7, 03:09:48, FastEthernet0/0
    O E2    19.19.45.0/24 [110/20] via 19.19.17.7, 03:10:08, FastEthernet0/0
    O       19.19.56.0/24 [110/3] via 19.19.17.7, 03:10:08, FastEthernet0/0
    O       19.19.67.0/24 [110/2] via 19.19.17.7, 03:10:08, FastEthernet0/0
         150.2.0.0/24 is subnetted, 1 subnets
    O       150.2.19.0 [110/65] via 19.19.12.2, 1d05h, Serial0/2/0

     

  • Dear gpraveen,

    I think this is easy enough for you to figure it out.

    R1 is RR and it will always reflect a single best route. To determine the best route, it will use the BGP decision tie-breaking steps like a normal BGP process.

    ==R1==

    *>i197.68.1.0       150.2.19.254             0    100      0 254 i
    * i                 150.1.19.254             0    100      0 254 253 i    // longer AS_SEQ length is less prefered

     

    ==R4==

    * i197.68.1.0       150.2.19.254             0    100      0 254 i
    *>                  150.1.19.254             0           400 254 253 i   // Higher weight is more prefered.

     

    R2 will use what is "reflected" from R1.

  • the scenario i am trying is R1 should use the path R1-R2-R4-R6.

    OK - I need a little bit more information to full understand - and I agree with the previous poster on his comments.

    Here are my observations from the info you have provided -

    • To have a fuller picture - I need to see the full routing table - the BGP table is used to decide which is the bestpath - and that is installed in the routing table with the given nexthop.
    •  The nexthop is recursively looked up in the routing table until a routing pointing out of a interface is found.
    • Traffic will then be encapsulated and then sent in this direction.

    You cannot easily complete these task without the a routing table containing connected, OPSF and BGP routes, although for BGP, the BGP table would suffice.

    Without this information this is what I think is happening - R1 chooses the bestpath based on AS-PATH length - the path to R5 wins every time as 1<2!  The AS-PATH length decision is about number 4 in the list of attributes checked when bestpath analysis is performed so you need to use attributes before this to make a difference to the route selection e.g. change the local preference or weight on R1.  An alternative would be to used bgp bestpath as-path ignore (note this is a hidden command) but is documented.  This would allow attributes below 4 to be checked - e.g. MED.

    Now the given next hop 150.2.19.254 is recursed to interface serial0/3/0 with a hop of 19.19.23.2 - which router does this point to?

Sign In or Register to comment.