Mailing List Archive

An attribute with less priority than local preference for choosing a best path.
Hello,

We have a few edge routers with multiple connections to multiple geographically diverse locations from the same AS number (for example we have a router that connects to Lumen in both Cleveland and Cincinnati).

Since the routes from both peers have mostly the same AS PATHs all of the traffic was going through one of the connections.

In order to control that I was using:

if community matches-any LUMEN-CLEVE then
set local-preference 150
endif

Makes perfect sense that any route tagged with a community in the list LUMEN-CLEVE would be preferred regardless of the AS-PATH.

My question is what is considered the right attribute to modify that won't override the AS-PATH length?

Would it be better to adjust MED?










_______________________________________________
cisco-nsp mailing list cisco-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/
Re: An attribute with less priority than local preference for choosing a best path. [ In reply to ]
On Fri, 3 Jun 2022, Drew Weaver wrote:

> Hello,
>
> We have a few edge routers with multiple connections to multiple geographically diverse locations from the same AS number (for example we have a router that connects to Lumen in both Cleveland and Cincinnati).
>
> Since the routes from both peers have mostly the same AS PATHs all of the traffic was going through one of the connections.
>
> In order to control that I was using:
>
> if community matches-any LUMEN-CLEVE then
> set local-preference 150
> endif
>
> Makes perfect sense that any route tagged with a community in the list LUMEN-CLEVE would be preferred regardless of the AS-PATH.
>
> My question is what is considered the right attribute to modify that won't override the AS-PATH length?
>
> Would it be better to adjust MED?

Yep. That's what we use to nudge traffic when everything else ties. Make
sure you also have consistent origin though...you may need to look at
setting origin on all routes received from transits/peers to the same
value to keep individual drains from winning due to their setting origin
igp.

----------------------------------------------------------------------
Jon Lewis, MCP :) | I route
StackPath, Sr. Neteng | therefore you are
_________ http://www.lewis.org/~jlewis/pgp for PGP public key_________
_______________________________________________
cisco-nsp mailing list cisco-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/
Re: An attribute with less priority than local preference for choosing a best path. [ In reply to ]
As always thank you.

-Drew

-----Original Message-----
From: Jon Lewis <jlewis@lewis.org>
Sent: Friday, June 3, 2022 12:02 PM
To: Drew Weaver <drew.weaver@thenap.com>
Cc: 'cisco-nsp@puck.nether.net' <cisco-nsp@puck.nether.net>
Subject: Re: [c-nsp] An attribute with less priority than local preference for choosing a best path.

On Fri, 3 Jun 2022, Drew Weaver wrote:

> Hello,
>
> We have a few edge routers with multiple connections to multiple geographically diverse locations from the same AS number (for example we have a router that connects to Lumen in both Cleveland and Cincinnati).
>
> Since the routes from both peers have mostly the same AS PATHs all of the traffic was going through one of the connections.
>
> In order to control that I was using:
>
> if community matches-any LUMEN-CLEVE then
> set local-preference 150
> endif
>
> Makes perfect sense that any route tagged with a community in the list LUMEN-CLEVE would be preferred regardless of the AS-PATH.
>
> My question is what is considered the right attribute to modify that won't override the AS-PATH length?
>
> Would it be better to adjust MED?

Yep. That's what we use to nudge traffic when everything else ties. Make sure you also have consistent origin though...you may need to look at setting origin on all routes received from transits/peers to the same value to keep individual drains from winning due to their setting origin igp.

----------------------------------------------------------------------
Jon Lewis, MCP :) | I route
StackPath, Sr. Neteng | therefore you are
_________ https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lewis.org_-7Ejlewis_pgp&d=DwICAg&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=OPufM5oSy-PFpzfoijO_w76wskMALE1o4LtA3tMGmuw&m=tlXRBabtVZRedxV1i34qJGBeZYKDC3vZ2iLdTF8eTbA&s=r2_h8TxEdXZG5m1n_zZNS_OulX4-jVCc8cciOygYyos&e= for PGP public key_________
_______________________________________________
cisco-nsp mailing list cisco-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/
Re: An attribute with less priority than local preference for choosing a best path. [ In reply to ]
Drew Weaver wrote on 03/06/2022 16:48:
> Would it be better to adjust MED?

MED tends to be a better idea because it will accumulate the IGP metric
with the BGP metric, which means you can fine-tune your routing in a
dynamic basis in a way that you can't do with just localpref.

If you use MED, then you probably want:

router bgp xxxx
bgp bestpath med always

Otherwise the best path selection algorithm will select the oldest route
in favour of a MED.

The selection algorithm is documented here:

> https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

Worth reading. Localpref overrides as-path length. MEDs don't.

If you're a leaf network, you may also want to normalise the origin type
to either IGP or EGP. Some transit providers change theirs to IGP,
which will cause traffic to unnaturally swing over to them, so higher
sales for them.

Nick
_______________________________________________
cisco-nsp mailing list cisco-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/
Re: An attribute with less priority than local preference for choosing a best path. [ In reply to ]
Hi,

On Fri, Jun 03, 2022 at 03:48:37PM +0000, Drew Weaver wrote:
> In order to control that I was using:
>
> if community matches-any LUMEN-CLEVE then
> set local-preference 150
> endif

Don't.

MED is what we use, because local-pref basically just ensures job
security (because once you start, you'll be twiddling all day to
fix the unexpected consequences).

gert
--
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany gert@greenie.muc.de
Re: An attribute with less priority than local preference for choosing a best path. [ In reply to ]
Hi,

On Fri, Jun 03, 2022 at 06:26:37PM +0200, Gert Doering wrote:
> MED is what we use, because local-pref basically just ensures job
> security (because once you start, you'll be twiddling all day to
> fix the unexpected consequences).

Forgot to add the URL to The Talk :-)

https://www.youtube.com/watch?v=gn-cdzHxkpk
https://media.ccc.de/v/denog13-12617-local-pref-considered-evil

(same thing, video + slide show)

https://pretalx.com/denog13/talk/RVC77F/ (slides)

(I've let people talk me into making this a live show at DENOG 13
last fall...)

gert
--
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress

Gert Doering - Munich, Germany gert@greenie.muc.de
Re: An attribute with less priority than local preference for choosing a best path. [ In reply to ]
Consider the cost community.
IOS-XR implements the pre-bestpath and the after IGP-nexthop-cost point of insertion.
https://datatracker.ietf.org/doc/html/draft-ietf-idr-custom-decision
https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r7-6/routing/command/reference/b-routing-cr-asr9000-76x/routing-policy-language-commands.html#wp3193927332
https://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k-r7-6/routing/configuration/guide/b-routing-cg-asr9000-76x/implementing-bgp.html#con_1390979

Regards,
Jakob.

-----Original Message-----
From: Nick Hilliard <nick@foobar.org>
Drew Weaver wrote on 03/06/2022 16:48:
> Would it be better to adjust MED?

MED tends to be a better idea because it will accumulate the IGP metric
with the BGP metric, which means you can fine-tune your routing in a
dynamic basis in a way that you can't do with just localpref.

If you use MED, then you probably want:

router bgp xxxx
bgp bestpath med always

Otherwise the best path selection algorithm will select the oldest route
in favour of a MED.

The selection algorithm is documented here:

> https://www.cisco.com/c/en/us/support/docs/ip/border-gateway-protocol-bgp/13753-25.html

Worth reading. Localpref overrides as-path length. MEDs don't.

If you're a leaf network, you may also want to normalise the origin type
to either IGP or EGP. Some transit providers change theirs to IGP,
which will cause traffic to unnaturally swing over to them, so higher
sales for them.

Nick
_______________________________________________
cisco-nsp mailing list cisco-nsp@puck.nether.net
https://puck.nether.net/mailman/listinfo/cisco-nsp
archive at http://puck.nether.net/pipermail/cisco-nsp/