# Lab3 Backup Path

Load **lab3.init.cfg**

```
#R1, R6
configure replace unix:lab3.init.cfg

#R2-R5
configure
load bootflash:lab3.init.cfg
commit replace
y
```

<figure><img src="/files/Acfhu0ZEgSTdWqiYIuxT" alt=""><figcaption></figcaption></figure>

R5 is setting LP to 50 on routes received from R6. Configure the core so that R4 is always used as the primary path, but if that path is lost, the core will immediately re-route to using R5.

## Answer <a href="#d5f0e3dc-fb03-46bc-8f33-e90b4f2ebff0" id="d5f0e3dc-fb03-46bc-8f33-e90b4f2ebff0"></a>

<https://www.youtube.com/watch?v=WpG81qm2PHE&list=PL3Y9eZjZCcsejbVWD3wJIePqe3NiImqxB&index=4>

```
#R5
router bgp 65000
 add ipv4 unicast
  advertise best-external
 add ipv6 unicast
  advertise best-external

#R2, R3, R4
route-policy INSTALL_BACKUP
  set path-selection backup 1 install
end-policy
!
router bgp 65000
 address-family ipv4 unicast
  additional-paths selection route-policy INSTALL_BACKUP
 !
 address-family ipv6 unicast
  additional-paths selection route-policy INSTALL_BACKUP
```

## Explanation/Verification <a href="#f0cebd31-f6ae-4743-acaa-ed7e4e3fb1db" id="f0cebd31-f6ae-4743-acaa-ed7e4e3fb1db"></a>

Before making any changes, notice that R5 is hiding its external path. This is because its iBGP path via R4 is better than its eBGP path due to local preference. On R3, we only see R4’s path to R6’s prefixes.

<div align="left"><figure><img src="/files/lRAVsEMajVose41KZFZS" alt=""><figcaption></figcaption></figure></div>

First we must configure R5 to advertise its external path. We can either use PIC, or simply use the **advertise best-external** feature. This allows R5 to advertise its eBGP path even when the iBGP path is best, and does not require PIC.

```
#R5
router bgp 65000
 add ipv4 unicast
  advertise best-external
 add ipv6 unicast
  advertise best-external
```

We now see both paths on R3.

<div align="left"><figure><img src="/files/ykgGnKsMb64QJ8tsFIRC" alt=""><figcaption></figcaption></figure></div>

We need to tell R3 to install additional paths as repair paths in the FIB. On IOS-XR, when you use add-path you select and install the paths at the same time with an RPL. There is no separate “install” command as there is with IOS-XE.

```
RP/0/0/CPU0:R3(config-bgp-af)#additional-paths ?
  receive    Additional paths Receive capability
  selection  Additional paths selection
  send       Additional paths Send capability
```

We must create an RPL that matches which routes to select and the action to take (”install” or “advertise” or both “install advertise”).

```
RP/0/0/CPU0:R3(config-rpl)#set path-selection ?
  all         BGP all paths
  backup      BGP backup path
  best-path   BGP best path
  group-best  BGP group best path
  multipath   BGP multipath

RP/0/0/CPU0:R3(config-rpl)#set path-selection backup 1 ?
  advertise  Advertise the path
  install    Install the path
```

If desired we can both advertise *and* install in one command:

```
RP/0/0/CPU0:R3(config-rpl)#set path-selection backup 1 install ?
  advertise          Advertise the path
  multipath-protect  Mutlipath Protect
```

However, in this lab, we are not advertising additional paths. We are simply installing a backup route.

```
#R2, R3, R4
route-policy INSTALL_BACKUP
  set path-selection backup 1 install
end-policy
!
router bgp 65000
 address-family ipv4 unicast
  additional-paths selection route-policy INSTALL_BACKUP
 !
 address-family ipv6 unicast
  additional-paths selection route-policy INSTALL_BACKUP
```

We now see that the backup path is marked when showing information about each prefix.

<div align="left"><figure><img src="/files/9xkhsgl7TkbkDnf31pUB" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="/files/GPLio3okRU2tnV01A4Hq" alt=""><figcaption></figcaption></figure></div>

The backup path has been installed as a repair route in the FIB:

<div align="left"><figure><img src="/files/NS9HG2yBGMIapLoxhXwo" alt=""><figcaption></figcaption></figure></div>

<div align="left"><figure><img src="/files/ef5zj5hXnFvPZ10FxVka" alt=""><figcaption></figcaption></figure></div>

We must do this on all other iBGP routers (R2 and R4) to ensure that they all install R5’s path as a repair path. Remember that this is different from the previous labs in which we used ECMP or UCMP. In those cases, we were load sharing between R4 and R5. But now we only use R4 alone, and only failover to using R5’s path if the path through R4 is lost.

Note that R5 also automatically installs the repair routes due to the **advertise best-external** feature being enabled.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ccie-sp.gitbook.io/ccie-spv5.1-labs/labs/bgp-multi-homing-xr/lab3-backup-path.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
