github.com/osrg/gobgp/v3@v3.30.0/docs/sources/add-paths.md (about)

     1  # Additional Paths
     2  
     3  This page explains how to configure BGP Additional Paths features on GoBGP.
     4  GoBGP supports to advertise ADD-PATH capability according to
     5  [RFC7911](https://tools.ietf.org/html/rfc7911) and advertise paths with
     6  the "Advertise N Paths" mode described in
     7  [draft-ietf-idr-add-paths-guidelines](https://tools.ietf.org/html/draft-ietf-idr-add-paths-guidelines).
     8  
     9  ## Prerequisites
    10  
    11  Assumed that you finished [Getting Started](getting-started.md).
    12  
    13  ## Contents
    14  
    15  - [Configuration](#configuration)
    16  - [Verification](#verification)
    17    - [Example Topology and Configuration](#example-topology-and-configuration)
    18    - [Advertise Multiple Paths](#advertise-multiple-paths)
    19  
    20  ## Configuration
    21  
    22  In order to advertise multiple paths to the specific neighbors, you need to
    23  configure `[neighbors.add-paths.config]` section for each neighbor.
    24  In the following example, `send-max = 8` means GoBGP will advertise up to 8
    25  paths per prefix towards this neighbor and `receive = true` enables to
    26  receive multiple paths from this neighbor.
    27  
    28  ```toml
    29  [[neighbors]]
    30    [neighbors.config]
    31      neighbor-address = "10.0.0.2"
    32      [neighbors.add-paths.config]
    33        send-max = 8
    34        receive = true
    35  ```
    36  
    37  Also, BGP Additional Paths features are configurable per AFI-SAFI and the per
    38  AFI-SAFI configuration overrides the per neighbor configuration.
    39  The following example enables BGP Additional Paths features for only IPv4
    40  unicast family.
    41  
    42  ```toml
    43  [[neighbors]]
    44    [neighbors.config]
    45      neighbor-address = "10.0.0.2"
    46    [neighbors.add-paths.config]
    47      receive = false
    48      send-max = 0
    49    [[neighbors.afi-safis]]
    50      [neighbors.afi-safis.config]
    51        afi-safi-name = "ipv4-unicast"
    52      [neighbors.afi-safis.add-paths.config]
    53        receive = true
    54        send-max = 8
    55  ```
    56  
    57  ## Verification
    58  
    59  ### Example Topology and Configuration
    60  
    61  To test BGP Additional Paths features, this page supposes the following
    62  topology.
    63  
    64  ```text
    65  +----------+                    +----------+          +----------+
    66  | r1       |                    | r2       |          | r3       |
    67  | AS 65001 |  ADD-PATH enabled  | AS 65002 |          | AS 65003 |
    68  | 10.0.0.1 |--------------------| 10.0.0.2 |----------| 10.0.0.3 |
    69  +----------+                    +----------+          +----------+
    70                                       |
    71                                       |
    72                                       |
    73                                  +----------+
    74                                  | r4       |
    75                                  | AS 65004 |
    76                                  | 10.0.0.4 |
    77                                  +----------+
    78  ```
    79  
    80  Configuration on r1:
    81  
    82  ```toml
    83  [global.config]
    84    as = 65001
    85    router-id = "10.0.0.1"
    86  
    87  [[neighbors]]
    88    [neighbors.config]
    89      neighbor-address = "10.0.0.2"
    90      peer-as = 65002
    91    [neighbors.add-paths.config]
    92      receive = true
    93      send-max = 8
    94    [[neighbors.afi-safis]]
    95      [neighbors.afi-safis.config]
    96        afi-safi-name = "ipv4-unicast"
    97  ```
    98  
    99  Configuration on r2:
   100  
   101  ```toml
   102  [global.config]
   103    as = 65002
   104    router-id = "10.0.0.2"
   105  
   106  [[neighbors]]
   107    [neighbors.config]
   108      neighbor-address = "10.0.0.1"
   109      peer-as = 65001
   110    [neighbors.add-paths.config]
   111      receive = true
   112      send-max = 8
   113    [[neighbors.afi-safis]]
   114      [neighbors.afi-safis.config]
   115        afi-safi-name = "ipv4-unicast"
   116  
   117  [[neighbors]]
   118    [neighbors.config]
   119      neighbor-address = "10.0.0.3"
   120      peer-as = 65003
   121    [[neighbors.afi-safis]]
   122      [neighbors.afi-safis.config]
   123        afi-safi-name = "ipv4-unicast"
   124  
   125  [[neighbors]]
   126    [neighbors.config]
   127      neighbor-address = "10.0.0.4"
   128      peer-as = 65004
   129    [[neighbors.afi-safis]]
   130      [neighbors.afi-safis.config]
   131        afi-safi-name = "ipv4-unicast"
   132  ```
   133  
   134  ### Advertise Multiple Paths
   135  
   136  Start GoBGP on r1, r2, r3 and r4, and confirm the establishment of each BGP
   137  session.
   138  
   139  e.g.:
   140  
   141  ```bash
   142  r1> gobgpd -f gobgpd.toml
   143  {"level":"info","msg":"gobgpd started","time":"YYYY-MM-DDTHH:mm:ss+09:00"}
   144  {"Topic":"Config","level":"info","msg":"Finished reading the config file","time":""YYYY-MM-DDTHH:mm:ss+09:00"}
   145  {"level":"info","msg":"Peer 10.0.0.2 is added","time":"YYYY-MM-DDTHH:mm:ss+09:00"}
   146  {"Topic":"Peer","level":"info","msg":"Add a peer configuration for:10.0.0.2","time":"YYYY-MM-DDTHH:mm:ss+09:00"}
   147  {"Key":"10.0.0.2","State":"BGP_FSM_OPENCONFIRM","Topic":"Peer","level":"info","msg":"Peer Up","time":"YYYY-MM-DDTHH:mm:ss+09:00"}
   148  ```
   149  
   150  Advertise a prefix "192.168.1.0/24" on r3 and r4.
   151  
   152  ```bash
   153  r3> gobgp global rib -a ipv4 add 192.168.1.0/24
   154  ```
   155  
   156  ```bash
   157  r4> gobgp global rib -a ipv4 add 192.168.1.0/24
   158  ```
   159  
   160  Then confirm 2 paths (from r3 and r4) are advertised to r1 from r2.
   161  In the following output shows the path with AS_PATH 65002 65003 (r3->r2->r1)
   162  and the path with AS_PATH 65002 65004 (r4->r2->r1).
   163  
   164  ```bash
   165  r1> gobgp global rib -a ipv4
   166     Network              Next Hop             AS_PATH              Age        Attrs
   167  *> 192.168.1.0/24       10.0.0.2             65002 65003          HH:mm:ss   [{Origin: ?}]
   168  *  192.168.1.0/24       10.0.0.2             65002 65004          HH:mm:ss   [{Origin: ?}]
   169  ```