25. Policy routing
Policy routing: let the route choose the next hop location according to the defined policy.
The role of policy routing: when the internal network to access the public network, there are two ways, but on the same router, we need to use policy routing to point the way, control the direction of network segment traffic, and specify the direction of traffic.
Cisco Policy routing related commands:
Based on interface:
Command
Description
(config) # route-map ren permit 10
Define a policy
(config-route-map) # match interface f0amp 0
When the traffic coming from interface F0Universe 0
(config-route-map) # set ip next-hop 1.1.1.1
Then the next hop address is specified as
(config-if) # ip policy route-map ren
Use policies for portals
Based on network segment:
Command
Description
(config) # access-list 1 permit 192.168.1.0 0.0.0.255
Create an ACL definition network segment
(config-route-map) # match ip address 1
Call ACL
(config-route-map) # set ip next-hop 1.1.1.1
Then the next hop address is specified as
(config-if) # ip policy route-map ren
Use policies for portals
Huawei H3C policy routing related commands:
Based on ACL:
Command
Description
[huawei] acl 2000
Create and enter ACL
[huawei-acl-basic-2000] rule permit source 192.168.1.0 0.0.0.255
Standard ACL
[huawei] route-policy ren permit node 10
Create a policy route
[huawei-route-policy] if-match acl 2000
Call ACL
[huawei-route-policy] apply ip-address next-hop 1.1.1.1
Then the next hop address is specified as
[huawei] ip local policy-based-route ren
Apply local policy
[huawei] dispaly route-policy
View routing policies