拓扑

步骤
普通PBR
- 在R2 上创建1个 PBR,可以看到,
- PBR其实是个形式,本质是 ACL + Route-map
- 另外这里的下一跳,指的是数据路径,和之前在BGP里学到的路由路径的下一跳反向是相反的
ip access-list extended ACL_PBR
permit ip host 192.168.1.1 host 192.168.5.5
!
route-map RM_PBR permit 10
match ip address ACL_PBR
set ip next-hop 10.23.1.3
!
interface GigabitEthernet0/0
ip address 10.12.1.2 255.255.255.0
ip policy route-map RM_PBR
- 在R1上可以看到加载PBR前后,到192.168.5.5 的路径差异

Local PBR
- 在R2 上观察Traceroute 到192.168.5.5 的路径

- 在R2上配置 Local PBR,还是 ACL + Route-map,只不过不是加载到接口,而是全局
ip access-list extended ACL_LOCAL_PBR
permit ip host 10.12.1.2 host 192.168.5.5
!
route-map RM_LOCAL_PBR permit 10
match ip address ACL_LOCAL_PBR
set ip next-hop 10.23.1.3
!
ip local policy route-map RM_LOCAL_PBR
- 此时可以看到 Traceroute 到 192.168.5.5 的路径发生了变化。同时可以看到,即使配置了PBR,路由表里显示的下一跳地址,仍然是通过路由协议学到的** !!!!!!!!!!**
