- Table of Contents
-
- H3C S9500 Command Manual-Release2132[V2.03]-03 IP Routing Volume
- 00-1Cover
- 01-IP Routing Table Display Commands
- 02-BGP Commands
- 03-IS-IS Commands
- 04-OSPF Commands
- 05-RIP Commands
- 06-Routing Policy Commands
- 07-Static Routing Commands
- 08-IPv6 BGP Commands
- 09-IPv6 IS-IS Commands
- 10-IPv6 OSPFv3 commands
- 11-IPv6 RIPng Commands
- 12-IPv6 Static Routing Commands
- Related Documents
-
Title | Size | Download |
---|---|---|
06-Routing Policy Commands | 155.52 KB |
Chapter 1 Routing Policy Configuration Commands
1.1 Routing Policy Common Configuration Commands
1.1.15 display ip community-list
1.1.16 display ip extcommunity-list
1.2 IPv4 Routing Policy Configuration Commands
1.2.1 apply ip-address next-hop
1.3 IPv6 Routing Policy Configuration Commands
Chapter 1 Routing Policy Configuration Commands
1.1 Routing Policy Common Configuration Commands
1.1.1 apply as-path
Syntax
apply as-path as-number&<1-10> [ replace ]
undo apply as-path
View
Routing policy view
Default Level
2: System level
Parameters
as-number: Autonomous system number.
&<1-10>: Indicates you can enter as-number up to 10 times.
replace: Replaces the original AS number.
Description
Use the apply as-path command to apply the specified AS numbers to BGP routes.
Use the undo apply as-path command to remove the clause configuration.
No AS_PATH attribute is set by default.
With the replace keyword, using the apply as-path command replaces the original AS_PATH attribute with specified AS numbers. Without the replace keyword, using this command adds the specified AS numbers before the original AS_PATH attribute.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If BGP routing information matches AS-path-ACL 1, add AS number 200 before the original AS_PATH attribute.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply as-path 200
1.1.2 apply comm-list delete
Syntax
apply comm-list comm-list-number delete
undo apply comm-list
View
Routing policy view
Default Level
2: System level
Parameters
comm-list-number: Community list number. The basic community list number ranges from 1 to 99. The advanced community list number ranges from 100 to 199.
Description
Use the apply comm-list delete command to remove community attributes in BGP routing information specified by the community list.
Use the undo apply comm-list command to remove the clause configuration.
No community attributes are removed by default.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If BGP routing information matches AS-path-ACL 1, remove community attributes specified in community list 1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply comm-list 1 delete
1.1.3 apply community
Syntax
apply community { none | additive | { community-number&<1-16> | aa:nn&<1-16> | internet | no-export-subconfed | no-export | no-advertise } * [ additive ] }
undo apply community
View
Routing policy view
Default Level
2: System level
Parameters
none: Removes community attributes of BGP routes.
community-number: Community sequence number.
aa:nn: Community number.
&<1-16>: Indicates the argument before it can be entered up to 16 times.
internet: Sets the internet community attribute for matched BGP routes. Routes with this attribute are advertised to all BGP peers.
no-export-subconfed: Sets the no-export-subconfed community attribute for matched BGP routes. Routes with this attribute are not advertised out the sub autonomous system.
no-advertise: Sets the no-advertise community attribute for matched BGP routes. Routes with this attribute are not advertised to any peers.
no-export: Sets the no-export community attribute for matched BGP routes. Routes with this attribute are not advertised out the autonomous system or confederation, but can be advertised to other sub ASs in the confederation.
additive: Adds the specified community attribute to the original community attribute of a matched BGP route.
Description
Use the apply community command to set the specified community attribute for BGP routes.
Use the undo apply community command to remove the apply clause.
No community attribute is set by default.
Related commands: ip community-list, if-match community, route-policy.
Examples
# Create routing policy setcommunity with node 16 with matching mode as permit. Set the no-export community attribute for BGP routes passing AS-path-ACL 8.
<Sysname> system-view
[Sysname] route-policy setcommunity permit node 16
[Sysname-route-policy] if-match as-path 8
[Sysname-route-policy] apply community no-export
1.1.4 apply cost
Syntax
apply cost [ + | - ] value
undo apply cost
View
Routing policy view
Default Level
2: System level
Parameters
+: Increases cost value.
+: Decreases cost value.
cost: Cost for routing information.
Description
Use the apply cost command to set a cost for routing information.
Use the undo apply cost command to remove the clause configuration.
No cost is set for routing information by default.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply local-preference, apply origin, apply tag.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches the outbound VLAN-interface 100, set the cost for the route to 120.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match interface vlan-interface 100
[Sysname-route-policy] apply cost 120
1.1.5 apply cost-type
Syntax
apply cost-type { external | internal | type-1 | type-2 }
undo apply cost-type
View
Routing policy view
Default Level
2: System level
Parameters
external: IS-IS external route.
internal: IS-IS internal route.
type-1: Type-1 external route of OSPF.
type-2: Type-2 external route of OSPF.
Description
Use the apply cost-type command to set a cost type for routing information.
Use the undo apply cost-type command to remove the clause configuration.
No cost type is set for routing information by default.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches tag 8, set the cost type for the route to IS-IS internal route.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match tag 8
[Sysname-route-policy] apply cost-type internal
1.1.6 apply extcommunity
Syntax
apply extcommunity { rt route-target }&<1-16> [ additive ]
undo apply extcommunity
View
Routing policy view
Default Level
2: System level
Parameters
rt route-target: Sets the route target extended community attribute. route-target has two forms:
16-bit AS number: 32-bit self-defined number, for example, 101:3;
32-bit IP address: 16-bit self-defined number, for example, 192.168.122.15:1.
&<1-16>: Indicates the argument before it can be entered up to 16 times.
additive: Adds to the original community attribute of a route..
Description
Use the apply extcommunity command to apply the specified extended community attribute to BGP routes.
Use the undo apply extcommunity command to remove the clause configuration.
No extended community attribute is set for routing information by default.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a BGP route matches AS-path-ACL 1, add the RT extended community attribute 100:2 to the route.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply extcommunity rt 100:2 additive
1.1.7 apply isis
apply isis { level-1 | level-1-2 | level-2 }
undo apply isis
View
Routing policy view
Default Level
2: System level
Parameters
level-1: Redistributes routes into IS-IS level-1 area.
level-2: Redistributes routes into IS-IS level-2 area.
level-1-2: Redistributes routes into both IS-IS level-1 and level-2 areas.
Description
Use the apply isis command to redistribute routes into a specified ISIS level.
Use the undo apply isis command to remove the clause configuration.
No level is set by default.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply cost, apply origin, apply tag.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches tag 8, redistribute the route to IS-IS level-2 area.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match tag 8
[Sysname-route-policy] apply isis level-2
1.1.8 apply local-preference
Syntax
apply local-preference preference
undo apply local-preference
View
Routing policy view
Default Level
2: System level
Parameters
preference: BGP local preference.
Description
Use the apply local-preference command to apply the specified local preference to BGP routes.
Use the undo apply local-preference command to remove the clause configuration.
No local preference is set for BGP routing information by default.
Related commands: route-policy.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches AS-path-ACL 1, set the local preference for the route to 130.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply local-preference 130
1.1.9 apply mpls-label
Syntax
apply mpls-label
undo apply mpls-label
View
Routing policy view
Default Level
2: System level
Parameters
None
Description
Use the apply mpls-label command to set MPLS label for routing information.
Use the undo apply mpls-label command to remove the clause configuration.
No MPLS label is set by default.
If MPLS label failed to apply, the routing information can not be advertised.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches AS-path-ACL 1, set MPLS label for the route.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply mpls-label
1.1.10 apply origin
Syntax
apply origin { igp | egp as-number | incomplete }
undo apply origin
View
Routing policy view
Default Level
2: System level
Parameters
igp: Sets the origin of BGP routing information to IGP.
egp: Sets the origin of BGP routing information to EGP.
as-number: Autonomous system number for EGP routes.
incomplete: Sets the origin of BGP routing information to unknown.
Description
Use the apply origin command to apply the specified origin attribute to BGP routes.
Use the undo apply origin command to remove the clause configuration.
No origin attribute is set for routing information by default.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply local-preference, apply cost, apply tag.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches AS-path-ACL 1, set the origin for the route to IGP.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply origin igp
1.1.11 apply preference
Syntax
apply preference preference
undo apply preference
View
Routing policy view
Default Level
2: System level
Parameters
preference: Routing preference.
Description
Use the apply preference command to set a preference for a routing protocol.
Use the undo apply preference command to remove the clause configuration.
No preference is set for a routing protocol by default.
& Note:
If you set a preference for a routing protocol with the preference command, using the apply preference command will set a new preference for the matched routing protocol. Other routing protocols not satisfying the criteria still use the preferences set by the preference command.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches OSPF external route type, set the preference for the routing protocol to 90.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match route-type external-type1or2
[Sysname-route-policy] apply preference 90
1.1.12 apply preferred-value
Syntax
apply preferred-value preferred-value
undo apply preferred-value
View
Routing policy view
Default Level
2: System level
Parameters
preferred-value: Preferred value.
Description
Use the apply preferred-value command to apply a preferred value to BGP routes.
Use the undo apply preferred-value command to remove the clause configuration.
No preferred value is set for BGP routes by default.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a BGP route matches AS-path-ACL 1, set the preferred value 66 for the BGP route.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply preferred-value 66
1.1.13 apply tag
Syntax
apply tag value
undo apply tag
View
Routing policy view
Default Level
2: System level
Parameters
value: Tag value.
Description
Use the apply tag command to set a specified tag value for RIP, OSPF or IS-IS routing information.
Use the undo apply tag command to remove the clause configuration.
No routing tag is set for RIP, OSPF or IS-IS routing information by default.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply local-preference, apply cost, apply origin.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. If a route matches OSPF external route type 1, set the tag of the route to 100.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match route-type external-type1
[Sysname-route-policy] apply tag 100
1.1.14 display ip as-path
Syntax
display ip as-path [ as-path-number ]
View
Any view
Default Level
1: Monitor level
Parameters
as-path-number: AS path list number.
Description
Use the display ip as-path-acl command to display BGP AS path list information.
Information about all BGP AS path lists will be displayed if no as-path-acl-number is specified.
Related commands: ip as-path-acl, if-match as-path, apply as-path.
Examples
# Display the information of BGP AS path list 1.
<Sysname> display ip as-path 1
ListID Mode Expression
1 permit 2
Table 1-1 Description on the fields of the display ip as-path command
Field |
Description |
ListID |
AS path list ID |
Mode |
Matching mode: permit, deny |
Expression |
Regular expression for matching |
1.1.15 display ip community-list
Syntax
display ip community-list [ basic-community-list-number | adv-community-list-number ]
View
Any view
Default Level
1: Monitor level
Parameters
basic-community-list-number: Basic community list number.
adv-community-list-number: Advanced community list number.
Description
Use the display ip community-list command to display BGP community list information.
All BGP community list information will be displayed if no basic-community-list-number or adv-community-list-number is specified.
Related commands: ip community-list, if-match community, apply community.
Examples
# Display the information of the BGP community list 1.
<Sysname> display ip community-list 1
Community List Number 1
permit 1:1 1:2 2:2
1.1.16 display ip extcommunity-list
Syntax
display ip extcommunity-list [ ext-comm-list-number ]
View
Any view
Default Level
1: Monitor level
Parameters
ext-comm-list-number: Extended community list number.
Description
Use the display ip extcommunity-list command to display BGP extended community list information.
All BGP extended community list information will be displayed if no ext-comm-list-number is specified.
Related commands: ip extcommunity-list, if-match extcommunity, apply extcommunity.
Examples
# Display the information of BGP extended community list 1.
<Sysname> display ip extcommunity-list 1
Extended Community List Number 1
permit rt : 9:6
1.1.17 display route-policy
Syntax
display route-policy [ route-policy-name ]
View
Default Level
1: Monitor level
Parameters
route-policy-name: Routing policy name.
Description
Use the display route-policy command to display routing policy information.
All routing policy information will be displayed if no route-policy-name is specified.
Related commands: route-policy.
Examples
# Display the information of routing policy 1.
<Sysname> display route-policy policy1
Route-policy : policy1
permit : 10
if-match ip-prefix abc
apply cost 120
Table 1-2 Description on the fields of the display route-policy command.
Field |
Description |
Route-policy |
Routing policy name |
Permit |
permit mode: permit, deny |
if-match ip-prefix abc |
Match criterion |
apply cost 120 |
If the match criterion is satisfied, set the route cost to 120. |
1.1.18 if-match as-path
Syntax
if-match as-path as-path-number&<1-16>
undo if-match as-path [ as-path-number&<1-16> ]
View
Routing policy view
Default Level
2: System level
Parameters
as-path-number: AS path list number.
&<1-16>: Indicates the argument before it can be entered up to 16 times.
Description
Use the if-match as-path command to use AS path list(s) for matching against the AS path attribute of BGP routing information.
Use the undo if-match as-path command to remove the match criterion.
The match criterion is not configured by default.
This command is one of the if-match clauses of a route policy, used for filtering BGP routing information and specifying match criteria according to the AS path attribute of routing information.
Related commands: route-policy, ip as-path-acl.
Examples
# Define as-path list 2, allowing routing information containing AS 200 or 300 to pass. Define routing policy test with node 10, and set an if-match clause using the as-path list for matching.
<Sysname> system-view
[Sysname] ip as-path-acl 2 permit _*200.*300
[Sysname] route-policy test permit node 10
[Sysname-route-policy] if-match as-path 2
1.1.19 if-match community
Syntax
if-match community { basic-community-list-number [ whole-match ] | adv-community-list-number }&<1-16>
undo if-match community [ basic-community-list-number | adv-community-list-number ]&<1-16>
View
Routing policy view
Default Level
2: System level
Parameters
basic-community-list-number: Basic community list number.
adv-community-list-number: Advanced community list number.
whole-match: Specifies the exact match. All and only the specified communities must be present.
&<1-16>: Indicates the argument before it can be entered up to 16 times.
Description
Use the if-match community command to specify community list(s) for matching against the community attribute of BGP routing information.
Use the undo if-match community command to remove the match criterion.
The match criterion is not configured by default.
This command is one of the if-match clauses of route policy, used for filtering BGP routing information and specifying match criterion according to the community attribute of BGP routing information.
Related commands: route-policy, ip community-list.
Examples
# Define community-list 1, allowing routing information with community number 100 or 200 to pass. Then define a routing policy named test, whose node 10 is defined with an if-match clause to reference the community-list 1 for matching.
[Sysname] ip community-list 1 permit 100 200
[Sysname] route-policy test permit node 10
[Sysname-route-policy] if-match community 1
1.1.20 if-match cost
Syntax
if-match cost value
undo if-match cost
View
Routing policy view
Default Level
2: System level
Parameters
cost: Specifies the cost to match.
Description
Use the if-match cost command to specify a cost for matching against the cost of a route.
Use the undo if-match cost command to remove the match criterion.
The match criterion is not configured by default.
This command is one of the if-match clauses of routing policy, used for matching routes with the specified route cost.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match tag, route-policy, apply ip-address next-hop, apply cost, apply local-preference, apply origin, apply tag.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. Define an if-match clause to permit routing information with a cost of 8.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match cost 8
1.1.21 if-match extcommunity
Syntax
if-match extcommunity ext-comm-list-number&<1-16>
undo if-match extcommunity [ ext-comm-list-number&<1-16> ]
View
Routing policy view
Default Level
2: System level
Parameters
ext-comm-list-number: Extended community list number.
&<1-16>: Indicates the argument before it can be entered up to 16 times.
Description
Use the if-match extcommunity command to specify extended community list(s) for matching against the extended community attribute of routing information.
Use the undo if-match extcommunity command to remove the match criterion.
The match criterion is not configured by default.
Examples
# Create a routing policy named policy1 with node 10, matching mode as permit. Match the extended community attribute of routes against extended community lists 100 and 150.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match extcommunity 100 150
1.1.22 if-match interface
Syntax
if-match interface { interface-type interface-number }
undo if-match interface [ interface-type interface-number ]
View
Routing policy view
Default Level
2: System level
Parameters
interface-type: Interface type
interface-number: Interface number
Description
Use the if-match interface command to specify an interface for matching against the outbound interface of routing information.
Use the undo if-match interface command to remove the match criterion.
The match criterion is not configured by default.
Related commands: if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply cost, apply local-preference, apply origin, apply tag.
Examples
# Create a routing policy named policy1 with node 10, matching mode as permit. Define an if-match clause to match the routing information with the outbound interface as VLAN-interface 1.
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match interface vlan-interface 1
1.1.23 if-match mpls-label
Syntax
if-match mpls-label
undo if-match mpls-label
View
Routing policy view
Default Level
2: System level
Parameters
None
Description
Use the if-match mpls-label command to specify the MPLS label match criterion.
Use the undo if-match mpls-label command to remove the match criterion.
The match criterion is not configured by default.
Examples
# Match MPLS label of routing updates.
<Sysname> system-view
[Sysname] route-policy setcommunity permit node 16
[Sysname-route-policy] if-match mpls-label
1.1.24 if-match route-type
Syntax
if-match route-type { internal | external-type1 | external-type2 | external-type1or2 | is-is-level-1 | is-is-level-2 | nssa-external-type1 | nssa-external-type2 | nssa-external-type1or2 } *
undo if-match route-type [ internal | external-type1 | external-type2 | external-type1or2 | is-is-level-1 | is-is-level-2 | nssa-external-type1 | nssa-external-type2 | nssa-external-type1or2 ] *
View
Routing policy view
Default Level
2: System level
Parameters
internal: Internal routes (OSPF intra-area and inter-area routes).
external-type1: OSPF Type 1 external routes.
external-type2: OSPF Type 2 external routes.
external-type1or2: OSPF Type 1 or 2 external routes.
is-is-level-1: IS-IS Level-1 routes.
is-is-level-2: IS-IS Level-2 routes.
nssa-external-type1: OSPF NSSA Type 1 external routes.
nssa-external-type2: OSPF NSSA Type 2 external routes.
nssa-external-type1or2: OSPF NSSA Type 1 or 2 external routes.
Description
Use the if-match route-type command to configure a route type match criterion.
Use the undo if-match route-type command to remove the match criterion.
The match criterion is not configured by default.
Examples
# Create a routing policy named policy1 with node 10, matching mode as permit. Define an if-match clause to match internal routes.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match route-type internal
1.1.25 if-match tag
Syntax
if-match tag value
undo if-match tag
View
Routing policy view
Default Level
2: System level
Parameters
value: Specifies a tag value.
Description
Use the if-match tag command to specify a tag for matching against the tag field of RIP, OSPF and IS-IS routes.
Use the undo if-match tag command to remove the match criterion.
The match criterion is not configured by default.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, route-policy, apply ip-address next-hop, apply cost, apply local-preference, apply origin, apply tag.
Examples
# Create a routing policy named policy1 with node 10, matching mode as permit. Define an if-match clause to permit RIP, OSPF and IS-IS routing information with the tag as 8.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match tag 8
1.1.26 ip as-path
Syntax
ip as-path as-path-number { deny | permit } regular-expression
undo ip as-path as-path-number
View
System view
Default Level
2: System level
Parameters
as-path-number: AS path list number.
deny: Specifies the matching mode for the AS path ACL as deny.
permit: Specifies the matching mode for the AS path ACL as permit.
regular-expression: Regular expression of AS path.
BGP routing information contains the AS path attribute field that identifies the autonomous systems through which routing information has passed. Used to compare with the AS path attribute, a regular expression is a formula comprised of characters, for example, ^200. *100$, which matches AS path attribute fields that start with AS200 and end with AS100.
Table 1-3 The meanings of special characters used in regular expressions are shown below:
Character |
Meaning |
. |
Matches any single character, including blank space. |
* |
Matches 0 or more patterns. |
+ |
Matches 1 or more patterns. |
^ |
Matches the beginning of an input string. |
$ |
Matches the end of an input string. |
_ |
Matches a comma, left brace, right brace, left parenthesis, right parenthesis, the beginning of an input string, the end of an input string, or a space. |
[ range ] |
Means the range of single-character patterns. |
- |
Separates the ending points of a range. |
Description
Use the ip as-path command to create an AS path list.
Use the undo ip as-path command to remove an AS path list.
No AS path list is created by default.
Examples
# Create an AS path ACL numbered 1, permitting routing information whose AS_PATH starts with 10.
<Sysname> system-view
[Sysname] ip as-path 1 permit ^10
1.1.27 ip community-list
Syntax
ip community-list basic-comm-list-num { deny | permit } [ community-number-list ] [ internet | no-advertise | no-export | no-export-subconfed ] *
undo ip community-list basic-comm-list-num [ community-number-list ] [ internet | no-advertise | no-export | no-export-subconfed ] *
ip community-list adv-comm-list-num { deny | permit } regular-expression
undo ip community-list adv-comm-list-num [ regular-expression ]
View
System view
Default Level
2: System level
Parameters
basic-comm-list-num: Basic community list number.
adv-comm-list-num: Advanced community list number.
regular-expression: Regular expression of advanced community attribute.
deny: Specifies the matching mode of the community list as deny.
permit: Specifies the matching mode of the community list as permit.
community-number-list: Community number list, in the community number or aa:nn format. Each format can be entered up to 16 times.
internet: Routes with this attribute can be advertised to all the BGP peers. By default, all routes have this attribute.
no-advertise: Routes with this attribute will not be advertised to other BGP peers.
no-export: Routes with this attribute will not be advertised out the local AS, or the confederation but can be advertised to other ASs in the confederation.
no-export-subconfed: Routes with this attribute can not be advertised out the local AS, or to other sub ASs in the confederation.
Description
Use the ip community-list to define a community list.
Use the undo ip community-list command to remove a community list.
No community list is defined by default.
Examples
# Define basic community list 1 to permit routing information with the internet community attribute.
<Sysname> system-view
[Sysname] ip community-list 1 permit internet
# Define advanced community list 100 to permit routing information with the community attribute starting with 10.
<Sysname> system-view
[Sysname] ip community-list 100 permit ^10
1.1.28 ip extcommunity-list
Syntax
ip extcommunity-list ext-comm-list-number { deny | permit } { rt route-target }&<1-16>
undo ip extcommunity-list ext-comm-list-number
View
System view
Default Level
2: System level
Parameters
ext-comm-list-number: Extended community list number.
permit: Specifies the matching mode for the extended community list as permit.
deny: Specifies the matching mode for the extended community list as deny.
rt route-target: Specifies the route target extended community attribute. route-target has two forms:
l 16-bit AS number: 32-bit self-defined number, for example, 101:3;
l 32-bit IP address: 16-bit self-defined number, for example, 192.168.122.15:1.
&<1-16>: Indicates the argument before it can be entered up to 16 times.
Description
Use the ip extcommunity-list to define an extended community list entry.
Use the undo ip extcommunity-list command to remove an extended community list.
Examples
# Define extended community list 1 to permit routing information with RT 200:200.
<Sysname> system-view
[Sysname] ip extcommunity-list 1 permit rt 200:200
1.1.29 route-policy
Syntax
route-policy route-policy-name { permit | deny } node node-number
undo route-policy route-policy-name [ node node-number ]
View
System view
Default Level
2: System level
Parameters
route-policy-name: Routing policy name.
permit: Specifies the matching mode of the routing policy node as permit. If a route satisfies all the if-match clauses of the node, it passes through the filtering of the node and then is executed with the apply clauses of the node. If not, it goes to the next node of the routing policy.
deny: Specifies the matching mode of the routing policy node as deny. If a route satisfies all the if-match clauses of the node, it does not pass the filtering of the node and will not go to the next node.
node node-number: Node number. The node with a smaller node-number will be tested first when the routing policy is used for filtering routing information.
Description
Use the route-policy command to create a routing policy and enter its view.
Use the undo route-policy command to remove a routing policy.
No routing policy is created by default.
A routing policy is used for routing information filtering or policy routing. It contains several nodes and each node comprises some if-match and apply clauses. The if-match clauses define the matching criteria of the node and the apply clauses define the actions performed after a packet passes the filtering of the node. The relation among the if-match clauses of a node is logic AND, namely all the if-match clauses must be satisfied. The filter relation among different route-policy nodes is logic OR, namely a packet passing a node passes the routing policy.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, apply ip-address next-hop, apply local-preference, apply cost, apply origin, apply tag.
Examples
# Create routing policy policy1 with node 10 with matching mode as permit, and then enter routing policy view.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy]
1.2 IPv4 Routing Policy Configuration Commands
1.2.1 apply ip-address next-hop
Syntax
apply ip-address next-hop ip-address
undo apply ip-address next-hop
View
Routing policy view
Default Level
2: System level
Parameters
ip-address: IP address of the next hop.
Description
Use the apply ip-address next-hop command to set a next hop for IPv4 routing information.
Use the undo apply ip-address next-hop command to remove the clause configuration.
No next hop address is set for IPv4 routing information by default.
It is invalid to use the apply ip-address next-hop command to set a next hop when redistributing routes.
Related commands: if-match interface, if-match acl, if-match ip-prefix, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply local-preference, apply cost, apply origin, apply tag.
Examples
# Create routing policy policy1 with node 10, matching mode permit. If passing AS path ACL 1, a route‘s next hop is set to 193.1.1.8.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply ip-address next-hop 193.1.1.8
1.2.2 display ip ip-prefix
Syntax
display ip ip-prefix [ ip-prefix-name ]
View
Any view
Default Level
1: Monitor level
Parameters
ip-prefix-name: IP prefix list name.
Description
Use the display ip ip-prefix command to display the statistics of an IPv4 prefix list. If no ip-prefix-name is specified, statistics for all IPv4 prefix lists will be displayed.
Related commands: ip ip-prefix.
Examples
# Display the statistics of IPv4 prefix list abc.
<Sysname> display ip ip-prefix abc
Prefix-list abc
Permitted 0
Denied 0
index: 10 permit 1.0.0.0/11 ge 22 le 32
Table 1-4 Description on the fields of the display ip ip-prefix command.
Field |
Description |
Prefix-list |
Name of the IPv4 prefix list |
Permitted |
Number of routes satisfying the match criterion |
Denied |
Number of routes not satisfying the match criterion |
index |
Internal serial number of the IPv4 prefix list |
permit |
Matching mode: permit or deny |
1.0.0.0/11 |
Match IP address and mask |
ge |
greater-equal, the lower limit mask |
le |
less-equal, the upper limit mask |
1.2.3 if-match acl
Syntax
if-match acl acl-number
undo if-match acl
View
Routing policy view
Default Level
2: System level
Parameters
acl-number: ACL number.
Description
Use the if-match acl command to configure an ACL match criterion.
Use the undo if-match acl command to remove the match criterion.
No ACL match criterion is configured by default.
Related commands: if-match interface, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply cost, apply local-preference, apply origin, apply tag.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. Define an if-match clause to permit routes matching ACL 2000.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match acl 2000
1.2.4 if-match ip
Syntax
if-match ip { next-hop | route-source } { acl acl-number | ip-prefix ip-prefix-name }
undo if-match ip { next-hop | route-source } [ acl | ip-prefix ]
View
Routing policy view
Default Level
2: System level
Parameters
next-hop: Matches next hop.
route-source: Matches source address.
acl acl-number: Matches an ACL.
ip-prefix ip-prefix-name: Matches an IP prefix list.
Description
Use the if-match ip command to configure a next hop or source address match criterion for IPv4 routes.
Use the undo if-match ip command to remove the match criterion.
The match criterion is not configured by default.
Related commands: route-policy.
Examples
# Create routing policy policy1 with node 10, matching mode permit. Define an if-match clause to permit routing information whose next hop address matches IP prefix list p1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match ip next-hop ip-prefix p1
1.2.5 if-match ip-prefix
Syntax
if-match ip-prefix ip-prefix-name
undo if-match ip-prefix
View
Routing policy view
Default Level
2: System level
Parameters
ip-prefix-name: Matches an IP prefix list.
Description
Use the if-match ip-prefix command to configure an IP prefix list based match criterion.
Use the undo if-match ip-prefix command to remove the match criterion.
No IP prefix list based match criterion is configured by default.
Related commands: if-match interface, if-match ip next-hop, if-match cost, if-match tag, route-policy, apply ip-address next-hop, apply cost, apply local-preference, apply origin, apply tag.
Examples
# Create routing policy policy1 with node 10, matching mode as permit. Define an if-match clause to permit a route whose destination address matches IP prefix list p1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match ip-prefix p1
1.2.6 ip ip-prefix
Syntax
ip ip-prefix ip-prefix-name [ index index-number ] { permit | deny } ip-address mask-length [ greater-equal min-mask-length ] [ less-equal max-mask-length ]
undo ip ip-prefix ip-prefix-name [ index index-number ]
View
System view
Default Level
2: System level
Parameters
ip-prefix-name: IPv4 prefix list name.
index-number: Index number, for uniquely specifying an item of the IPv4 prefix list. The index with a smaller number is tested first.
permit: Specifies the matching mode for the IPv4 prefix list as permit, that is, when a route to be filtered is in the range of the IPv4 prefix list, the route passes the IPv4 prefix list without needing to enter the next item for testing. If the route to be filtered is not in the prefix range, it will enter the next item for testing.
deny: Specifies the matching mode for the IPv4 prefix list as deny, that is, when a route to be filtered is in the IPv4 prefix list range, the route neither passes the filter nor enters the next node for testing. If not in the range, the route will enter the next item test.
ip-address mask-length: Specifies an IPv4 address prefix and mask length.
min-mask-length, max-mask-length: Specifies the range for prefix if the IPv4 address and prefix length are matched. greater-equal means “greater than or equal to” and less-equal means “less than or equal to”. The range relation is mask-length <= min-mask-length <= max-mask-length <= 32. If only min-mask-length is specified, the prefix length range is [ min-mask-length, 32 ]. If only max-mask-length is specified, the prefix length range is [mask-length, max-mask-length ]. If both min-mask-length and max-mask-length are specified, the prefix length range is [ min-mask-length, max-mask-length ].
Description
Use the ip ip-prefix command to configure an IPv4 prefix list item.
Use the undo ip ip-prefix command to remove an IPv4 prefix list or an item.
No IPv4 prefix list is configured by default.
An IPv4 prefix list is used to filter IPv4 addresses. It may have multiple items, each of which specifies a range of IPv4 prefix. The filtering relation among items is logic OR, namely, passing any item means the IPv4 prefix list is passed. If no item is passed, the IP prefix list cannot be passed.
The IP prefix range is determined by mask-length and [ min-mask-length, max-mask-length ]. If both mask-length and [ min-mask-length, max-mask-length ] are specified, then the IP address to be filtered must satisfy both of them.
If ip-address mask-length is specified as 0.0.0.0 0, then only the default routes will be matched.
To match all the routes, use 0.0.0.0 0 less-equal 32.
Examples
# Create a routing policy named policy1 with node 10 with matching mode as permit. Define an IP prefix list named p1 to permit only the routes in the network segment 10.0.192.0/8 and with mask length 17 or 18.
<Sysname> system-view
[Sysname] ip ip-prefix p1 permit 10.0.192.0 8 greater-equal 17 less-equal 18
1.2.7 reset ip ip-prefix
Syntax
reset ip ip-prefix [ ip-prefix-name ]
View
User view
Default Level
2: System level
Parameters
ip-prefix-name: IP prefix list name.
Description
Use the reset ip ip-prefix command to clear the statistics of a specified IPv4 prefix list. If no ip-prefix-name is specified, the statistics of all the IPv4 prefix lists will be cleared.
Examples
# Clear the statistics of IPv4 prefix list abc.
<Sysname> reset ip ip-prefix abc
1.3 IPv6 Routing Policy Configuration Commands
1.3.1 apply ipv6 next-hop
Syntax
apply ipv6 next-hop ipv6-address
undo apply ipv6 next-hop
View
Routing policy view
Default Level
2: System level
Parameters
ipv6-address: Next hop IPv6 address.
Description
Use the apply ipv6 next-hop command to apply a next hop to IPv6 routes.
Use the undo apply ipv6 next-hop command to remove the clause configuration.
No next hop address is set for IPv6 routing information by default.
Using the apply ipv6 next-hop command to set a next hop when redistributing routes does not take effect.
Examples
# Create routing policy policy1 with node 10 with matching mode being permit. If a route matches AS path list 1, set next hop 3ff3:506::1 for it.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match as-path 1
[Sysname-route-policy] apply ipv6 next-hop 3ffe:506::1
1.3.2 display ip ipv6-prefix
Syntax
display ip ipv6-prefix [ ipv6-prefix-name ]
View
Any view
Default Level
1: Monitor level
Parameters
ipv6-prefix-name: IPv6 prefix list name, a string of 1 to 19 characters.
Description
Use the display ip ipv6-prefix command to display the statistics of the specified IPv6 prefix list. If no IPv6 prefix list is specified, the statistics of all the IPv6 prefix lists will be displayed.
Examples
# Display the statistics of all the IPv6 prefix lists.
<Sysname> display ip ipv6-prefix
Prefix-list6 abc
Permitted 0
Denied 0
index: 10 permit ::/0
index: 20 permit ::/1 ge 1 le 128
Table 1-5 Description on the fields of the display ip ipv6-prefix command
Field |
Description |
Prefix-list6 |
Name of the IPv6 prefix list |
Permitted |
Number of routes satisfying the match criterion |
Denied |
Number of routes not satisfying the match criterion |
Index |
Internal serial number of address prefix list |
Permit |
Matching mode: permit, deny |
::/1 |
IPv6 address and its prefix length for matching |
ge |
greater-equal, the lower limit prefix length |
Le |
less-equal, the upper limit prefix length |
1.3.3 if-match ipv6
Syntax
if-match ipv6 { address | next-hop | route-source } { acl acl6-number | prefix-list ipv6-prefix-name }
undo if-match ipv6 { address | next-hop | route-source } [ acl | prefix-list ]
View
Routing policy view
Default Level
2: System level
Parameters
address: Matches the destination address of IPv6 routing information.
next-hop: Matches the next hop of IPv6 routing information.
route-source: Matches the source address of IPv6 routing information.
acl acl6-number: Specifies the number of an IPv6 ACL for filtering, in the range 2000 to 3999 for address, and 2000 to 2999 for next-hop and route-source.
prefix-list ipv6-prefix-name: Specifies the name of a IPv6 prefix list for filtering, a string of 1 to 19 characters.
Description
Use the if-match ipv6 command to configure a destination, next hop or source address based match criterion for IPv6 routes.
Use the undo if-match ipv6 command to remove the match criterion.
The match criterion is not configured by default.
Examples
# Create a routing policy named policy1 with node 10, matching mode as permit. Define an if-match clause to permit the routing information whose next hop address matches IPv6 prefix list p1.
<Sysname> system-view
[Sysname] route-policy policy1 permit node 10
[Sysname-route-policy] if-match ipv6 next-hop prefix-list p1
1.3.4 ip ipv6-prefix
Syntax
ip ipv6-prefix ipv6-prefix-name [ index index-number ] { deny | permit } ipv6-address prefix-length [ greater-equal min-prefix-length ] [ less-equal max-prefix-length ]
undo ip ipv6-prefix ipv6-prefix-name [ index index-number ]
View
System view
Default Level
2: System level
Parameters
ipv6-prefix-name: IPv6 prefix list name for uniquely specifying an IPv6 prefix list.
index-number: Index number for uniquely specifying an IPv6 prefix list item. The item with a smaller index-number will be tested first.
permit: Specifies the matching mode for the IPv6 prefix list as permit, that is, if a route matches the IPv6 prefix list, it passes the IPv6 prefix list without needing to enter the next item for test. If not, it will enter the next item’s test.
deny: Specifies the matching mode for the IPv6 prefix list as deny, that is, if a route matches the IPv6 prefix list, the route neither passes the filter nor enters the next node for test; if not, the route will enter the next item’s test.
ipv6-address prefix-length: Specifies an IPv6 prefix and prefix length. When specified as :: 0, it matches the default route.
greater-equal min-prefix-length: Greater than or equal to the minimum prefix length.
less-equal max-prefix-length: Less than or equal to the maximum prefix length.
The length relation is mask-length <= min-mask-length <= max-mask-length <= 32. If only min-prefix-length is specified, the prefix length range is [ min-prefix-length, 128 ]. If only max-prefix-length is specified, the prefix length range is [ prefix-length, max-prefix-length ]. If both min-prefix-length and max-prefix-length are specified, the prefix length range is [ min-prefix-length, max-prefix-length ].
Description
Use the ip ipv6-prefix command to configure an IPv6 prefix list item.
Use the undo ip ipv6-prefix command to remove an IPv6 prefix list or an item.
No IPv6 prefix list is configured by default.
The IPv6 prefix list is used to filter IPv6 addresses. It may have multiple items, and each of them specifies a range of IPv6 prefix. The filtering relation among items is logic OR, namely, a route passing an item will pass the prefix list.
The IPv6 prefix range is determined by prefix-length and [ min-prefix-length, max-prefix-length ]. If both mask-length and [ min-mask-length, max-mask-length ] are specified, then the IPv6 addresses must satisfy both of them.
If ipv6-address prefix-length is specified as :: 0, then only the default route matches.
If you want it to match all the routes, configure it as :: 0 less-equal 128.
Examples
# Permit the IPv6 addresses with mask length between 32 bits and 64 bits.
<Sysname> system-view
[Sysname] ip ipv6-prefix abc permit :: 0 greater-equal 32 less-equal 64
# Deny the IPv6 addresses with prefix as 3FFE:D00::/32, prefix length greater than or equal to 32 bits.
<Sysname> system-view
[Sysname] ip ipv6-prefix abc deny 3FEE:D00:: 32 less-equal 128
1.3.5 reset ip ipv6-prefix
Syntax
reset ip ipv6-prefix [ ipv6-prefix-name ]
View
User view
Default Level
2: System level
Parameters
ipv6-prefix-name: IPv6 prefix list name, a string of 1 to 19 characters.
Description
Use the reset ip ipv6-prefix command to clear the statistics of the specified IPv6 prefix list. If no name is specified, the statistics of all IPv6 prefix lists will be cleared.
Examples
# Clear the statistics of IPv6 prefix list abc.
<Sysname> reset ip ipv6-prefix abc