summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/sources/cli-command-syntax.md34
-rw-r--r--docs/sources/configuration.md34
-rw-r--r--docs/sources/policy.md7
3 files changed, 71 insertions, 4 deletions
diff --git a/docs/sources/cli-command-syntax.md b/docs/sources/cli-command-syntax.md
index c6e009fb..be30307b 100644
--- a/docs/sources/cli-command-syntax.md
+++ b/docs/sources/cli-command-syntax.md
@@ -337,22 +337,48 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
% gobgp policy prefix del ecs1 RT:65100:10
```
-### 3.6 Statement Operation - add/del/show -
+### 3.6. Operations for LargeCommunitySet - add/del/show -
+#### Syntax
+```shell
+# add LargeCommunitySet
+% gobgp policy large-community add <set name> <large community>...
+# delete a specific LargeCommunitySet
+% gobgp policy large-community del <set name>
+# delete a large-community from a LargeCommunitySet
+% gobgp policy large-community del <set name> <large community>
+# show all LargeCommunitySet information
+% gobgp policy large-community
+# show a specific LargeCommunitySet information
+% gobgp policy large-community <set name>
+```
+
+#### Example
+```shell
+% gobgp policy large-community add l0 100:100:100
+% gobgp policy large-community add l0 ^100:
+% gobgp policy large-community add l0 :100$
+% gobgp policy large-community del l0 100:100:100
+% gobgp policy large-community add l0 200:100:100
+% gobgp policy large-community
+% gobgp policy large-community set l0 100:100:100 200:200:200 300:300:300
+```
+
+### 3.7 Statement Operation - add/del/show -
#### Syntax
```shell
# mod statement
% gobgp policy statement { add | del } <statement name>
# mod a condition to a statement
-% gobgp policy statement <statement name> { add | del | set } condition { { prefix | neighbor | as-path | community | ext-community } <set name> [{ any | all | invert }] | as-path-length <len> { eq | ge | le } | rpki { valid | invalid | not-found } }
+% gobgp policy statement <statement name> { add | del | set } condition { { prefix | neighbor | as-path | community | ext-community | large-community } <set name> [{ any | all | invert }] | as-path-length <len> { eq | ge | le } | rpki { valid | invalid | not-found } }
# mod an action to a statement
-% gobgp policy statement <statement name> { add | del | set } action { reject | accept | { community | ext-community } { add | remove | replace } <value>... | med { add | sub | set } <value> | local-pref <value> | as-prepend { <asn> | last-as } <repeat-value> }
+% gobgp policy statement <statement name> { add | del | set } action { reject | accept | { community | ext-community | large-community } { add | remove | replace } <value>... | med { add | sub | set } <value> | local-pref <value> | as-prepend { <asn> | last-as } <repeat-value> }
# show all statements
% gobgp policy statement
# show a specific statement
% gobgp policy statement <statement name>
```
-### 3.7 Policy Operation - add/del/show -
+### 3.8 Policy Operation - add/del/show -
#### Syntax
```shell
# mod policy
diff --git a/docs/sources/configuration.md b/docs/sources/configuration.md
index 56c14a78..6c8b2f85 100644
--- a/docs/sources/configuration.md
+++ b/docs/sources/configuration.md
@@ -141,6 +141,9 @@
[[defined-sets.bgp-defined-sets.as-path-sets]]
as-path-set-name = "as0"
as-path-list = ["^100", "200$"]
+[[defined-sets.bgp-defined-sets.large-community-sets]]
+ large-community-set-name = "ls0"
+ large-community-list = ["100:100:100", "200:200:200"]
[[policy-definitions]]
name = "policy1"
@@ -154,6 +157,9 @@
[policy-definitions.statements.conditions.bgp-conditions.match-community-set]
community-set = "cs0"
match-set-options = "all"
+ [policy-definitions.statements.conditions.bgp-conditions.match-large-community-set]
+ community-set = "ls0"
+ match-set-options = "all"
[policy-definitions.statements.actions.bgp-actions.set-as-path-prepend]
as = "last-as"
repeat-n = 5
@@ -228,4 +234,32 @@
route-type = "external"
[policy-definitions.statements.actions.route-disposition]
accept-route = true
+
+[[policy-definitions]]
+ name = "large-communty-policy"
+ [[policy-definitions.statements]]
+ # this statement adds specified large communities
+ [policy-definitions.statements.actions.route-disposition]
+ accept-route = true
+ [policy-definitions.statements.actions.bgp-actions.set-large-community]
+ options = "add"
+ [policy-definitions.statements.actions.bgp-actions.set-large-community.set-large-community-method]
+ communities-list = ["100:200:300"]
+ [[policy-definitions.statements]]
+ # this statement adds specified large communities
+ [policy-definitions.statements.actions.route-disposition]
+ accept-route = true
+ [policy-definitions.statements.actions.bgp-actions.set-large-community]
+ options = "replace"
+ [policy-definitions.statements.actions.bgp-actions.set-large-community.set-large-community-method]
+ communities-list = ["100:200:300"]
+ [[policy-definitions.statements]]
+ # this statement removes specified large communities
+ # regular expression is also supported
+ [policy-definitions.statements.actions.route-disposition]
+ accept-route = true
+ [policy-definitions.statements.actions.bgp-actions.set-large-community]
+ options = "remove"
+ [policy-definitions.statements.actions.bgp-actions.set-large-community.set-large-community-method]
+ communities-list = ["100:200:300", "^200:"]
```
diff --git a/docs/sources/policy.md b/docs/sources/policy.md
index f746f6a7..e9d4b8be 100644
--- a/docs/sources/policy.md
+++ b/docs/sources/policy.md
@@ -99,6 +99,7 @@ Conditions are categorized into attributes below:
- extended community
- rpki validation result
- route type (internal/external/local)
+- large community
As showed in the figure above, some of the conditions point to defined sets,
which are a container for each condition item (e.g. prefixes).
@@ -124,6 +125,7 @@ $ gobgp policy neighbor
$ gobgp policy as-path
$ gobgp policy community
$ gobgp policy ext-community
+$ gobgp policy large-community
```
## <a name="configuration"> Policy Configuration
@@ -148,6 +150,7 @@ Below are the steps for policy configuration
1. define community-sets
1. define ext-community-sets
1. define as-path-setList
+ 1. define large-community-sets
1. define policy-definitions
1. attach policies to global rib (or neighbor local rib when neighbor is [route-server-client](https://github.com/osrg/gobgp/blob/master/docs/sources/route-server.md)).
@@ -320,6 +323,10 @@ part. Like prefix-sets and neighbor-sets, each can have multiple sets and each s
[[defined-sets.bgp-defined-sets.as-path-sets]]
as-path-set-name = "aspath1"
as-path-list = ["^65100"]
+# Large Community match part
+ [[defined-sets.bgp-defined-sets.large-community-sets]]
+ large-community-set-name = "lcommunity1"
+ large-community-list = ["65100:100:100"]
```
----