diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-21 04:12:46 +0000 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-04-21 14:37:47 +0900 |
commit | ae671a791a2e2628a757b8103e88b14081e78c3f (patch) | |
tree | 6f8f4b8d456bd269b2d1e315f9f02fd3b6d2e4d9 /docs/sources/policy.md | |
parent | 7d5a97862f927e8ba2fb82018e61fb17cd9ffcd2 (diff) |
policy: fix as-path match optimization
following as-path pattern will be optimized
- ^<asn>_ # left-most
- _<asn>$ # origin
- _<asn>_ # include
- ^<asn>$ # only
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'docs/sources/policy.md')
-rw-r--r-- | docs/sources/policy.md | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/docs/sources/policy.md b/docs/sources/policy.md index 5b99c52e..5d4a0c05 100644 --- a/docs/sources/policy.md +++ b/docs/sources/policy.md @@ -427,15 +427,17 @@ part. Like PrefixSets and NeighborSets, each can have multiple sets and each set |------------------|-------------------|------------|----------| | AsPathSet | as path value | "^65100" | | - The AS path regular expression is compatible with [Quagga](http://www.nongnu.org/quagga/docs/docs-multi/AS-Path-Regular-Expression.html) and Cisco. Some examples follow: - - - From: "^65100" means the route is passed from AS 65100 directly. - - Any: "65100" means the route comes through AS 65100. - - Origin: "65100$" means the route is originated by AS 65100. - - Only: "^65100$" means the route is originated by AS 65100 and comes from it directly. - - ^65100_65001 - - 65100_[0-9]+_.*$ - - ^6[0-9]_5.*_65.?00$ + The AS path regular expression is compatible with [Quagga](http://www.nongnu.org/quagga/docs/docs-multi/AS-Path-Regular-Expression.html) and Cisco. + Note Character `_` has special meaning. It is abbreviation for `(^|[,{}() ]|$)`. + + Some examples follow: + - From: `^65100_` means the route is passed from AS 65100 directly. + - Any: `_65100_` means the route comes through AS 65100. + - Origin: `_65100$` means the route is originated by AS 65100. + - Only: `^65100$` means the route is originated by AS 65100 and comes from it directly. + - `^65100_65001` + - `65100_[0-9]+_.*$` + - `^6[0-9]_5.*_65.?00$` ##### Examples - example 1 @@ -445,7 +447,7 @@ part. Like PrefixSets and NeighborSets, each can have multiple sets and each set # example 1 [[defined-sets.bgp-defined-sets.as-path-sets]] as-path-set-name = "aspath1" - as-path-list = ["^65100"] + as-path-list = ["^65100_"] ``` - example 2 |