378
Configuring PBR (using a PBR policy)
Defining a policy
Follow these guidelines when you define a policy:
•
If an ACL match criterion is defined, packets are matched against the ACL rules, whereas the permit
or deny action and the time range of the specified ACL are ignored. If the specified ACL does not
exist, no packet is matched.
•
You can use the
apply ip-address next-hop
or the
apply ip-address default next-hop
command to
configure two next hops in the following ways:
{
Method 1
—Executes the command once. To modify a next hop, execute the command to
configure a new next hop to replace the second configured next hop. To modify both next hops,
execute the command again to configure two new next hops.
{
Method 2
—Executes the command twice. To modify a next hop, execute the command to
replace the earlier configured next hop. To modify both next hops, execute the command
again to configure two new next hops.
•
If a policy has a node with no
if-match
clause configured, all packets can pass the policy node.
However, an action is taken according to the match mode, and the packets will not go to the next
policy node for a match.
•
If a policy has a node with the
permit
match mode but no
apply
clause configured, all packets
matching all the
if-match
clauses can pass the policy node. However, no action is taken, the packets
will not go to the next policy node for a match, and will be forwarded according to the routing
table.
•
If a policy has a node with no
if-match
or
apply
clauses configured, all packets can pass the policy
node. However, no action is taken; the packets will not go to the next policy node for a match, and
will be forwarded according to the routing table.
To define a policy:
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Create a policy or policy
node and enter PBR
policy node view.
policy-based-route
policy-name
[
deny
|
permit
]
node
node-number
N/A
3.
Define an ACL match
criterion.
if-match acl
acl-number
Optional.
4.
Set an IP precedence
type/value.
apply
ip-precedence
{
type
|
value
}
Optional.