summaryrefslogtreecommitdiffhomepage
path: root/docs/sources
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-25 02:43:31 +0000
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2016-05-25 02:53:42 +0000
commit0dbf1d87cb6f42498e6607d616572fb80d36fd83 (patch)
treea942f671dd44ee75480ad6d3f162d9d29f1be42d /docs/sources
parent7c42e295e28c233fdb7a130681cd490308f116ca (diff)
policy: add local-pref action
$ gobgp policy statement st01 add action local-pref 110 Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'docs/sources')
-rw-r--r--docs/sources/cli-command-syntax.md2
-rw-r--r--docs/sources/policy.md18
2 files changed, 11 insertions, 9 deletions
diff --git a/docs/sources/cli-command-syntax.md b/docs/sources/cli-command-syntax.md
index fec354d5..01df2762 100644
--- a/docs/sources/cli-command-syntax.md
+++ b/docs/sources/cli-command-syntax.md
@@ -342,7 +342,7 @@ If you want to remove one element(extended community) of ExtCommunitySet, to spe
# 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 } }
# 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> | as-prepend { <asn> | last-as } <repeat-value> }
+% 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> }
# show all statements
% gobgp policy statement
# show a specific statement
diff --git a/docs/sources/policy.md b/docs/sources/policy.md
index 088efcb7..e6dedf78 100644
--- a/docs/sources/policy.md
+++ b/docs/sources/policy.md
@@ -108,6 +108,7 @@ Actions are categorized into attributes below:
- add/replace/remove community or remove all communities
- add/subtract or replace MED value
- set next-hop
+- set local-pref
- prepend AS number in the AS_PATH attribute
When **ALL** conditions in the statement are `true`, the action(s) in the statement are executed.
@@ -680,7 +681,7 @@ policy-definitions consists of condition and action. Condition part is used to e
- as-path-set: *aspath1*
- as-path length: *equal 2*
- - 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, and also next-hop 10.0.0.1 is set.
+ - If a route matches all these conditions, it will be accepted with community "65100:20", next-hop 10.0.0.1, local-pref 110, med subtracted 200, as-path prepended 65005 five times.
```toml
# example 4
@@ -706,13 +707,14 @@ policy-definitions consists of condition and action. Condition part is used to e
[policy-definitions.statements.actions.bgp-actions]
set-med = "-200"
set-next-hop = "10.0.0.1"
- [policy-definitions.statements.actions.bgp-actions.set-as-path-prepend]
- as = "65005"
- repeat-n = 5
- [policy-definitions.statements.actions.bgp-actions.set-community]
- options = "ADD"
- [policy-definitions.statements.actions.bgp-actions.set-community.set-community-method]
- communities-list = ["65100:20"]
+ set-local-pref = 110
+ [policy-definitions.statements.actions.bgp-actions.set-as-path-prepend]
+ as = "65005"
+ repeat-n = 5
+ [policy-definitions.statements.actions.bgp-actions.set-community]
+ options = "ADD"
+ [policy-definitions.statements.actions.bgp-actions.set-community.set-community-method]
+ communities-list = ["65100:20"]
```