PBR路由策略配置

1、首先要使用动态协议让内网互通。可以用OSPF或者RIP协议。

2、在R1上配置到外网的浮动默认路由和静态路由,主路由走R3.

ip route 0.0.0.0 0.0.0.0 193.1.1.2
ip route 0.0.0.0 0.0.0.0 202.1.1.2 100
ip route 193.1.2.0 255.255.255.0 193.1.1.2
ip route 202.1.2.0 255.255.255.0 202.1.1.2

3、在R1上配置PBR路由策略,要求192.168.0.0/24192.168.1.0/24R3192.168.3.0/24192.168.4.0/24R4

4、配置ACL:

access-list 1 permit 192.168.0.0 0.0.0.255
access-list 1 permit 192.168.1.0 0.0.0.255
access-list 2 permit 192.168.3.0 0.0.0.255
access-list 2 permit 192.168.4.0 0.0.0.255

5、配置route-map

route-map xpl permit 10
 match ip address 1
 set ip next-hop 193.1.1.2

route-map xpl permit 20
 match ip address 2
 set ip next-hop 202.1.1.2

扫描二维码关注公众号,回复: 8375040 查看本文章

6、将路由策略应用到数据流入的接口,内网口。

interface FastEthernet0/0
 ip address 192.168.5.2 255.255.255.252
 ip policy route-map xpl

interface FastEthernet0/1
 ip address 192.168.4.1 255.255.255.0
 ip policy route-map xpl
7、注意:要在R1上配置默认路由重分发,这样内网才知道到外网的路径。还要在外网上配置静态路由,这样内网的数据流才会回来。

猜你喜欢

转载自www.cnblogs.com/xpl520/p/12124500.html