- Table of Contents
- Related Documents
-
Title | Size | Download |
---|---|---|
06-Routing Policy Commands | 93.57 KB |
Table of Contents
Chapter 1 IP Routing Policy Configuration Commands.
1.1 IP Routing Policy Configuration Commands
1.1.16 if-match { acl | ip-prefix }
Chapter 1 IP Routing Policy Configuration Commands
& Note:
The term “router” or the router icon in this document refers to a router in a generic sense or an S9500 switch running routing protocols.
1.1 IP Routing Policy Configuration Commands
In some situations, it may be required that only some routing information meeting a certain condition be received. In this case, you can define a Filter-policy to filter advertised routing information so that only the routing information having passed the filtration can be received.
& Note:
For the details about the apply mpls-label, if-match mpls-label and if-match vpn-target commands, refer to MPLS L3VPN Commands in the MPLS VPN Volume.
1.1.1 apply as-path
Syntax
apply as-path as-number [ as-number [ as-number ... ] ]
undo apply as-path
View
Route policy view
Parameters
as-number-1... as-number-n: AS number to be added.
Description
Use the apply as-path command to configure AS number to be added in front of the original AS path in Route-policy.
Use the undo apply as-path command to cancel the AS sequence number added in front of the original AS path.
By default, no AS number is set.
If the match condition of Route-policy is met, the AS attribute of the transmitting route will be changed. You can add up to 10 AS numbers.
Examples
# Configure AS 200 to be added in front of the original AS path in Route-policy.
[H3C-route-policy] apply as-path 200
1.1.2 apply community
Syntax
apply community [ aa:nn ]* [ [ no-export-subconfed | no-export | no-advertise ] * [ additive ] | additive | none ]
undo apply community
View
Route policy view
Parameters
none: Deletes the community attribute of the route. This keyword can be input up to 13 times.
aa:nn: Community number.
no-export-subconfed: Does not send matched route outside the sub-AS.
no-advertise: Does not send matched route to any peer.
no-export: Does not advertise the route to outside the AS or the confederation, but can advertises to other sub-Ass in the confederation.
additive: Community attribute of the additive route.
Description
Use the apply community command to configure the set BGP community attribute of Route-policy.
Use the undo apply community command to cancel the set BGP community attribute.
By default, BGP community attribute is not set.
If the matching conditions defined in the Route-policy are satisfied, the BGP community attribute is set.
Related commands: apply extcommunity, display bgp routing-table community, if-match community, ip community-list, route-policy.
Examples
# Configure one Route-policy setcommunity, whose node serial number is 16 and match mode is permit, and enter Route policy view to set match conditions and attribute modification actions to be executed.
[H3C] route-policy permit node 16
[H3C-route-policy] if-match as-path 8
[H3C-route-policy] apply community no-export
1.1.3 apply cost
Syntax
apply cost value
undo apply cost
View
Route policy view
Parameters
value: Specifies the route cost value of route information.
Description
Use the apply cost command to configure the route cost value of route information. Use the undo apply cost command to cancel the Apply sub-statement.
By default, no Apply sub-statement is defined.
This command is one Apply sub-statement of Route-policy. It configures the route cost value of the routing information that passes the filtration.
Related commands: apply local-preference, apply ip next-hop, apply tag, apply origin, if-match interface, if-match { acl | ip-prefix }, if-match cost, if-match tag, route-policy.
Examples
# Define one Apply sub-statement. When it is used for setting route information attribute, it sets the route metric value of route information as 120.
[H3C-route-policy] apply cost 120
1.1.4 apply cost-type
Syntax
apply cost-type [ internal | external ]
undo apply cost-type
View
Route policy View
Parameters
internal: For BGP, it indicates when a BGP peer advertises routes to its EBGP peer, the peer uses the cost value of IGP as the MED value of BGP. For IS-IS, it indicates the internal cost. For other protocols, it is invalid.
external: It is only valid for IS-IS and it indicates external cost type of IS-IS.
Description
Use the apply cost-type command to configure the route cost type of route information. Use the undo apply cost-type command to cancel the Apply sub-statement.
By default, route cost type is not set.
Examples
# Set the cost type of IGP as MED value of BGP.
[H3C-route-policy] apply cost-type internal
1.1.5 apply extcommunity
Syntax
apply extcommunity rt { as-number : nn | ip-address : nn } &<1-16> [ additive ]
undo apply extcommunity
View
Route policy view
Parameters
rt: Sets the route target extended community attribute
as-number: AS number, in the range 1 to 65535.
ip-address: IPv4 address.
nn: An integer in the range 1 to 4294967295 if an AS number is specified or in the range 1 to 65535 if an IPv4 address is specified.
additive: Allows the specified attributes to be added to the original community attribute. If the number of entered attributes exceeds 16, the exceeded ones are discarded,
&<1-16>: Indicates the argument before it can be entered up to 16 times.
Description
Use the apply extcommunity command to apply the specified extended community attributes to BGP routes.
Use the undo apply extcommunity command to remove the clause configuration.
The BGP extended community attribute is not set by default.
Related commands: apply community.
Examples
# Apply the specified extended community attributes to BGP routes.
[H3C-route-policy] apply extcommunity rt 100:1 100:2 additive
1.1.6 apply ip next-hop
Syntax
apply ip next-hop ip-address
undo apply ip next-hop
View
Route policy view
Parameters
ip-address: The next-hop address.
Description
Use the apply ip next-hop command to configure the next hop address in the route information.
Use the undo apply ip next-hop command to cancel the Apply sub-statement.
By default, no Apply sub-statement is defined.
This command is one of the Apply sub-statements of Route-policy. When it is used for setting route information attribute, it sets the next hop address area of route information passing filtration.
Related commands: apply cost, apply local-preference, apply tag, apply origin, if-match interface, if-match { acl | ip-prefix }, if-match ip next-hop, if-match cost, if-match tag, route-policy.
# Define an Apply sub-statement. Set the next hop address of route information as 193.1.1.8 when it is used for setting route information attribute.
[H3C-route-policy] apply ip next-hop 193.1.1.8
1.1.7 apply isis
Syntax
apply isis [ level-1 | level-2 | level-1-2 ]
undo apply isis
View
Route policy view
Parameters
level-1: Sets to import the matched route to Level-1 area.
level-2: Sets to import the matched route to Level-2 area.
level-1-2: Sets to import the matched route to both Level-1 and Level-2 area.
Description
Use the apply isis command to configure to apply the level of a matched route to be imported to Level-1, Level-2 or Level-1-2.
Use the undo apply isis command to cancel the Apply sub-statement.
By default, no apply clause is defined.
Related commands: apply cost, apply tag, apply origin, if-match interface, if-match { acl | ip-prefix }, if-match ip next-hop, if-match cost, if-match tag, route-policy.
Examples
# Define an apply clause, setting to import the route to a level-2 area.
[H3C-route-policy] apply isis level-2
1.1.8 apply local-preference
Syntax
apply local-preference local-preference-value
undo apply local-preference
View
Route policy view
Parameters
local-preference: Newly set local preference.
Description
Use the apply local-preference command to configure to apply the local preference of route information.
Use the undo apply local-preference command to cancel the Apply sub-statement.
Related commands: apply local-preference, apply ip next-hop, apply tag, apply origin, if-match interface, if-match { acl | ip-prefix }, if-match ip next-hop, if-match cost, if-match tag, route-policy.
Examples
# Define an Apply sub-statement. Apply the local preference level of route information as 130 when this Apply sub-statement is used for setting route information attribute. .
[H3C-route-policy] apply local-preference 130
1.1.9 apply origin
Syntax
apply origin { igp | egp as-number | incomplete }
undo apply origin
View
Route policy view
Parameters
igp: Sets the BGP route information source as internal route.
egp: Sets the BGP route information source as external route
as-number: Specifies AS number of external route.
incomplete: Sets the BGP route information source as unknown source.
Description
Use the apply origin command to configure to apply the route source.
Use the undo apply origin command to cancel the Apply sub-statement.
Related commands: apply cost, apply local-preference, apply ip next-hop, apply tag, if-match interface, if-match { acl | ip-prefix }, if-match ip next-hop, if-match cost, if-match tag, route-policy.
Examples
# Define an Apply sub-statement. When it is used for setting route information attribute, it sets the route source of BGP route information as IGP.
[H3C-route-policy] apply origin igp
1.1.10 apply tag
Syntax
apply tag value
undo apply tag
View
Route policy view
Parameters
value: Specifies the tag value of route information.
Description
Use the apply tag command to configure to set the tag area of OSPF route information. Use the undo apply tag command to cancel the Apply sub-statement.
Related commands: apply cost, apply local-preference, apply ip next-hop, if-match interface, if-match { acl | ip-prefix }, if-match { acl | ip-prefix }, if-match ip next-hop, if-match cost, if-match tag, route-policy. .
Examples
# Define one Apply sub-statement. When it is used for setting route information attribute, it sets the tag area of route information as 100.
[H3C-route-policy] apply tag 100
1.1.11 display ip as-path-acl
Syntax
display ip as-path-acl [ as-path-acl-number ]
View
Any view
Parameters
as-path-acl-number: AS path ACL number.
Description
Use the display ip as-path-acl command to display BGP AS path ACL information.
Information about all the BGP AS path ACLs 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 ACL 1.
<H3C> display ip as-path-acl 1
No. Mode Expression
10 permit 200,300
1.1.12 display ip ip-prefix
Syntax
display ip ip-prefix [ ip-prefix-name ]
View
Any view
Parameters
ip-prefix-name: Specifies displayed address prefix list name.
Description
Use the display ip ip-prefix command to display the address prefix list.
If no ip-prefix-name is specified, all configured address prefix lists are displayed.
Related commands: ip ip-prefix.
Examples
# Display the information of the address prefix list named p1.
<H3C> display ip ip-prefix p1
name index conditions ip-prefix / mask GE LE
p1 10 permit 10.1.0.0/16 17 18
Table 1-1 Description of the fields of the display ip ip-prefix command
Field |
Description |
name |
Name of ip-prefix |
index |
Internal sequence number of ip-prefix |
conditions |
Mode: permit or deny |
ip-prefix / mask |
Address and network segment length of ip-prefix |
GE |
Greater-equal value of ip-prefix network segment length |
LE |
Less-equal value of ip-prefix network segment length |
1.1.13 display route-policy
Syntax
display route-policy [ route-policy-name ]
View
Parameters
route-policy-name: Specifies displayed Route-policy name.
Description
Use the display route-policy command to display the configured Route-policy.
If the route-policy-name argument is not specified, all configured Route-policies are displayed.
Related commands: route-policy.
Examples
# Display the information of Route-policy named policy1.
<H3C> display route-policy policy1
Route-policy : policy1
Permit 10 : if-match (prefixlist) p1
apply cost 100
matched : 0 denied : 0
Table 1-2 Description of the fields of the display route-policy command
Field |
Description |
|
Route-policy |
Name of ip-prefix |
|
Permit 10 |
Information of the route-policy with mode configured as permit and node as 10: |
|
if-match (prefixlist) p1 |
The configured if-match clause |
|
apply cost 100 |
Apply routing cost 100 to the routes matching the conditions defined by if-match clause |
|
matched |
Number of routes matching the conditions set by if-match clause |
|
denied |
Number of routes not matching the conditions set by if-match clause |
1.1.14 filter-policy export
Syntax
filter-policy { acl-number | ip-prefix ip-prefix-name } export [ routing-protocol ]
undo filter-policy { acl-number | ip-prefix ip-prefix-name } export [ routing-protocol ]
View
Routing protocol view
Parameters
acl-number: Number of the access control list used for matching the destination address field of the routing information.
ip-prefix-name: Address prefix list used for matching the routing information destination address field.
routing-protocol: The routing information of which kind of route protocol to be filtered.
Description
Use the filter-policy export command to configure to set the filtering conditions of the routing information advertised by a certain type of routing protocols.
Use the undo filter-policy export command to cancel the filtering conditions set.
By default, the advertised routing information is not filtered.
In some cases, it may be required that only the routing information meeting some conditions can be advertised. Then, the filter-policy command can be used to set the filtering conditions for the routing information to be advertised. Only the routing information passing the filtration can be advertised.
Related commands: filter-policy import.
& Note:
If no rule is specified in the filter-policy command, all routes are denied by default.
Examples
# Define the filtering rules for advertising the routing information of RIP. Only the routing information passing the filtering of address prefix list p1 will be advertised by RIP.
[H3C-rip] filter-policy ip-prefix p1 export
1.1.15 filter-policy import
Syntax
filter-policy gateway ip-prefix-name import
undo filter-policy gateway ip-prefix-name import
filter-policy { acl-number | ip-prefix ip-prefix-name [ gateway ip-prefix-name] } import
undo filter-policy { acl-number | ip-prefix ip-prefix-name [ gateway ip-prefix-name] } import
View
Routing protocol view
Parameters
acl-number: The access control list number used for matching the destination address field of the routing information.
ip-prefix ip-prefix-name: The prefix address list name. Its matching object is the destination address field of the routing information.
gateway ip-prefix-name: The prefix address list name of the neighbor router address. Its matching object is the routing information advertised by the specified neighbor router.
Description
Use the filter-policy gateway import command to filter the received routing information advertised by a specified router.
Use the undo filter-policy gateway import command to cancel the setting of the filtering condition.
Use the filter-policy import command to set the condition for filtering the routing information.
Use the undo filter-policy import command to cancel the setting of filter condition.
By default, the received routing information is not filtered. To ignore some routing information received, you can use the filter-policy command to set the filter condition.
Related commands: filter-policy export.
& Note:
If no rule is specified in the filter-policy command, all routes are denied by default.
Examples
# Define the filtering rule for receiving routing information of RIP. Only the routing information filtered through the address prefix list p1 can be received by RIP.
[H3C-rip] filter-policy ip-prefix p1 import
1.1.16 if-match { acl | ip-prefix }
Syntax
if-match { acl acl-number | ip-prefix ip-prefix-name }
undo if-match { acl | ip-prefix }
View
Route policy view
Parameters
acl-number: Specifies the number of the access control list used for filtration.
ip-prefix-name: Specifies the name of the prefix address list used for filtration.
Description
Use the if-match { acl | ip-prefix } command to specify one matching rule for the route-policy and configure the IP address range to match the Route-policy.
Use the undo if-match { acl | ip-prefix } command to cancel the setting of the match rule.
Filtration is performed by quoting an ACL or a prefix address list.
Related commands: apply local-preference, apply origin, apply tag, if-match interface, if-match ip next-hop, if-match cost, if-match tag, route-policy.
Examples
# Define an if-match sub-statement. When the sub-statement is used for filtering route information, the route information filtered by route destination address through address prefix list p1 can pass the if-match sub-statement.
[H3C-route-policy] if-match ip-prefix p1
1.1.17 if-match as-path
Syntax
if-match as-path acl-number
undo if-match as-path
View
Route policy view
Parameters
acl-number: AS path list number, ranging from 1 to 199.
Description
Use the if-match as-path command to match the AS path domain of the BGP routing information.
Use the undo if-match as-path command to cancel the match of AS path domain.
By default, AS path list number is not matched.
This command is an if-match sub-statement of route-policy, used to filter BGP routing information and specify the match condition according to the AS path attribute of the routing information.
Examples
# First define an as-path numbered 2, allowing it to contain the routing information of AS 200 and AS 300. Then define a route-policy named test. An if-match sub-statement is defined for Node 10 of this route-policy, which quotes the definition of as-path.
[H3C] ip as-path-acl 2 permit 200: 300
[H3C] route-policy test permit node 10
[H3C-route-policy] if-match as-path 2
1.1.18 if-match community
Syntax
if-match community { basic-community-number [ whole-match ] | adv-community-number }
undo if-match community
View
Route policy view
Parameters
basic-community-list-number: Basic community list number, ranging from 1 to 99.
adv-community-list-number: Advanced community list number, ranging from 100 to 199.
whole-match: Exact match. That is, all specified communities must be present and only these communities are present.
Description
Use the if-match community command to match the community attribute of the BGP information.
Use the undo if-match community command to cancel the match of the community attribute.
By default, no match operation is done on the community attribute of BGP routes.
This if-match sub-statement of route-policy is used to filter BGP routing information and specify the match condition according to the community attributes of the routing information.
Related commands: route-policy, ip community-list.
Examples
# First define a community-list numbered 1, allowing it to contain the routing information of AS 100 and AS 200. Then, define a route-policy named test. An if-match sub-statement is defined for Node 10 of the route-policy, which quotes the definition of the community-list.
[H3C] ip community-list 1 permit 100: 200
[H3C] route-policy test permit node 10
[H3C-route-policy] if-match community 1
1.1.19 if-match cost
Syntax
if-match cost value
undo if-match cost
View
Route policy view
Parameters
value: Specifies the required route metric value, ranging from 0 to 4294967295.
Description
Use the if-match cost command to configure one of the match rules of the route-policy to match the cost of the routing information.
Use the undo if-match cost command to cancel the configuration of the match rule.
By default, no if-match sub-statement is defined.
This is an if-match sub-statement of Route-policy, used to specify the cost of a route matches the specified condition.
Related commands: apply cost, apply local-preference, apply origin, apply tag, if-match interface, if-match { acl | ip-prefix }, if-match ip next-hop, if-match tag.
Examples
# Define an if-match sub-statement, allowing the routing information with routing cost of 8 to pass this if-match sub-statement.
[H3C-route-policy] if-match cost 8
1.1.20 if-match interface
Syntax
if-match interface interface-type interface-number
undo if-match interface
View
Route policy view
Parameters
interface-type: Specifies interface type.
interface-number: Specifies interface number.
Description
Use the if-match interface command to configure to match the route whose next hop is designated interface.
Use the undo if-match interface command to cancel the setting of matching condition.
By default, no if-match sub-statement is defined.
This command is an if-match sub-statement of route-policy, used to match the interface corresponding to the route next hop in route filtering.
Related commands: apply cost, apply local-preference, apply origin, apply tag, if-match cost, if-match interface, if-match { acl | ip-prefix }, if-match ip next-hop, if-match tag, route-policy.
Examples
# Define an if-match sub-statement to match the route whose next hop interface is VLAN-interface 1
[H3C-route-policy] if-match interface Vlan-interface 1
1.1.21 if-match ip next-hop
Syntax
if-match ip next-hop { acl acl-number | ip-prefix ip-prefix-name }
undo if-match ip next-hop [ ip-prefix ]
View
Route policy view
Parameters
acl-number: Specifies the number of the access control list used for filtration. The range is 2000 to 2999.
ip-prefix-name: Specifies the name of the prefix address list used for filtration. Its length ranges from 1 to 19.
Description
Use the if-match ip next-hop command to configure one match rule on next hop address of routing information for the route-policy.
Use the undo if-match ip next-hop command to cancel the setting of ACL matching condition.
Use the undo if-match ip next-hop ip-prefix command to cancel the setting of address prefix list matching condition.
Filtration is performed by quoting an ACL or an address prefix list.
By default, no if-match sub-statement is defined.
This command is an if-match sub-statement of route-policy used to filter the routing information based on next hop address by referencing an ACL or an address prefix list.
Related commands: apply cost, apply local-preference, apply origin, apply tag, if-match cost, if-match interface, if-match { acl | ip-prefix }, if-match { acl | ip-prefix }, if-match ip next-hop, if-match tag, route-policy.
Examples
# Define an if-match sub-statement, allowing the routing information whose route next hop address passes the filtration of the prefix address list p1 to pass this if-match sub-statement.
[H3C-route-policy] if-match ip next-hop ip-prefix p1
1.1.22 if-match tag
Syntax
if-match tag value
undo if-match tag
View
Route policy view
Parameters
value: Specifies the value in tag field of OSPF route information.
Description
Use the if-match tag command to configure to match the tag field of OSPF route information.
Use the undo if-match tag command to cancel the existing matching rules.
Related commands: apply cost, apply ip next-hop, apply local-preference, apply origin, apply tag, if-match interface, if-match { acl | ip-prefix }, if-match { acl | ip-prefix }, if-match ip next-hop, if-match tag, route-policy..
Examples
# Define an if-match sub-statement, allowing the OSPF routing information whose tag is 8 to pass the if-match sub-statement.
[H3C-route-policy] if-match tag 8
1.1.23 ip as-path-acl
Syntax
ip as-path-acl acl-number { permit | deny } as-regular-expression
undo ip as-path-acl acl-number
View
System view
Parameters
acl-number: Number of AS path list, ranging from 1 to 199.
as-regular-expression: AS regular expression.
Description
Use the ip as-path-acl command to configure an AS path regular express.
Use the undo ip as-path-acl command to disable the defined regular expression.
The configured AS path list can be used on BGP policy.
Related commands: display bgp routing-table as-path-acl, peer as-path-acl.
Examples
# Configure an AS path list.
[H3C] ip as-path-acl 10 permit 200,300
1.1.24 ip community-list
Syntax
ip community-list basic-comm-list-number { permit | deny } [ aa: nn]* [ internet | no-export-subconfed | no-advertise | no-export ]*
ip community-list adv-comm-list-number { permit | deny } comm-regular-expression
undo ip community-list { basic-comm-list-number | adv-comm-list-number }
View
System view
Parameters
basic-comm-list-number: Number of the basic community list, ranging from 1 to 99.
adv-comm-list-number: Number of the advanced community list, ranging from 100 to 199.
permit: Permits those that match conditions to access.
deny: Denies those that match conditions to access.
aa: nn: Community number. This argument can be input up to 13 times.
internet: Advertises all routes.
no-export-subconfed: Used not to advertise the matched route beyond the sub-ASs.
no-advertise: Used not to send the matched route to any peer.
no-export: Does not advertise routes beyond the AS or the confederation, but can advertise routes to other sub-ASs within the confederation.
comm-regular-expression: Community attribute in regular expression format.
Description
Use the ip community-list command to configure a BGP community list.
Use the undo ip community-list command to cancel the configured BGP community list.
The configured community list can be used in BGP policy.
Related commands: apply community, display bgp routing-table community-list.
Examples
# Define a community attribute list, not allowing to advertise routes with the community attribute beyond the local AS.
[H3C] ip community-list 6 permit no-export-subconfed
1.1.25 ip ip-prefix
Syntax
ip ip-prefix ip-prefix-name [ index index-number ] { permit | deny } network len [ greater-equal greater-equal | less-equal less-equal ]
undo ip ip-prefix ip-prefix-name [ index index-number | permit | deny ]
View
System view
Parameters
ip-prefix-name: The specified address prefix list name. It identifies one address prefix list uniquely.
index-number: Identifies an item in the prefix address list. The item with a smaller index-number will be tested first.
permit: Specifies the match mode of the defined address prefix list items as permit mode. In this case, if the IP address of the route to be filtered matches an entry in the address prefix list, the route passes the filtering and no further check is performed. If not, it is check against the next entry.
deny: Specifies the match mode of the defined address prefix list items as deny mode. In this case, if the IP address of the route to be filtered matches an entry in the address prefix list, the route is denied without further check. If otherwise, the IP address is checked against the next address prefix entry.
network: The IP address prefix range (IP address). If it is 0.0.0.0 0, all the IP addresses are matched.
len: The IP address prefix range (mask length). If it is 0.0.0.0 0, all the IP addresses are matched.
greater-equal, less-equal: The address prefix range [greater-equal, less-equal] to be matched after the address prefix network len has been matched. The meaning of greater-equal is "greater than or equal to", and the meaning of less-equal is "less than or equal to". The range is len <= greater-equal <= less-equal <= 32. When only greater-equal is used, it denotes the prefix range [greater-equal, 32]. When only less-equal is used, it denotes the prefix range [len, less-equal].
Description
Use the ip ip-prefix command to configure an address prefix list or one of its items.
Use the undo ip ip-prefix command to delete an address prefix list or one of its items.
The address prefix list is used for IP address filtering. An address prefix list may contain several items, and each item specifies one address prefix range. The inter-item filtering relation is "OR", that is, passing an item means passing the filtering of this address prefix list. Not passing the filtering of any item means not passing the filtration of this prefix address list.
The address prefix range may contain two parts, which are determined by len and [greater-equal, less-equal] respectively. If the prefix ranges of these two parts are both specified, the IP to be filtered must match the prefix ranges of these two parts.
If you specify network len as 0.0.0.0 0, it only matches the default route.
If you specify network len as 0.0.0.0 0 less-equal 32, it matches all routes.
Examples
# Define an address prefix list named p1, permitting the routes of the network segment 10.0.192.0 8 with a mask length of 17 or 18 to pass.
[H3C] ip ip-prefix p1 permit 10.0.192.0 8 greater-equal 17 less-equal 18
1.1.26 route-policy
Syntax
route-policy route-policy-name { permit | deny } node node-number
undo route-policy route-policy-name [ permit | deny | node node-number ]
View
System view
Parameters
route-policy-name: Specifies the Route-policy name to identify one Route-policy uniquely.
permit: Specifies the match mode of the defined Route-policy node as permit mode. When a route satisfy all if-match sub-statements of this node and pass the filtration, the Apply sub-statement of this node will be executed on the route. Otherwise, the route will be tested by the next node.
deny: Specifies the match mode of the defined Route-policy node as deny mode. When a route satisfy all if-match sub-statements of this node and fails to pass the filtration, it will not tested by the next node.
node: Node of the route policy.
node-number: Index of the node in the route-policy. When this route-policy is used for routing information filtration, the node with a smaller node-number will be tested first.
Description
Use the route-policy command to create a route-policy and enter its view.
Use the undo route-policy command to delete the established Route-policy.
By default, no Route-policy is defined.
Route-policy is used for route information filtration or policy routing. One Route-policy comprises of some nodes and each node comprises of some match and Apply sub-statements. The if-match sub-statement defines the match rules of this node and the Apply sub-statement defines the actions after passing the filtration of this node. The filtering relationship between the if-match sub-statements of the node is “AND”, that is, all if-match sub-statements that meet the node. The filtering relation between Route-policy nodes is "OR", that is, passing the filtering of one node means passing the filtering of this Route-policy. If the information does not pass the filtration of any nodes, it cannot pass the filtration of this Route-policy.
Related commands: apply cost, apply local-preference, apply origin, apply tag, if-match cost, if-match interface, if-match { acl | ip-prefix }, if-match ip next-hop, if-match tag..
Examples
# Configure a Route-policy named policy1, whose node number is 10 and match mode is permit, and enter Route policy view.
[H3C] route-policy policy1 permit node 10