summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/sources/cli-command-syntax.md15
-rw-r--r--docs/sources/filter-detail.md16
2 files changed, 23 insertions, 8 deletions
diff --git a/docs/sources/cli-command-syntax.md b/docs/sources/cli-command-syntax.md
index 730d712e..6faac956 100644
--- a/docs/sources/cli-command-syntax.md
+++ b/docs/sources/cli-command-syntax.md
@@ -273,7 +273,7 @@ If you want to remove one element(community) of CommunitySet, to specify a addre
#### - example
If you want to add the RoutePolicy:
```shell
-% gobgp policy routepolicy add policy1 state1 --c-prefix=ps1 --c-neighbor=ns1 --c-aspath=ass1 --c-community=cs1 --c-aslen=eq,3 --c-option=all --a-route=reject --a-community=ADD[65100:20] --a-med=+100
+% gobgp policy routepolicy add policy1 state1 --c-prefix=ps1 --c-neighbor=ns1 --c-aspath=ass1 --c-community=cs1 --c-aslen=eq,3 --c-option=all --a-route=reject --a-community=ADD[65100:20] --a-med=+100 --a-asprepend=65100,10
```
However, it is not necessary to specify all of the options at once.
@@ -296,15 +296,16 @@ The following options can be specified in the policy 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 |pecify the name that added community set in CommunitySet 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) |
- options of action
-| short |long | description |
-|--------|------------|-----------------------------------------------------------------------------|
-|- |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 |
+| short |long | description |
+|--------|------------|---------------------------------------------------------------------------------------------------------------|
+|- |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 |
+|- |a-asprepend |specify a combination of an AS number and repeat count(e.g. 65100,10) to prepend if the path matches conditions|
diff --git a/docs/sources/filter-detail.md b/docs/sources/filter-detail.md
index d4251c1a..6ae42a0e 100644
--- a/docs/sources/filter-detail.md
+++ b/docs/sources/filter-detail.md
@@ -20,6 +20,7 @@ A action part is below:
- accept or reject
- add/replace/remove community or remove all communities
- add/subtract or replace MED value
+ - prepend AS number in the AS_PATH attribute
GoBGP's configuration file has two parts named DefinedSets and PolicyDefinitionList as its policy configuration.
@@ -365,6 +366,9 @@ You can write condition and action under StatementList.
[PolicyDefinitionList.StatementList.Actions.BgpActions.SetCommunity]
Communities = ["65100:20"]
Options = "ADD"
+ [PolicyDefinitionList.StatementList.Actions.BgpActions.SetAsPathPrepend]
+ As = "65005"
+ RepeatN = 5
```
The elements of PolicyDefinitionList are as follows:
@@ -425,6 +429,13 @@ You can write condition and action under StatementList.
| Communities | communities used to manipulate the route's community accodriong to Options below | "65100:20" |
| Options | operator to manipulate Community attribute in the route | "ADD" |
+ - PolicyDefinitionList.StatementList.Actions.BgpActions.SetAsPathPrepend
+
+ | Element | Description | Example |
+ |---------|-------------------------------------------------------------------------------------------------------|---------|
+ | As | AS number to prepend. You can use "last-as" to prepend the leftmost AS number in the aspath attribute.| "65100" |
+ | RepeatN | repeat count to prepend AS | 5 |
+
<br>
##### Examples
@@ -514,7 +525,7 @@ You can write condition and action under StatementList.
- AsPathSet: *aspath1*
- AsPath length: *equal 2*
- - If a route matches all these conditions, the route is accepted and added community "65100:20" and subtract 200 from med value.
+ - If a route matches all these conditions, the route is accepted and added community "65100:20" and subtracted 200 from med value and prepended 65005 five times in its AS_PATH attribute.
```
# example 4
@@ -539,6 +550,9 @@ You can write condition and action under StatementList.
[PolicyDefinitionList.StatementList.Actions.BgpActions.SetCommunity]
Communities = ["65100:20"]
Options = "ADD"
+ [PolicyDefinitionList.StatementList.Actions.BgpActions.SetAsPathPrepend]
+ As = "65005"
+ RepeatN = 5
```