BGP conditional advertisement

Discussion in 'Cisco' started by Ivan Ostres, Aug 2, 2004.

  1. Ivan Ostres

    Ivan Ostres Guest

    Hi all,

    in
    http://www.cisco.com/en/US/tech/tk365/tk80/technologies_configuration_ex
    ample09186a0080094309.shtml is described how to make BGP to advertise
    some prefix if some other route is NOT present in local routing table.

    I need to do a opposite thing: I need to be able to adverise prefix if,
    and only if specified route IS in local routing table.

    Is this possible, and if it is, how?


    --
    -Ivan.

    *** Use Rot13 to see my eMail address ***
     
    Ivan Ostres, Aug 2, 2004
    #1
    1. Advertising

  2. On Mon, 2 Aug 2004 12:02:24 +0200, Ivan Ostres
    <> wrote:
    >
    >in
    >http://www.cisco.com/en/US/tech/tk365/tk80/technologies_configuration_ex
    >ample09186a0080094309.shtml is described how to make BGP to advertise
    >some prefix if some other route is NOT present in local routing table.
    >
    >I need to do a opposite thing: I need to be able to adverise prefix if,
    >and only if specified route IS in local routing table.
    >
    >Is this possible, and if it is, how?


    I don't know of a clean way to do it offhand, but depending on your
    situation you may be able to accomplish this in an ugly fashion by
    getting clever with some bleeding-edge IOS features. I haven't
    thought about this in depth, so there may be a flaw or two in my
    reasoning, but bare with me here:

    Route tracking is possible as of 12.2(15)T:
    http://www.cisco.com/en/US/products..._feature_guide09186a00801541be.html#wp1045974

    Static routes can activate and deactivate themselves based on tracked
    objects as of 12.3(8)T:
    http://www.cisco.com/en/US/products..._feature_guide09186a00801d862d.html#wp1075804

    With these two features you may be able to do the following:

    1) Configure a tracking object to track the reachability of the route
    that you want to ensure is in the routing table (route A) prior to
    advertising "the other route" (route B).

    2) Configure a static route for route B. Have this static route track
    the tracking object from step 1 so that it is only active when route A
    is in the routing table.

    3) BGP only advertises prefixes that exist in the routing table. The
    removal of route A from the routing table will result in the removal
    of route B; hence, BGP will stop advertising route B. The net result
    is that route B is only advertised when route A is in the routing
    table.

    If this even works at all, it'll break down in some situations such as
    if route B is learned via a routing protocol. In this case, route B
    will likely continue to be learned dynamically regardless of route A's
    status, which will prevent the above from working.

    But it's food for thought, perhaps.

    -Terry
     
    Terry Baranski, Aug 4, 2004
    #2
    1. Advertising

  3. Ivan Ostres

    John Agosta Guest

    "Terry Baranski" <0VE.com> wrote in message
    news:...
    > On Mon, 2 Aug 2004 12:02:24 +0200, Ivan Ostres
    > <> wrote:
    > >
    > >in
    > >http://www.cisco.com/en/US/tech/tk365/tk80/technologies_configuration_ex
    > >ample09186a0080094309.shtml is described how to make BGP to advertise
    > >some prefix if some other route is NOT present in local routing table.
    > >
    > >I need to do a opposite thing: I need to be able to adverise prefix if,
    > >and only if specified route IS in local routing table.
    > >
    > >Is this possible, and if it is, how?

    >
    > I don't know of a clean way to do it offhand, but depending on your
    > situation you may be able to accomplish this in an ugly fashion by
    > getting clever with some bleeding-edge IOS features. I haven't
    > thought about this in depth, so there may be a flaw or two in my
    > reasoning, but bare with me here:
    >
    > Route tracking is possible as of 12.2(15)T:
    >

    http://www.cisco.com/en/US/products..._feature_guide09186a00801541be.html#wp1045974
    >
    > Static routes can activate and deactivate themselves based on tracked
    > objects as of 12.3(8)T:
    >

    http://www.cisco.com/en/US/products..._feature_guide09186a00801d862d.html#wp1075804
    >
    > With these two features you may be able to do the following:
    >
    > 1) Configure a tracking object to track the reachability of the route
    > that you want to ensure is in the routing table (route A) prior to
    > advertising "the other route" (route B).
    >
    > 2) Configure a static route for route B. Have this static route track
    > the tracking object from step 1 so that it is only active when route A
    > is in the routing table.
    >
    > 3) BGP only advertises prefixes that exist in the routing table. The
    > removal of route A from the routing table will result in the removal
    > of route B; hence, BGP will stop advertising route B. The net result
    > is that route B is only advertised when route A is in the routing
    > table.
    >
    > If this even works at all, it'll break down in some situations such as
    > if route B is learned via a routing protocol. In this case, route B
    > will likely continue to be learned dynamically regardless of route A's
    > status, which will prevent the above from working.
    >
    > But it's food for thought, perhaps.
    >
    > -Terry



    Wouldn't a simple "network x.x.x.x mask y.y.y.y" statement do the trick ?
     
    John Agosta, Aug 4, 2004
    #3
  4. On Tue, 3 Aug 2004 18:48:40 -0500, "John Agosta"
    <j_agosta@remove_wideopenwest.kom> wrote:
    >
    >Wouldn't a simple "network x.x.x.x mask y.y.y.y" statement do the trick ?


    I don't believe so, unless I'm misunderstanding something. The above
    command will announce route x.x.x.x if and only if route x.x.x.x
    exists in the routing table. Ivan's issue is how to announce route
    x.x.x.x if and only if route z.z.z.z exists in the routing table.

    -Terry
     
    Terry Baranski, Aug 4, 2004
    #4
  5. Ivan Ostres

    John Agosta Guest

    "Terry Baranski" <0VE.com> wrote in message
    news:...
    > On Tue, 3 Aug 2004 18:48:40 -0500, "John Agosta"
    > <j_agosta@remove_wideopenwest.kom> wrote:
    > >
    > >Wouldn't a simple "network x.x.x.x mask y.y.y.y" statement do the trick ?

    >
    > I don't believe so, unless I'm misunderstanding something. The above
    > command will announce route x.x.x.x if and only if route x.x.x.x
    > exists in the routing table.



    The link Ivan supplied doesn't work for me, so I can't put the question into
    context.
    However.......

    You interpret the above command the same as I do.
    This is how I read his question:

    >
    >"I need to do a opposite thing: I need to be able to adverise prefix if,
    >and only if specified route IS in local routing table."
    >



    >Ivan's issue is how to announce route
    > x.x.x.x if and only if route z.z.z.z exists in the routing table.
    >
    > -Terry




    But if your understanding (above) is indeed the problem, I wonder if:

    Look at the next hop address associate with z.z.z.z when it IS in the
    routing table.
    Then,
    ip route x.x.x.x {mask} [next_hop_for_z.z.z.z] null 0

    Thinking is, the static route for x.x.x.x will only be valid/appear in the
    IGP table if the z.z.z.z Next_hop is available.

    Then, use the "network" command and mask for x.x.x.x for BGP advertisement ?

    Is this whacky? I need to try it.....
    (so much fun....)


    Please post the URL for 'tracked objects' again.
    It sounds like a plan, but I can't seem to make them 'click,' either....
    :-(


    Ok - be well, fellas !


    -ja
     
    John Agosta, Aug 4, 2004
    #5
  6. Ivan Ostres

    Ivan Ostres Guest

    In article <>,
    0VE.com says...
    > On Tue, 3 Aug 2004 18:48:40 -0500, "John Agosta"
    > <j_agosta@remove_wideopenwest.kom> wrote:
    > >
    > >Wouldn't a simple "network x.x.x.x mask y.y.y.y" statement do the trick ?

    >
    > I don't believe so, unless I'm misunderstanding something. The above
    > command will announce route x.x.x.x if and only if route x.x.x.x
    > exists in the routing table. Ivan's issue is how to announce route
    > x.x.x.x if and only if route z.z.z.z exists in the routing table.
    >
    > -Terry
    >


    Thanx Terry and John,

    This is exactly what I was looking for (what Terry wrote). I've
    implemented in a lab using SAA, but I was looking if there was a cleaner
    way to solve the problem. Since nobody answered something different,
    seems that there's no such option.

    The reason why I was looking another way to do it because there's a
    older (12.1) IOS on routers and customer don't want to change that
    (flash, dram issue) unless it is absolute necessary.

    Thanx again T and J for confirming my solution as the only possible.

    --
    -Ivan.

    *** Use Rot13 to see my eMail address ***
     
    Ivan Ostres, Aug 4, 2004
    #6
  7. Here are some shorter links:

    http://tinyurl.com/5rw88
    http://tinyurl.com/6gsdh

    More below...

    On Tue, 3 Aug 2004 22:07:41 -0500, "John Agosta"
    <j_agosta@remove_wideopenwest.kom> wrote:
    >
    >But if your understanding (above) is indeed the problem, I wonder if:
    >
    >Look at the next hop address associate with z.z.z.z when it IS in the
    >routing table.
    >Then,
    >ip route x.x.x.x {mask} [next_hop_for_z.z.z.z] null 0
    >
    >Thinking is, the static route for x.x.x.x will only be valid/appear in the
    >IGP table if the z.z.z.z Next_hop is available.
    >
    >Then, use the "network" command and mask for x.x.x.x for BGP advertisement ?
    >
    >Is this whacky? I need to try it.....
    >(so much fun....)


    The problem with the above is that the next-hop for z.z.z.z may be
    reachable even when z.z.z.z isn't, particularly if z.z.z.z is a remote
    network.

    But I think you may have hit upon something here. There may be a
    recursive routing-based solution to this that's easier than this route
    tracking madness. If you define the static route for x.x.x.x as
    follows:

    ip route x.x.x.x {mask} z.z.z.z

    This should result in traffic destined to x.x.x.x being forwarded to
    z.z.z.z's next-hop when z.z.z.z is in the routing table. When z.z.z.z
    isn't in the routing table, the route to x.x.x.x should disappear.
    (This is true even if there's a default route in the routing table due
    to the way Cisco does recursive routing.)

    It's so simple that I can't help but wonder what I'm missing...

    -Terry
     
    Terry Baranski, Aug 4, 2004
    #7
  8. Ivan Ostres

    Hansang Bae Guest

    > 0VE.com says...
    > > I don't believe so, unless I'm misunderstanding something. The above
    > > command will announce route x.x.x.x if and only if route x.x.x.x
    > > exists in the routing table. Ivan's issue is how to announce route
    > > x.x.x.x if and only if route z.z.z.z exists in the routing table.



    In article <>,
    says...
    > This is exactly what I was looking for (what Terry wrote). I've
    > implemented in a lab using SAA, but I was looking if there was a cleaner
    > way to solve the problem. Since nobody answered something different,
    > seems that there's no such option.
    >
    > The reason why I was looking another way to do it because there's a
    > older (12.1) IOS on routers and customer don't want to change that
    > (flash, dram issue) unless it is absolute necessary.



    How about something like this:

    router bgp BLAH
    neighbor blah blah route-map SEND_ONLY_IF_NET-Z_EXISTS
    network blah mask blah
    !

    access-list 1 permit z.z.z.z
    access-list 2 permit the_correct_next_hop_IP_here

    route-map SEND_ONLY_IF_NET-Z_EXISTS permit 10
    match ip address 1
    match ip next-hop 2

    Off the top of my head, I think this will work.

    --

    hsb

    "Somehow I imagined this experience would be more rewarding" Calvin
    *************** USE ROT13 TO SEE MY EMAIL ADDRESS ****************
    ********************************************************************
    Due to the volume of email that I receive, I may not not be able to
    reply to emails sent to my account. Please post a followup instead.
    ********************************************************************
     
    Hansang Bae, Aug 5, 2004
    #8
  9. Ivan Ostres

    Ivan Ostres Guest

    In article <>,
    says...
    > > 0VE.com says...
    > > > I don't believe so, unless I'm misunderstanding something. The above
    > > > command will announce route x.x.x.x if and only if route x.x.x.x
    > > > exists in the routing table. Ivan's issue is how to announce route
    > > > x.x.x.x if and only if route z.z.z.z exists in the routing table.

    >
    >
    > In article <>,
    > says...
    > > This is exactly what I was looking for (what Terry wrote). I've
    > > implemented in a lab using SAA, but I was looking if there was a cleaner
    > > way to solve the problem. Since nobody answered something different,
    > > seems that there's no such option.
    > >
    > > The reason why I was looking another way to do it because there's a
    > > older (12.1) IOS on routers and customer don't want to change that
    > > (flash, dram issue) unless it is absolute necessary.

    >
    >
    > How about something like this:
    >
    > router bgp BLAH
    > neighbor blah blah route-map SEND_ONLY_IF_NET-Z_EXISTS
    > network blah mask blah
    > !
    >
    > access-list 1 permit z.z.z.z
    > access-list 2 permit the_correct_next_hop_IP_here
    >
    > route-map SEND_ONLY_IF_NET-Z_EXISTS permit 10
    > match ip address 1
    > match ip next-hop 2
    >
    > Off the top of my head, I think this will work.
    >
    >


    Thanks Hansang, I'll test it in a lab today and see if that is what I
    really want. (I've done the similar thing before, just without
    the_correct_next_hop_IP_here and it didn't worked as it should).

    And thanks to John and Terry for their ideas and solutions.


    --
    -Ivan.

    *** Use Rot13 to see my eMail address ***
     
    Ivan Ostres, Aug 9, 2004
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DigitalVinyl

    Conditional NAT

    DigitalVinyl, Mar 12, 2005, in forum: Cisco
    Replies:
    1
    Views:
    2,409
    Walter Roberson
    Mar 12, 2005
  2. Garry
    Replies:
    6
    Views:
    865
    Cisco Fan
    Mar 21, 2005
  3. Replies:
    0
    Views:
    549
  4. essenz

    Adding a BGP advertisement

    essenz, Jan 31, 2008, in forum: Cisco
    Replies:
    3
    Views:
    962
    Trendkill
    Jan 31, 2008
  5. qamar

    BGP Conditional advertisement with Community attributes

    qamar, Sep 15, 2009, in forum: General Computer Support
    Replies:
    0
    Views:
    1,559
    qamar
    Sep 15, 2009
Loading...

Share This Page