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

     1  # CLI Operations
     2  
     3  This page explains comprehensive examples of operations via GoBGP CLI.
     4  
     5  ## Prerequisites
     6  
     7  Assumed that you finished [Getting Started](getting-started.md).
     8  
     9  ## Configuration
    10  
    11  This example starts with the same configuration with
    12  [Getting Started](getting-started.md)
    13  
    14  Make sure that all the peers are connected.
    15  
    16  ```bash
    17  $ gobgp neighbor
    18  Peer          AS  Up/Down State       |#Received Accepted
    19  10.0.255.1 65001 00:00:04 Establ      |        2        2
    20  10.0.255.2 65002 00:00:04 Establ      |        2        2
    21  ```
    22  
    23  ## Adding or deleting a peer dynamically
    24  
    25  You can add a new peer or delete the existing peer without stopping
    26  GoBGP daemon. You can do such by adding a new peer configuration or
    27  deleting the existing configuration of a peer in your configuration
    28  file and sending `HUP` signal to GoBGP daemon.
    29  
    30  In this example, 10.0.255.3 peer is added. The configuration file
    31  should be like the following.
    32  
    33  ```toml
    34  [global.config]
    35    as = 64512
    36    router-id = "192.168.255.1"
    37  
    38  [[neighbors]]
    39  [neighbors.config]
    40    neighbor-address = "10.0.255.1"
    41    peer-as = 65001
    42  [neighbors.route-server.config]
    43    route-server-client = true
    44  
    45  [[neighbors]]
    46  [neighbors.config]
    47    neighbor-address = "10.0.255.2"
    48    peer-as = 65002
    49  [neighbors.route-server.config]
    50    route-server-client = true
    51  
    52  [[neighbors]]
    53  [neighbors.config]
    54    neighbor-address = "10.0.255.3"
    55    peer-as = 65003
    56  [neighbors.route-server.config]
    57    route-server-client = true
    58  ```
    59  
    60  After you send `HUP` signal (`kill` command), you should see 10.0.255.3 peer.
    61  
    62  ```bash
    63  $ gobgp neighbor
    64  Peer          AS  Up/Down State       |#Received Accepted
    65  10.0.255.1 65001 00:03:42 Establ      |        2        2
    66  10.0.255.2 65002 00:03:42 Establ      |        2        2
    67  10.0.255.3 65003 00:01:39 Establ      |        1        1
    68  ```
    69  
    70  ## Temporarily disable a configured peer
    71  
    72  Sometime you might want to disable the configured peer without
    73  removing the configuration for the peer. Likely, again you enable the
    74  peer later.
    75  
    76  ```bash
    77  $ gobgp neighbor 10.0.255.1 disable
    78  $ gobgp neighbor
    79  Peer          AS  Up/Down State       |#Received Accepted
    80  10.0.255.1 65001    never Idle(Admin) |        0        0
    81  10.0.255.2 65002 00:12:32 Establ      |        2        2
    82  10.0.255.3 65003 00:10:29 Establ      |        1        1
    83  ```
    84  
    85  The state of 10.0.255.1 is `Idle(Admin)`. Let's enable the peer again.
    86  
    87  ```bash
    88  $ gobgp neighbor 10.0.255.1 enable
    89  $ gobgp neighbor
    90  Peer          AS  Up/Down State       |#Received Accepted
    91  10.0.255.1 65001    never Idle        |        0        0
    92  10.0.255.2 65002 00:13:33 Establ      |        2        2
    93  10.0.255.3 65003 00:11:30 Establ      |        1        1
    94  ```
    95  
    96  Eventually, the state should be `Established` again.
    97  
    98  ```bash
    99  $ gobgp neighbor
   100  Peer          AS  Up/Down State       |#Received Accepted
   101  10.0.255.1 65001 00:00:02 Establ      |        2        2
   102  10.0.255.2 65002 00:14:59 Establ      |        2        2
   103  10.0.255.3 65003 00:12:56 Establ      |        1        1
   104  ```
   105  
   106  ## Reset, Reset, and Reset
   107  
   108  Various reset operations are supported.
   109  
   110  ```bash
   111  $ gobgp neighbor 10.0.255.1 reset
   112  $ gobgp neighbor 10.0.255.1 softreset
   113  $ gobgp neighbor 10.0.255.1 softresetin
   114  $ gobgp neighbor 10.0.255.1 softresetout
   115  ```
   116  
   117  You can know more about [CLI command syntax](cli-command-syntax.md).