acl number 3000 //创建acl设置源地址192.168.0.6
rule 5 permit ip source 192.168.0.6
policy-based-route zyy permit node 10 //创建名称为zyy的策略,节点10
if-match acl 3000 //绑定acl 3000
apply next-hop 192.16.10.2 //指向下一跳地址
interface Vlan-interface1 //三层接口或物理接口添加路由策略
ip address 192.168.0.254 255.255.255.0
ip policy-based-route zyy
如果对于源地址为192.168.0.6,目的地址有限制的,需要在额外增加目的地址限制
acl number 3000
rule 5 permit ip source 192.168.0.6 0
acl number 3001 //acl目的地址为10.0.0.0段
rule 5 permit ip destination 10.0.0.0 0.255.255.255
policy-based-route zyy permit node 5 //创建zyy路由策略,节点5
if-match acl 3001 //绑定acl 3001
policy-based-route zyy permit node 10
if-match acl 3000
apply ip-address next-hop 192.168.2.1
interface Vlan-interface1
ip address 192.168.0.254 255.255.255.0
ip policy-based-route zyy