summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-04-21 19:51:58 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-04-22 18:12:51 +0900
commitce20ba94e672d22621e0d5ed2e020f29dbf5f3e8 (patch)
tree56801ef1f0dae932eee47f713b15563f74608f08
parent72674df91700c660d30f75c36e52e428427b5b0a (diff)
docs: add cli command syntax document
-rw-r--r--docs/sources/cli-command-syntax.md129
1 files changed, 129 insertions, 0 deletions
diff --git a/docs/sources/cli-command-syntax.md b/docs/sources/cli-command-syntax.md
new file mode 100644
index 00000000..da2cf384
--- /dev/null
+++ b/docs/sources/cli-command-syntax.md
@@ -0,0 +1,129 @@
+# CLI command syntax
+
+This page explains gobgp client command syntax.
+
+
+
+## basic command pattern
+gobgp \<subcommand> \<object> opts...
+
+gobgp has three subcommands.
+- global
+- neighbor
+- policy
+
+Note: Currently gobgp supports only **global** and **neighbor** subcommand.
+
+
+
+## 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>
+```
+
+<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
+```
+
+### Show Rib - local-rib/adj-rib-in/adj-rib-out -
+```shell
+% gobgp neighbor <neighbor address> local -a <address family>
+% gobgp neighbor <neighbor address> adj-in -a <address family>
+% gobgp neighbor <neighbor address> adj-out -a <address family>
+```
+
+### 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> -a <address family>
+# add policy to export-policy configuration
+% gobgp neighbor <neighbor address> policy add export <export policy name> <default export policy> -a <address family>
+# delete import-policy configuration from specific neighbor
+% gobgp neighbor <neighbor address> policy del import -a <address family>
+# delete export-policy configuration from specific neighbor
+% gobgp neighbor <neighbor address> policy del export -a <address family>
+# show a specific policy information
+% gobgp neighbor <neighbor address> policy -a <address family>
+```
+
+### Operations for Static Route - add/del/show -
+```shell
+# add Route
+% gobgp neighbor <neighbor address> route add <prefix> -a <address family>
+# delete all Route
+% gobgp neighbor <neighbor address> route del -a <address family>
+# delete a specific Route
+% gobgp neighbor <neighbor address> route del <prefix> -a <address family>
+# show all Route information
+% gobgp neighbor <neighbor address> route -a <address family>
+```
+
+<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
+# delete a specific PrefixSet
+% gobgp policy prefix del <prefix set name>
+# 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
+# delete a specific NeighborSet
+% gobgp policy neighbor del <neighbor set name>
+# show all NeighborSet information
+% gobgp policy neighbor
+# show a specific NeighborSet information
+% gobgp policy neighbor <neighbor set name>
+```
+### Operations for RoutePolicy - add/del/show -
+```shell
+# add RoutePolicy
+% gobgp policy routepoilcy add <route policy name> condition <condtion> action <aciton>
+# delete all RoutePolicy
+% gobgp policy routepoilcy del
+# delete a specific RoutePolicy
+% gobgp policy routepoilcy del <route policy name>
+# show all RoutePolicy information
+% gobgp policy routepoilcy
+# show a specific RoutePolicy information
+% gobgp policy routepoilcy <route policy name>
+```