Documente Academic
Documente Profesional
Documente Cultură
Table of Contents
Table of Contents
Chapter 1 IP Unicast Policy Routing Configuration .................................................................. 1-1 1.1 Introduction to IP Unicast Policy Routing .......................................................................... 1-1 1.1.1 Policy Routing ......................................................................................................... 1-1 1.1.2 Policy Routing and Track ........................................................................................ 1-1 1.2 Configuring IP Unicast Policy Routing ............................................................................... 1-2 1.2.1 Defining a Policy...................................................................................................... 1-2 1.2.2 Enabling Local Policy Routing................................................................................. 1-4 1.2.3 Enabling Interface Policy Routing ........................................................................... 1-4 1.3 Displaying and Maintaining IP Unicast Policy Routing Configuration................................ 1-4 1.4 IP Unicast Policy Routing Configuration Examples ........................................................... 1-5 1.4.1 Configuring Policy Routing Based on Packet Size ................................................. 1-5
1-1
1-2
You can associate policy routing with a Track object when configuring a next hop, or default next hop, so as to determine the availability of the next hop dynamically. After you configure a Track object association in an apply clause, when an event occurs: If the status of the Track object is Positive, the apply clause can forward packets. If the status of the Track object is Negative or Invalid, the apply clause cannot forward packets. Follow these steps to define a policy: To do Enter system view Create a policy or policy node and enter policy node view Define a packet length match criterion Define an ACL match criterion Set an IP precedence type/value Use the command system-view policy-based-route policy-name [ deny | permit ] node node-number if-match packet-length min-len max-len if-match acl acl-number apply ip-precedence { type | value} apply ip-address next-hop ip-address [ track track-entry-number ] [ ip-address [ track track-entry-number ] ] apply ip-address default next-hop ip-address [ track track-entry-number ] [ ip-address [ track track-entry-number ] ] Remarks
Required
Optional Optional Optional Optional Two next hops at most can be specified. These two next hops are simultaneously active to achieve load sharing. Optional Two default next hops at most can be specified. These two next hops are simultaneously active to achieve load sharing.
Note: You can use the apply ip-address next-hop command to configure two next hops. After that, you can specify a new next hop to overwrite the earlier configured next hop. If you want to modify the two next hops, you can directly specify two next hops using the apply ip-address next-hop command.
1-3
1-4
To do Display the statistics of policy routing Display the information of policy routing based on a specified policy Clear the statistics of policy routing based on a specified policy
Use the command display ip policy-based-route statistics { interface interface-type interface-number | local } display policy-based-route [ policy-name ] reset policy-based-route statistics [ policy-name ]
Remarks
Figure 1-1 Network diagram for policy routing based on packet size
1-5
# Forward IP packets with a size of 64 to 100 bytes to the next hop 150.1.1.2 and those with a size of 101 to 1,000 bytes to the next hop 151.1.1.2.
[SecPathA] interface gigabitethernet 0/0 [SecPathA-GigabitEthernet0/0] ip address 150.1.1.1 255.255.255.0 [SecPathA-GigabitEthernet0/0] quit [SecPathA] interface gigabitethernet 0/1 [SecPathA-GigabitEthernet0/1] ip address 151.1.1.1 255.255.255.0 [SecPathA- GigabitEthernet0/1] quit [SecPathA] policy-based-route lab1 permit node 10 [SecPathA-pbr-lab1-10] if-match packet-length 64 100 [SecPathA-pbr-lab1-10] apply ip-address next-hop 150.1.1.2 [SecPathA-pbr-lab1-10] quit [SecPathA] policy-based-route lab1 permit node 20 [SecPathA-pbr-lab1-20] if-match packet-length 101 1000 [SecPathA-pbr-lab1-20] apply ip-address next-hop 151.1.1.2
1-6