2.9 alternative solution

Since R1 is originating the prefix and R1 is the only connection to other bgp as's. I blocked locally created a routemap on R1 facing R3 blocking locally created routes via an as-path acl.

ip as-path access-list 1 permit $^

 

route-map 
R3->OUT deny 10

 match as-path 1

route-map R3->OUT permit 20

router bgp 65145

 

neighbor 174.1.13.3 route-map 
R3->OUT out

 

Comments

  • ip as-path access-list 1 permit $^

     

    route-map R3->OUT permit 10

     match as-path 1

    route-map R3->OUT permit 20

    router bgp 65145

     

    neighbor 174.1.13.3 route-map BB3->OUT out

     

    Don't have the lab with me but I have some doubt about your config. You are permitting locally originated as well as others(see route-map 10 and 20 both are permitted) and you are calling wrong route-map name to BGP neighbor:)

    Good Luck

  • I fixed the commands above. I really need to start slowing down on the configs as most of my mistakes seem to be misreading the questions or typos.

    I only verified that R3 wasn't receiving the route which was sloppy. I should have checked which routes R1 were sending. Since the route map configured on 174.1.13.3 was non-existant, all routes were being blocked to R3.

     

    Now that i have fixed the route-map, i see that this is not a valid solution as it blocks all routes originating inside the as from going to R3.

  • Your regular expression looks wrong as well. Not sure if typo or not but it should read ^$ not the other way around.

  • Yeah it was a typo, weird thing is, it works either way? 


    Rack1R1#sh ip bgp regexp $^

    BGP table version is 36, local router ID is 150.1.1.1

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

                  r RIB-failure, S Stale

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

     

       Network          Next Hop            Metric LocPrf Weight Path

    *> 174.1.1.0/24     0.0.0.0                  0         32768 i

    *>i174.1.4.0/24     150.1.4.4                0    100      0 i

    Rack1R1#sh ip bgp regexp ^$

    BGP table version is 36, local router ID is 150.1.1.1

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

                  r RIB-failure, S Stale

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

     

       Network          Next Hop            Metric LocPrf Weight Path

    *> 174.1.1.0/24     0.0.0.0                  0         32768 i

    *>i174.1.4.0/24     150.1.4.4                0    100      0 i

  • Maybe it does not match anything after $ Try doing a regexp with $* or $100 and see if it produces same result. Interesting :)


  • Here are some variations. 

     

    Rack1R1#sh ip bgp regexp $100

     

    Rack1R1#sh ip bgp regexp $*  

    % *+ operand could be empty

    % Invalid regular expression

    Rack1R1#sh ip bgp regexp $.

     

    Rack1R1#sh ip bgp regexp $

    BGP table version is 36, local router ID is 150.1.1.1

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

                  r RIB-failure, S Stale

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

     

       Network          Next Hop            Metric LocPrf Weight Path

    *  28.119.16.0/24   174.1.26.6               0    100      0 (65038 65267) 54 i

    *>i                 150.1.5.5                0    100      0 54 i

    *  28.119.17.0/24   174.1.26.6               0    100      0 (65038 65267) 54 i

    *>i                 150.1.5.5                0    100      0 54 i

    *  112.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 50 60 i

    *>i                 150.1.5.5                0    100      0 54 50 60 i

    *  113.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 50 60 i

    *>i                 150.1.5.5                0    100      0 54 50 60 i

    *  114.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 i

    *>i                 150.1.5.5                0    100      0 54 i

    *  115.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 i

    *>i                 150.1.5.5                0    100      0 54 i

    *  116.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 i

    *>i                 150.1.5.5                0    100      0 54 i

    *  117.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 i

       Network          Next Hop            Metric LocPrf Weight Path

    *>i                 150.1.5.5                0    100      0 54 i

    *  118.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 i

    *>i                 150.1.5.5                0    100      0 54 i

    *  119.0.0.0        174.1.26.6               0    100      0 (65038 65267) 54 i

    *>i                 150.1.5.5                0    100      0 54 i

    *> 174.1.1.0/24     0.0.0.0                  0         32768 i

    *> 174.1.3.0/24     174.1.13.3               0    100      0 (65038) i

    *>i174.1.4.0/24     150.1.4.4                0    100      0 i

    *> 174.1.7.0/24     174.1.26.6               0    100      0 (65038 65267) i

Sign In or Register to comment.