summaryrefslogtreecommitdiffhomepage
path: root/docs/sources/cli-command-syntax.md
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2018-03-30 13:51:51 +0900
committerIWASE Yusuke <iwase.yusuke0@gmail.com>2018-04-02 16:16:01 +0900
commit008f34053c87650c83946874980fa97179267149 (patch)
tree436e7a1a0eb4208a845b9bc710253af16e344f15 /docs/sources/cli-command-syntax.md
parent79d264bfb008370a6af7ff42dc3962d0bf1ddf63 (diff)
*.md: Improvements for markdownlint
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'docs/sources/cli-command-syntax.md')
-rw-r--r--docs/sources/cli-command-syntax.md182
1 files changed, 137 insertions, 45 deletions
diff --git a/docs/sources/cli-command-syntax.md b/docs/sources/cli-command-syntax.md
index e63067a6..16a4f254 100644
--- a/docs/sources/cli-command-syntax.md
+++ b/docs/sources/cli-command-syntax.md
@@ -2,23 +2,27 @@
This page explains gobgp client command syntax.
+## basic command pattern
+```shell
+gobgp <subcommand> <object> opts...
+```
-## basic command pattern
-gobgp \<subcommand> \<object> opts...
+gobgp has the following subcommands.
-gobgp has six subcommands.
-- [global](#global)
-- [neighbor](#neighbor)
-- [policy](#policy)
-- [vrf](#vrf)
-- [monitor](#monitor)
-- [mrt](#mrt)
+- [global](#1-global-subcommand)
+- [neighbor](#2-neighbor-subcommand)
+- [policy](#3-policy-subcommand)
+- [vrf](#4-vrf-subcommand)
+- [monitor](#5-monitor-subcommand)
+- [mrt](#6-mrt-subcommand)
+## 1. global subcommand
-## 1. <a name="global"> global subcommand
### 1.1 Global Configuration
+
#### syntax
+
```shell
# configure global setting and start acting as bgp daemon
% gobgp global as <VALUE> router-id <VALUE> [listen-port <VALUE>] [listen-addresses <VALUE>...] [mpls-label-min <VALUE>] [mpls-label-max <VALUE>]
@@ -29,7 +33,9 @@ gobgp has six subcommands.
```
### 1.2. Operations for Global-Rib - add/del/show -
+
#### - syntax
+
```shell
# add Route
% gobgp global rib add <prefix> [-a <address family>]
@@ -46,16 +52,21 @@ gobgp has six subcommands.
```
#### - example
-If you want to add routes with the address of the ipv4 to global rib:
+
+If you want to add routes with the address of the ipv4 to global rib:
+
```shell
% gobgp global rib add 10.33.0.0/16 -a ipv4
```
-If you want to remove routes with the address of the ipv6 from global rib:
+
+If you want to remove routes with the address of the ipv6 from global rib:
+
```shell
% gobgp global rib del 2001:123:123:1::/64 -a ipv6
```
#### more examples
+
```shell
% gobgp global rib add -a ipv4 10.0.0.0/24 origin igp
% gobgp global rib add -a ipv4 10.0.0.0/24 origin egp
@@ -84,6 +95,7 @@ If you want to remove routes with the address of the ipv6 from global rib:
```
#### - option
+
The following options can be specified in the global subcommand:
| short |long | description | default |
@@ -95,9 +107,12 @@ Also, refer to the following for the detail syntax of each address family.
- `evpn` address family: [CLI Syntax for EVPN](evpn.md#cli-syntax)
- `*-flowspec` address family: [CLI Syntax for Flow Specification](flowspec.md#cli-syntax)
-## 2. <a name="neighbor"> neighbor subcommand
+## 2. neighbor subcommand
+
### 2.1. Show Neighbor Status
+
#### - syntax
+
```shell
# show neighbor's status as list
% gobgp neighbor
@@ -106,7 +121,9 @@ Also, refer to the following for the detail syntax of each address family.
```
### 2.2. Operations for neighbor - shutdown/reset/softreset/enable/disable -
+
#### - syntax
+
```shell
# add neighbor
% gobgp neighbor add { <neighbor address> | interface <ifname> } as <as number> [ vrf <vrf-name> | route-reflector-client [<cluster-id>] | route-server-client | allow-own-as <num> | remove-private-as (all|replace) | replace-peer-as ]
@@ -119,15 +136,19 @@ Also, refer to the following for the detail syntax of each address family.
% gobgp neighbor <neighbor address> disable
% gobgp neighbor <neighbor address> reset
```
+
#### - option
- The following options can be specified in the neighbor subcommand:
+
+The following options can be specified in the neighbor subcommand:
| short |long | description | default |
|--------|---------------|--------------------------------------------|---------|
|a |address-family |specify any one from among `ipv4`, `ipv6`, `vpnv4`, `vpnv6`, `ipv4-labeled`, `ipv6-labeld`, `evpn`, `encap`, `rtc`, `ipv4-flowspec`, `ipv6-flowspec`, `l2vpn-flowspec`, `opaque` | `ipv4` |
### 2.3. Show Rib - local-rib/adj-rib-in/adj-rib-out -
+
#### - syntax
+
```shell
# show all routes in [local|adj-in|adj-out] table
% gobgp neighbor <neighbor address> [local|adj-in|adj-out] [-a <address family>]
@@ -140,21 +161,25 @@ Also, refer to the following for the detail syntax of each address family.
```
#### - example
-If you want to show the local rib of ipv4 that neighbor(10.0.0.1) has:
+
+If you want to show the local rib of ipv4 that neighbor(10.0.0.1) has:
+
```shell
% gobgp neighbor 10.0.0.1 local -a ipv4
```
#### - option
+
The following options can be specified in the neighbor subcommand:
| short |long | description | default |
|--------|---------------|--------------------------------------------|---------|
|a |address-family |specify any one from among `ipv4`, `ipv6`, `vpnv4`, `vpnv6`, `ipv4-labeled`, `ipv6-labeld`, `evpn`, `encap`, `rtc`, `ipv4-flowspec`, `ipv6-flowspec`, `l2vpn-flowspec`, `opaque` | `ipv4` |
-
### 2.4. Operations for Policy - add/del/show -
+
#### Syntax
+
```shell
# show neighbor policy assignment
% gobgp neighbor <neighbor address> policy { in | import | export }
@@ -169,20 +194,23 @@ The following options can be specified in the neighbor subcommand:
```
#### Example
-If you want to add the import policy to neighbor(10.0.0.1):
+
+If you want to add the import policy to neighbor(10.0.0.1):
+
```shell
% gobgp neighbor 10.0.0.1 policy import add policy1 policy2 default accept
```
-You can specify multiple policy to neighbor separated by commas.
-\<default policy action> means the operation(accept | reject) in the case where the route does not match the conditions of the policy.
+You can specify multiple policy to neighbor separated by commas.
+`default <policy action>` means the operation `{accept | reject}` in the case where the route does not match the conditions of the policy.
-<br>
+## 3. policy subcommand
-## 3. <a name="policy"> policy subcommand
### 3.1. Operations for PrefixSet - add/del/show -
+
#### Syntax
+
```shell
# add PrefixSet
% gobgp policy prefix add <prefix set name> <prefix> [<mask length range>]
@@ -197,21 +225,29 @@ You can specify multiple policy to neighbor separated by commas.
```
#### Example
-If you want to add the PrefixSet:
+
+If you want to add the PrefixSet:
+
```shell
% gobgp policy prefix add ps1 10.33.0.0/16 16..24
```
+
A PrefixSet it is possible to have multiple prefix, if you want to remove the PrefixSet to specify only PrefixSet name.
+
```shell
% gobgp policy prefix del ps1
```
+
If you want to remove one element(prefix) of PrefixSet, to specify a prefix in addition to the PrefixSet name.
+
```shell
% gobgp policy prefix del ps1 10.33.0.0/16
```
### 3.2. Operations for NeighborSet - add/del/show -
+
#### Syntax
+
```shell
# add NeighborSet
% gobgp policy neighbor add <neighbor set name> <neighbor address/prefix>
@@ -226,25 +262,35 @@ If you want to remove one element(prefix) of PrefixSet, to specify a prefix in a
```
#### Example
-If you want to add the NeighborSet:
+
+If you want to add the NeighborSet:
+
```shell
% gobgp policy neighbor add ns1 10.0.0.1
```
+
You can also specify a neighbor address range with the prefix representation:
+
```shell
% gobgp policy neighbor add ns 10.0.0.0/24
-``````
+```
+
A NeighborSet is possible to have multiple address, if you want to remove the NeighborSet to specify only NeighborSet name.
+
```shell
% gobgp policy neighbor del ns1
```
+
If you want to remove one element(address) of NeighborSet, to specify a address in addition to the NeighborSet name.
+
```shell
% gobgp policy prefix del ns1 10.0.0.1
```
### 3.3. Operations for AsPathSet - add/del/show -
+
#### Syntax
+
```shell
# add AsPathSet
% gobgp policy as-path add <aspath set name> <as path>
@@ -259,33 +305,42 @@ If you want to remove one element(address) of NeighborSet, to specify a address
```
#### Example
-If you want to add the AsPathSet:
+
+If you want to add the AsPathSet:
+
```shell
% gobgp policy as-path add ass1 ^65100
```
You can specify the position using regexp-like expression as follows:
-- From: "^65100" means the route is passed from AS 65100 directly.
-- Any: "65100" means the route comes through AS 65100.
-- Origin: "65100$" means the route is originated by AS 65100.
-- Only: "^65100$" means the route is originated by AS 65100 and comes from it directly.
+
+- From: `^65100` means the route is passed from AS 65100 directly.
+- Any: `_65100_` means the route comes through AS 65100.
+- Origin: `_65100$` means the route is originated by AS 65100.
+- Only: `^65100$` means the route is originated by AS 65100 and comes from it directly.
Further you can specify the consecutive aspath and use regexp in each element as follows:
-- ^65100_65001
-- 65100_[0-9]+_.*$
-- ^6[0-9]_5.*_65.?00$
+
+- `^65100_65001`
+- `65100_[0-9]+_.*$`
+- `^6[0-9]_5.*_65.?00$`
An AsPathSet it is possible to have multiple as path, if you want to remove the AsPathSet to specify only AsPathSet name.
+
```shell
% gobgp policy as-path del ass1
```
+
If you want to remove one element(as path) of AsPathSet, to specify an as path in addition to the AsPathSet name.
+
```shell
% gobgp policy as-path del ass1 ^65100
```
### 3.4. Operations for CommunitySet - add/del/show -
+
#### Syntax
+
```shell
# add CommunitySet
% gobgp policy community add <community set name> <community>
@@ -300,25 +355,34 @@ If you want to remove one element(as path) of AsPathSet, to specify an as path i
```
#### Example
-If you want to add the CommunitySet:
+
+If you want to add the CommunitySet:
+
```shell
% gobgp policy community add cs1 65100:10
```
- You can specify the position using regexp-like expression as follows:
- - 6[0-9]+:[0-9]+
- - ^[0-9]*:300$
+
+You can specify the position using regexp-like expression as follows:
+
+- `6[0-9]+:[0-9]+`
+- `^[0-9]*:300$`
A CommunitySet it is possible to have multiple community, if you want to remove the CommunitySet to specify only CommunitySet name.
+
```shell
% gobgp policy neighbor del cs1
```
+
If you want to remove one element(community) of CommunitySet, to specify a address in addition to the CommunitySet name.
+
```shell
% gobgp policy prefix del cs1 65100:10
```
### 3.5. Operations for ExtCommunitySet - add/del/show -
+
#### Syntax
+
```shell
# add ExtCommunitySet
% gobgp policy ext-community add <extended community set name> <extended community>
@@ -333,31 +397,40 @@ If you want to remove one element(community) of CommunitySet, to specify a addre
```
#### Example
-If you want to add the ExtCommunitySet:
+
+If you want to add the ExtCommunitySet:
+
```shell
% gobgp policy ext-community add ecs1 RT:65100:10
```
-Extended community set as \<SubType>:\<Global Admin>:\<LocalAdmin>.
+
+Extended community set as `<SubType>:<Global Admin>:<LocalAdmin>`.
If you read the [RFC4360](https://tools.ietf.org/html/rfc4360) and [RFC7153](https://tools.ietf.org/html/rfc7153), you can know more about Extended community.
You can specify the position using regexp-like expression as follows:
- - RT:[0-9]+:[0-9]+
- - SoO:10.0.10.10:[0-9]+
+
+- `RT:[0-9]+:[0-9]+`
+- `SoO:10.0.10.10:[0-9]+`
However, regular expressions for subtype can not be used, to use for the global admin and local admin.
A ExtCommunitySet it is possible to have multiple extended community, if you want to remove the ExtCommunitySet to specify only ExtCommunitySet name.
+
```shell
% gobgp policy neighbor del ecs1
```
+
If you want to remove one element(extended community) of ExtCommunitySet, to specify a address in addition to the ExtCommunitySet name.
+
```shell
% gobgp policy prefix del ecs1 RT:65100:10
```
### 3.6. Operations for LargeCommunitySet - add/del/show -
+
#### Syntax
+
```shell
# add LargeCommunitySet
% gobgp policy large-community add <set name> <large community>...
@@ -372,6 +445,7 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
```
#### Example
+
```shell
% gobgp policy large-community add l0 100:100:100
% gobgp policy large-community add l0 ^100:
@@ -383,7 +457,9 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
```
### 3.7 Statement Operation - add/del/show -
+
#### Syntax
+
```shell
# mod statement
% gobgp policy statement { add | del } <statement name>
@@ -398,7 +474,9 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
```
### 3.8 Policy Operation - add/del/show -
+
#### Syntax
+
```shell
# mod policy
% gobgp policy { add | del | set } <policy name> [<statement name>...]
@@ -408,9 +486,12 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
% gobgp policy <policy name>
```
-## 4. <a name="vrf"> vrf subcommand
+## 4. vrf subcommand
+
### 4.1 Add/Delete/Show VRF
+
#### Syntax
+
```shell
# add vrf
% gobgp vrf add <vrf name> rd <rd> rt {import|export|both} <rt>...
@@ -421,6 +502,7 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
```
#### Example
+
```shell
% gobgp vrf add vrf1 rd 10.100:100 rt both 10.100:100 import 10.100:101 export 10.100:102
% gobgp vrf
@@ -432,7 +514,9 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
```
### 4.2 Add/Delete/Show VRF routes
+
#### Syntax
+
```shell
# add routes to vrf
% gobgp vrf <vrf name> rib add <prefix> [-a <address family>]
@@ -443,6 +527,7 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
```
#### Example
+
```shell
% gobgp vrf vrf1 rib add 10.0.0.0/24
% gobgp vrf vrf1 rib add 2001::/64 -a ipv6
@@ -456,7 +541,7 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
% gobgp vrf vrf1 rib del 2001::/64
```
-## 5. <a name="monitor"> monitor subcommand
+## 5. monitor subcommand
### 5.1 monitor global rib
@@ -530,9 +615,12 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
% gobgp global rib -a ipv4 del 10.2.1.0/24
```
-## 6. <a name="mrt"> mrt subcommand
+## 6. mrt subcommand
+
### 6.1 dump mrt records
+
#### Syntax
+
```shell
% gobgp mrt dump rib global [<interval>]
% gobgp mrt dump rib neighbor <neighbor address> [<interval>]
@@ -546,13 +634,17 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
| o | outdir | output directory of dump files |
#### Example
-see [MRT](https://github.com/osrg/gobgp/blob/master/docs/sources/mrt.md).
+
+see [MRT](mrt.md).
### 6.2 inject mrt records
+
#### Syntax
+
```shell
% gobgp mrt inject global <filename> [<count>]
```
#### Example
-see [MRT](https://github.com/osrg/gobgp/blob/master/docs/sources/mrt.md).
+
+see [MRT](mrt.md).