Meaning of "as-path prepend" after "local-preference"?

Answered Question
May 25th, 2007
User Badges:

Hi, imagine I have a Cat 3750 switch which is connected to RouterB-Internet and RouterC-Internet. In case of failure of RouterB, I want switch to direct traffic (inbound/outbound) from RouterC instead.


Therefore I understand I can use local-preference attribute for this as presented by noble members of this forum.


My question is, I have seen some examples as shown below where "as-path prepend <AS#> is being used after the 'local-preference attribute'.


Can someone clarify what the Autonmous System(AS 100) below means? In which scenario I should use and how can I benefit of such 'as-prepend AS' information after doing my local-preference entry? I read the documentation on this but it is not very clear on how I can take advantage of this in my situation.


(...)

route-map FROM_MYWAN permit 20

match ip address prefix-list MYSITE

set local-preference 115

set as-path prepend 100

(...)


Correct Answer by bjornarsb about 10 years 4 days ago

Hi,


In Best Path Algorithm

local pref is number 2 and as-path is number 4.

See this link:

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml


As the name indicates local preference is an attribute that routers exchange in the same AS.

As-path on the other hand is "global" i.e kept on ebgp sessions.


So if you have a multimomed environment with 2 isp and your own IP scope (PI) as-prepend is more usefull to get redundans.


Local pref is used when you are multihomed but use the same ISP at both exit points.


Hope this was clarifying :)


Check the scroll-bar at the bottom right :)


BR,

Bjornarsb


Correct Answer by Richard Burts about 10 years 4 days ago

Marlon


I believe that the first thing to understand here is that local-preference and path prepend are achieving different functions. local-preference influences route we receive from our neighbor and therefore influences how we will send traffic out. path prepend influences what we advertise to our neighbors and therefore influences how the Internet sends to us. So local-preference controls how we send and path prepend controls how we receive.


The other part of your question was what does AS 100 mean. AS 100 would be your AS number. In normal operation you put your AS number into the outgoing advertisement once. With path prepend you put your AS number into the path more than once. The effect of path prepend is to make the AS path longer and therefore less desirable.


The use of path prepend does not have much to do with failover but has to do with having a preferred path and a backup path during normal operation. When there is a failure of one of the external BGP neighbors you should get failover and it does not matter whether you are doing path prepend or not.


HTH


Rick

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (3 ratings)
Loading.
Correct Answer
Richard Burts Fri, 05/25/2007 - 13:14
User Badges:
  • Super Silver, 17500 points or more
  • Hall of Fame,

    Founding Member

  • Cisco Designated VIP,

    2017 LAN, WAN

Marlon


I believe that the first thing to understand here is that local-preference and path prepend are achieving different functions. local-preference influences route we receive from our neighbor and therefore influences how we will send traffic out. path prepend influences what we advertise to our neighbors and therefore influences how the Internet sends to us. So local-preference controls how we send and path prepend controls how we receive.


The other part of your question was what does AS 100 mean. AS 100 would be your AS number. In normal operation you put your AS number into the outgoing advertisement once. With path prepend you put your AS number into the path more than once. The effect of path prepend is to make the AS path longer and therefore less desirable.


The use of path prepend does not have much to do with failover but has to do with having a preferred path and a backup path during normal operation. When there is a failure of one of the external BGP neighbors you should get failover and it does not matter whether you are doing path prepend or not.


HTH


Rick

jain.manish94 Fri, 01/20/2017 - 01:45
User Badges:

hello Richard Burts

Please can you give me example with small lab . i am getting more confuse between Local Preferene Vs As-Path Vs Med .

Please share

Correct Answer
bjornarsb Fri, 05/25/2007 - 13:20
User Badges:
  • Bronze, 100 points or more

Hi,


In Best Path Algorithm

local pref is number 2 and as-path is number 4.

See this link:

http://www.cisco.com/en/US/tech/tk365/technologies_tech_note09186a0080094431.shtml


As the name indicates local preference is an attribute that routers exchange in the same AS.

As-path on the other hand is "global" i.e kept on ebgp sessions.


So if you have a multimomed environment with 2 isp and your own IP scope (PI) as-prepend is more usefull to get redundans.


Local pref is used when you are multihomed but use the same ISP at both exit points.


Hope this was clarifying :)


Check the scroll-bar at the bottom right :)


BR,

Bjornarsb


Actions

This Discussion