In the previous issue of "Route Policy", we mentioned that many people equate route policy with Route-Policy. Although this is not quite accurate, it reflects the importance and universality of Route-Policy. Route-Policy is a relatively complex filter that can not only match certain attributes of route information, but also change the attributes of route information when conditions are met. In this issue, we will introduce Route-Policy in detail, including the composition, matching rules and usage examples of Route-Policy. 1. Route-Policy componentsAs shown in Figure 1, Route-Policy consists of four parts: node number, matching pattern, if-match clause (conditional statement) and apply clause (execution statement). Figure 1 Route-Policy components (1) Node number A Route-Policy can consist of multiple nodes. Routes matching Route-Policy follow the following two rules:
(2) Matching pattern There are two node matching modes: permit and deny.
Note: Usually, a permit mode Route-Policy without if-match clause and apply clause is set after multiple deny nodes to allow all other routes to pass. (3) if-match clause (conditional statement) The if-match clause is used to define some matching conditions. Each node of Route-Policy can contain multiple if-match clauses or no if-match clauses. If a permit node is not configured with any if-match clause, the node matches all routes. (4) Apply clause (execution statement) The apply clause is used to specify an action. When a route is filtered by Route-Policy, the system sets some attributes of the route information according to the action specified by the apply clause. Each node of Route-Policy can contain multiple apply clauses or no apply clause. If you only need to filter routes and do not need to set route attributes, do not use the apply clause. 2. Routing policy matching resultsI believe that when you use or learn Route-Policy, you will focus on the following question: for a route, after using Route-Policy, will the final result be to allow or deny this route? This final result has a great impact on the business, and may directly affect whether a certain business is available or not. This involves the issue of Route-Policy matching rules, which we will discuss in detail here. The filtering result of each node of Route-Policy should be based on the following two points:
For each node, the combination of the above two points will result in the four situations shown in Table 1. Table 1 Route-Policy matching rules Note 1: Rule indicates whether the matching mode contained in the if-match clause is permit or deny. Note 2: Mode indicates whether the matching mode corresponding to the node in Route-Policy is permit or deny. Among the above four combinations, the first two are easier to understand and more commonly used. The last two are a little harder to understand. Here we take the third case as an example to illustrate: Assume that the match condition contained in the if-match clause is deny, and the match condition corresponding to the node is permit. The configuration is as follows: # In this case, a key point is that at node 10, the route 172.16.16.0 is rejected, and the route will continue to match downwards. Maybe the next node will allow it to pass? Sure enough, when it continues to go down to node 20, 172.16.16.0 is allowed again, so the final matching result of Route-Policy is to allow the route 172.16.16.0. Note: If more than one node is defined in Route-Policy, it should be ensured that at least one of the nodes has a matching mode of permit. This is because Route-Policy is used for routing information filtering:
3. Routing policy use casesIn the above two sections, we have introduced the composition and matching rules of Route-Policy. In this section, we will look at an example of using Route-Policy. Figure 2 Example of using Route-Policy to implement data diversion (1) User needs As shown in Figure 2, a campus network is mainly divided into production network segment and office network segment. When the terminal connected to LSW3 accesses the following network segment, the traffic model is as follows:
This traffic model can ensure the separation of traffic between the production network and the office network, which is convenient for maintenance and fault location. At the same time, this traffic model is conducive to the balanced distribution of traffic to the two links, and at the same time, they serve as backup links for each other, which is conducive to the stability of the network. (2) Configuration process
Here we only provide the key configurations related to routing policies: LSW1 key configuration: # LSW2 key configuration: # () Result verification After completing the above configuration, you can view the IP routing table on LSW3 to confirm whether the traffic model is correct. < LSW3 > display ip routing - table From the routing table of LSW3, we can see that traffic to the production network segment 10.10.1.0/24 preferentially goes through LSW1, traffic to the office network segment 10.10.2.0/24 preferentially goes through LSW2, and traffic to other network segments is load-balanced on the two links LSW1 and LSW2. The traffic model is in line with expectations. Through this topic, we have basically explained the composition structure and matching rules of Route-Policy, and also let everyone understand the usage scenarios and configuration methods of Route-Policy through an example. In this topic, we mainly used ACL to "capture" the required routes. In fact, the address prefix list (ip ip-prefix) will be more accurate in "capturing" routes. We will introduce this in detail in the next issue of the route policy topic. |
<<: Six popular network topology types
>>: The future of wide area networks (WANs) is wireless
According to data from the China Academy of Infor...
China Unicom recently released its financial resu...
[[350048]] This article is reprinted from the WeC...
HostXen sent the latest information, the platform...
1. Introduction to dynamic routing 1. Dynamic rou...
What is a WAF? The full name of WAF is (Web Appli...
The first large-scale IPv6 transformation was in ...
[51CTO.com original article] On December 1st and ...
[51CTO.com original article] In 2017, the names o...
Over the past 100 years, human beings have develo...
[[350699]] This article is reprinted from the WeC...
Recently, China's AI market has undergone tre...
WiFi is not only irreplaceable in our daily lives...
When it comes to 5G, many people's impression...
AkkoCloud is a Chinese hosting company founded in...