summaryrefslogtreecommitdiffhomepage
path: root/docs/sources/cli-command-syntax.md
blob: 9be898abef4722ea14419bcc267125d00c2b5bce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# CLI command syntax

This page explains gobgp client command syntax.



## basic command pattern
gobgp \<subcommand> \<object>  opts...

gobgp has three subcommands.
- global
- neighbor
- policy


## global subcommand

### Operations for Global-Rib - add/del/show -
```shell
# add Route
% gobgp global rib add <prefix> [-a <address family>]
# delete a specific Route
% gobgp global rib del <prefix> [-a <address family>]
# show all Route information
% gobgp global rib [-a <address family>]
# show a specific route information
% gobgp global rib [<prefix>|<host>] [-a <address family>]
```
 - **Option**
  - \-a , \-\-address-family: specify the ipv4, ipv6, evpn, encap, or rtc

<br>


## neighbor subcommand
### Show Neighbor Status
```shell
# show neighbor's status as list
% gobgp neighbor

# show status of a specific neighbor
% gobgp neighbor <neighbor address>
```

### Operations for neighbor - shutdown/reset/softreset/enable/disable -
```shell
% gobgp neighbor <neighbor address> shutdown
% gobgp neighbor <neighbor address> reset
% gobgp neighbor <neighbor address> softreset [-a <address family>]
% gobgp neighbor <neighbor address> softresetin [-a <address family>]
% gobgp neighbor <neighbor address> softresetout [-a <address family>]
% gobgp neighbor <neighbor address> enable
% gobgp neighbor <neighbor address> disable
```
 - **Option**
  - \-a , \-\-address-family: specify the ipv4 or ipv6

### Show Rib - local-rib/adj-rib-in/adj-rib-out -
```shell
# show all routes in [local|adj-in|adj-out] table
% gobgp neighbor <neighbor address> [local|adj-in|adj-out] [-a <address family>]
# show a specific route in [local|adj-in|adj-out] table
% gobgp neighbor <neighbor address> [local|adj-in|adj-out] [<prefix>|<host>] [-a <address family>]
```
 - **Option**
  - \-a , \-\-address-family: specify the ipv4 or ipv6

### Operations for Policy  - add/del/show -
```shell
# add policy to import-policy configuration
% gobgp neighbor <neighbor address> policy add import <import policy name> <default import policy>
# add policy to export-policy configuration
% gobgp neighbor <neighbor address> policy add export <export policy name> <default export policy>
# add policy to distribute-policy configuration
% gobgp neighbor <neighbor address> policy add distribute <distribute policy name> <default distribute policy>
# delete import-policy configuration from specific neighbor
% gobgp neighbor <neighbor address> policy del import
# delete export-policy configuration from specific neighbor
% gobgp neighbor <neighbor address> policy del export
# delete distribute-policy configuration from specific neighbor
% gobgp neighbor <neighbor address> policy del distribute
# show a specific policy information
% gobgp neighbor <neighbor address> policy
```

<br>

## policy subcommand
### Operations for PrefixSet - add/del/show -
```shell
# add PrefixSet
% gobgp policy prefix add <prefix set name> <prefix>
# delete all PrefixSet
% gobgp policy prefix del all
# delete a specific PrefixSet
% gobgp policy prefix del <prefix set name> [<prefix> <mask length range>]
# show all PrefixSet information
% gobgp policy prefix
# show a specific PrefixSet
% gobgp policy prefix <prefix set name>
```

### Operations for NeighborSet - add/del/show -
```shell
# add NeighborSet
% gobgp policy neighbor add <neighbor set name> <neighbor address>
# delete all NeighborSet
% gobgp policy neighbor del all
# delete a specific NeighborSet
% gobgp policy neighbor del <neighbor set name> [<address>]
# show all NeighborSet information
% gobgp policy neighbor
# show a specific NeighborSet information
% gobgp policy neighbor <neighbor set name>
```

### Operations for AsPathSet - add/del/show -
```shell
# add AsPathSet
% gobgp policy aspath add <aspath set name> <as path>
# delete all AsPathSet
% gobgp policy aspath del all
# delete a specific AsPathSet
% gobgp policy aspath del <aspath set name> [<as path>]
# show all AsPathSet information
% gobgp policy aspath
# show a specific AsPathSet information
% gobgp policy aspath <aspath set name>
```

### Operations for CommunitySet - add/del/show -
```shell
# add CommunitySet
% gobgp policy community add <community set name> <community>
# delete all CommunitySet
% gobgp policy community del all
# delete a specific CommunitySet
% gobgp policy community del <community set name> [<community>]
# show all CommunitySet information
% gobgp policy community
# show a specific CommunitySet information
% gobgp policy community <community set name>
```


### Operations for RoutePolicy - add/del/show -
```shell
# add RoutePolicy
% gobgp policy routepoilcy add <route policy name> <statement name> [<conditions and actions>]
# delete all RoutePolicy
% gobgp policy routepoilcy del all
# delete a specific RoutePolicy
% gobgp policy routepoilcy del <route policy name> [<statement name>]
# show all RoutePolicy information
% gobgp policy routepoilcy
# show a specific RoutePolicy information
% gobgp policy routepoilcy <route policy name>
```
 - **Option (Conditon)**

  Specify the options of condition when you use the routepolicy add subcommand.
  - \-\-c-prefix    : specify the name that added prefix set in PrefixSet subcommand
  - \-\-c-neighbor  : specify the name that added neighbor set in NeighborSet subcommand
  - \-\-c-aspath    : specify the name that added as path set in AsPathSet subcommand
  - \-\-c-community : specify the name that added community set in CommunitySet subcommand
  - \-\-c-aslen     : specify the operator(eq, ge, le) and value(numric)
  - \-\-c-option    : specify the match option(any, all, invert)

<br>
 - **Option (Action)**

  Specify the options of action when you use the routepolicy add subcommand.
  - \-\-a-route     : specify the action(accept, reject) of the route that match to the conditions
  - \-\-a-community : specify the community operation of the route that match to the conditions
  - \-\-a-med       : specify the med operation of the route that match to the conditions