Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #142 from sbe-ctc/master_ctc_CP11-019-01
Browse files Browse the repository at this point in the history
Added the description of XR-6.6.2 (CLI) to route-policy.
  • Loading branch information
dkutenicsova authored Jun 14, 2019
2 parents 0a23e1d + 7dc8f05 commit d78eda6
Showing 1 changed file with 56 additions and 30 deletions.
86 changes: 56 additions & 30 deletions Configuration datasets/routing-policy/routing-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ frinx-openconfig-routing-policy:routing-policy/policy-definitions/policy-definit

```javascript
{
"policy-definition": [
"frinx-openconfig-routing-policy:policy-definition": [
{
"name": "{{rpol_name}}",
"config": {
Expand All @@ -31,11 +31,11 @@ frinx-openconfig-routing-policy:routing-policy/policy-definitions/policy-definit
},
"match-prefix-set": {
"config": {
"prefix-set": "{{pset}}",
"prefix-set": "{{pset_name}}",
"match-set-options": "{{rpol_s_c_prefixset_opts}}"
}
},
"bgp-conditions": {
"frinx-openconfig-bgp-policy:bgp-conditions": {
"as-path-length": {
"config": {
"operator": "{{rpol_s_c_bgp_aslen_oper}}",
Expand Down Expand Up @@ -66,21 +66,29 @@ frinx-openconfig-routing-policy:routing-policy/policy-definitions/policy-definit
"config": {
"policy-result": {{rpol_s_a_result}}
},
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-local-pref": {{rpol_s_a_bgp_set_localpref}},
"set-next-hop": {{rpol_s_a_bgp_set_nexthop}},
"set-med": {{rpol_s_a_bgp_set_med}}
},
"set-community": {
"config": {
"method": "REFERENCE",
"method": "REFERENCE|INLINE",
"options": "{{rpol_s_a_bgp_comset_opts}}"
},
"reference": {
"config": {
"community-set-ref": "{{cset_name}}"
}
},
"inline": {
"config": {
"communities": [
{{rpol_s_a_bgp_well_known_comm}},
{{rpol_s_a_bgp_comm}}
]
}
}
},
"set-as-path-prepend": {
Expand Down Expand Up @@ -122,7 +130,7 @@ frinx-openconfig-routing-policy:routing-policy/defined-sets/prefix-sets/prefix-s
"prefix": [
{
"ip-prefix": "{{prefix}}",
"masklength-range": "{{prefix_mask}}"
"masklength-range": "{{prefix_mask}}",
"config": {
"ip-prefix": "{{prefix}}",
"masklength-range": "{{prefix_masklength}}"
Expand Down Expand Up @@ -180,7 +188,7 @@ frinx-openconfig-routing-policy:routing-policy/defined-sets/bgp-defined-sets/as-
```
## OS Configuration Commands

### Cisco IOS XR 5.3.4
### Cisco IOS XR 5.3.4, IOS XR 6.6.2

#### CLI

Expand All @@ -205,10 +213,10 @@ as-path-set {{aset_name}}
end-set

route-policy {{rpol_name}}
if destination in {{pset_name}} /
and as-path length {{rpol_s_c_bgp_aslen_oper}} /
and community match-{{rpol_s_c_bgp_comset_opts}} {{cset_name}} /
and as-path in {{aset_name}} then
if [not] destination in {{pset_name}} /
and as-path length le|ge|eq {{rpol_s_c_bgp_aslen_val}}/
and community match-any|match-every {{cset_name}} /
and [not] as-path in {{aset_name}} then
drop
done
pass
Expand All @@ -217,16 +225,34 @@ route-policy {{rpol_name}}
set next-hop {{rpol_s_a_bgp_set_nexthop}}
set med {{rpol_s_a_bgp_set_med}}
set community {{cset_name}} {{rpol_s_a_bgp_comset_opts}}
set community (no-export, no-advertise, local-as, {{rpol_s_a_bgp_comm}})
prepend as-path {{rpol_s_a_bgp_aspathprep_asn}} {{rpol_s_a_bgp_aspathprep_repeatn}}
endif
end-policy

</pre>

*destination in {{pset_name}}* is a conversion of {{rpol_s_c_prefixset_opts}} set to *ANY*
*not destination in {{pset_name}}* is a conversion of {{rpol_s_c_prefixset_opts}} set to *INVERT*

*as-path length le* is a conversion of {{rpol_s_c_bgp_aslen_oper}} set to *frinx-openconfig-policy-types:ATTRIBUTE_LE*
*as-path length ge* is a conversion of {{rpol_s_c_bgp_aslen_oper}} set to *frinx-openconfig-policy-types:ATTRIBUTE_GE*
*as-path length eq* is a conversion of {{rpol_s_c_bgp_aslen_oper}} set to *frinx-openconfig-policy-types:ATTRIBUTE_EQ*

*community match-any* is a conversion of {{rpol_s_c_bgp_comset_opts}} set to *ANY*
*community match-every* is a conversion of {{rpol_s_c_bgp_comset_opts}} set to *ALL*

*drop* is a conversion of {{rpol_s_a_result}} set to *REJECT_ROUTE*
*done* is a conversion of {{rpol_s_a_result}} set to *ACCEPT_ROUTE*
*pass* is a conversion of {{rpol_s_a_result}} set to *PASS_ROUTE*

*set community (no-export)* is a conversion of {{rpol_s_a_bgp_well_known_comm}} set to *frinx-openconfig-bgp-types:NO_EXPORT*
*set community (no-advertise)* is a conversion of {{rpol_s_a_bgp_well_known_comm}} set to *frinx-openconfig-bgp-types:NO_ADVERTISE*
*set community (local-as)* is a conversion of {{rpol_s_a_bgp_well_known_comm}} set to *frinx-openconfig-bgp-types:NO_EXPORT_SUBCONFED*

*as-path in {{aset_name}}* is a conversion of {{rpol_s_c_bgp_aspathset_opts}} set to *ANY*
*not as-path in {{aset_name}}* is a conversion of {{rpol_s_c_bgp_aspathset_opts}} set to *INVERT*

##### Examples

<pre>
Expand Down Expand Up @@ -255,9 +281,9 @@ end-policy
"config": {
"call-policy": route_subpolicy_1
}
}
},
"actions": {
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-next-hop": {{rpol_s_a_bgp_set_nexthop}}
}
Expand Down Expand Up @@ -306,7 +332,7 @@ end-policy
"name": "statement_1"
},
"conditions": {
"bgp-conditions": {
"frinx-openconfig-bgp-policy:bgp-conditions": {
"as-path-length": {
"config": {
"operator": "ATTRIBUTE_GE",
Expand All @@ -320,7 +346,7 @@ end-policy
"policy-result": "REJECT_ROUTE"
}
}
}
},
{
"name": "statement_2",
"config": {
Expand All @@ -338,7 +364,7 @@ end-policy
"config": {
"policy-result": "ACCEPT_ROUTE"
},
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-local-pref": 15,
"set-med": 10
Expand All @@ -356,14 +382,14 @@ end-policy
}
}
}
}
},
{
"name": "statement_3",
"config": {
"name": "statement_3"
},
"conditions": {
"bgp-conditions": {
"frinx-openconfig-bgp-policy:bgp-conditions": {
"as-path-set": {
"config": {
"as-path-set": "aset_name",
Expand All @@ -376,13 +402,13 @@ end-policy
"config": {
"policy-result": "ACCEPT_ROUTE"
},
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-med": 20
}
}
}
}
},
{
"name": "statement_4",
"config": {
Expand All @@ -392,7 +418,7 @@ end-policy
"config": {
"policy-result": "ACCEPT_ROUTE"
},
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-local-pref": 15
}
Expand Down Expand Up @@ -453,14 +479,14 @@ end-policy
"policy-result": "REJECT_ROUTE"
}
}
}
},
{
"name": "statement_2",
"config": {
"name": "statement_2"
},
"conditions": {
"bgp-conditions": {
"frinx-openconfig-bgp-policy:bgp-conditions": {
"match-community-set": {
"config": {
"community-set": "cset_name",
Expand All @@ -473,7 +499,7 @@ end-policy
"config": {
"policy-result": "ACCEPT_ROUTE"
},
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-med": 1
},
Expand All @@ -485,7 +511,7 @@ end-policy
}
}
}
}
},
{
"name": "statement_3",
"config": {
Expand All @@ -497,8 +523,8 @@ end-policy
"prefix-set": "pset_name",
"match-set-options": "ANY"
}
}
"bgp-conditions": {
},
"frinx-openconfig-bgp-policy:bgp-conditions": {
"as-path-set": {
"config": {
"as-path-set": "aset_name",
Expand All @@ -511,13 +537,13 @@ end-policy
"config": {
"policy-result": "ACCEPT_ROUTE"
},
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-med": 2
}
}
}
}
},
{
"name": "statement_4",
"config": {
Expand All @@ -527,7 +553,7 @@ end-policy
"config": {
"policy-result": "ACCEPT_ROUTE"
},
"bgp-actions": {
"frinx-openconfig-bgp-policy:bgp-actions": {
"config": {
"set-med": 3
}
Expand Down

0 comments on commit d78eda6

Please sign in to comment.