Routing policy is a policy that controls routes using a series of tools or methods. This type of policy will affect route generation, advertisement, and selection and so affect the packet forwarding path. These tools include ACL, route-policy, ip-prefix, and filter-policy, and these methods include filtering routes and setting attributes for routes.
On an IP network, routing policy is mainly used to filter routing information and modify route attributes. Table 1 describes its functions.
Function |
Execution Process |
Result |
---|---|---|
Filter routing information. |
If a route meets a specific condition, it is accepted. If a route meets a specific condition, it is advertised. If a route meets a specific condition, it is imported. |
This route is processed as required. |
Modify route attributes. |
If a route meets a specific condition, a certain attribute value of this route is changed to a specified value. |
A certain attribute value of this route is changed to a specified value. |
Using routing policy to filter routing information
In Figure 1, SwitchA is dual-homed to SwitchB and SwitchC and will receive routes from both SwitchB and SwitchC. If SwitchA wants to receive routes only from SwitchB but not from SwitchC, configure routing policy on SwitchA to permit the routes received from SwitchB and deny the routes received from SwitchC.
Using routing policy to modify route attributes
In Figure 2, SwitchA is also dual-homed to SwitchB and SwitchC. Because SwitchB has better link stability and higher bandwidth than SwitchC, links of SwitchB and SwitchC need to function as the primary and backup links respectively. When the primary link fails, traffic is automatically switched to the backup link. To meet this requirement, you can use routing policy to set a lower route cost on SwitchB and set a higher route cost on SwitchC. Subsequently, traffic is automatically transmitted over the primary link of SwitchB, and the link of SwitchC functions as the backup link for route backup.