In the maintenance of network equipment, now a lot of maintenance information on the "Routing strategy" and "Policy Routing" these two nouns, but there are many maintenance technicians to these two nouns understand is not very thorough, can not accurately grasp the relationship between the two and the difference. This paper briefly analyzes the concepts between the two, and introduces some examples, hoping that we can get a deeper understanding from the case.
First, routing strategy
Routing policies, which are routes for publishing and receiving. In fact, the choice of routing protocol itself is also a routing strategy, because the same network structure, different routing protocols because of the implementation of different mechanisms, costing rules different, priority definition, etc. may produce different routing table, these are the most basic. Typically, the routing strategy that we refer to is on top of the normal routing protocols, we change the results of routing, distribution, and selection by some sort of rule, by changing certain parameters or by setting some kind of control, noting that the changes are the result (that is, the routing table), the rules are not changed, but the rules are applied.
Here are some examples to illustrate.
Examples of changing parameters: for example, a router and B routers are De Chinglu (respectively AB1 and AB2) and the same bandwidth, running the OSPF routing protocol, but the stability of the two links is not the same, the company would like to set AB1 as the main Power road, The standby circuit (AB2) is used when the main electric road (AB1) fails. If take the default setting, then two circuit is load balanced, then can take separately set AB1 and AB2 circuit cost (overhead) value, will AB1 circuit cost value to small or AB2 circuit cost value set large , OSPF will produce two expensive routes, cost (overhead) the more path from the cost lower, so the higher the priority, routers will give priority to the use of AB1 circuit. can also not change the cost value, and the two circuit bandwidth (bandwidth) set to inconsistent, the AB1 bandwidth set larger than the AB2, according to the OSPF Route generation and discovery rules, AB1 costs will be lower than the AB2, routers will also give priority to the use of AB1 circuit.
Examples of changing control methods, the basic approach is to use the routing policy to perform some operations on routes that conform to a few rules, such as denial (Deny) and allow (Permit), and then adjust some of these routes on an allowable basis, such as cost values, etc. Commonly used policies include ACLs (acess control List access controls lists), Ip-prefix, As-path, Route-policy, and so on. Most of the routing strategies are used in conjunction with the BGP protocol, which belongs to the principle of routing reception and notification.
For example, AS1 does not publish 19.1.1.1/32 this segment to AS2, you can set an ACL list and set it on RTB (for example, Huawei's router):
[rtb]acl number 1 Match-order auto
[rtb-acl-basic-1]rule deny source 19.1.1.1 0
[Rtb-acl-basic-1]rule Permit Source any
[RTB]BGP 1
[Rtb-bgp]peer 2.2.2.2 As-number 2
[RTB-BGP] Import-route OSPF
[RTB-BGP] Peer 2.2.2.2 filter-policy 1 export
If B publishes this route to C, but C does not want to receive this route, C can set:
[rtc]acl number 1 Match-order auto
[rtc-acl-basic-1]rule deny source 19.1.1.1 0
[Rtc-acl-basic-1]rule Permit Source any
[RTC]BGP 2
[Rtc-bgp]peer 2.2.2.1 As-number 1
[RTC-BGP] Peer 2.2.2.1 filter-policy 1 Import
Another example of a ip-prefix:
For example, RTB does not publish routes 19.1.1.0/24 this segment to the RTC, you can set the
[Rtb]ip ip-prefix Test index deny 19.1.1.0 24
[Rtb]ip ip-prefix Test Index permit any
[RTB]BGP 1
[Rtb-bgp]peer 2.2.2.2 As-number 2
[RTB-BGP] Import-route OSPF
[RTB-BGP] Import-route Direct
[Rtb-bgp]peer 2.2.2.2 Ip-prefix Test Export
Ip-prefix is an exact match, and if you want to implement a fuzzy match, you can do this by following the parameters less-equal or greater-equal, such as IP ip-prefix Test index deny 19.1.1.0 24 Less-equal 31 means that it can match from 19.1.1.0/24, 19.1.1.0/25, 19.1.1.0/26 to 19.1.1.0/31, otherwise this only means that the matching destination network is the 19.1.1.0/24 route, And 19.1.1.0/25 does not meet this condition, specific can refer to the command manual, here do not explain in detail.
It's all about routing and banning, and here's a more flexible route policy setting: The matching of If-match and apply in Route-policy, where you can not only set the allowed or forbidden routes, but also set their properties on the allowed routes.