一、拓扑图如下

 

 二、进行配置(策略路由走下)

 

 

R3

#
acl number 2000
rule 5 permit source 3.3.3.0 0.0.0.255
rule 10 permit source 35.1.1.0 0.0.0.255
#

 

 

 

 

 

 

 

 

#
traffic behavior 1
redirect ip-nexthop 23.1.1.1
#

 

 

 

#
interface GigabitEthernet0/0/0
ip address 23.1.1.2 255.255.255.0
traffic-policy test outbound
#

 

 

 

#
interface GigabitEthernet0/0/2
ip address 35.1.1.1 255.255.255.0

 

 

 

 

 

#
ospf 1 router-id 3.3.3.3
area 0.0.0.0

network 35.1.1.0 0.0.0.255 

 

 R5

 

#
interface GigabitEthernet0/0/0
ip address 35.1.1.2 255.255.255.0
#

 

 

#
ospf 1
area 0.0.0.0
network 35.1.1.0 0.0.0.255
#

 

 dis ospf peer

 

tracert -a 35.1.1.2 1.1.1.1

 

 

 R3

 

 

#
interface GigabitEthernet0/0/0
ip address 23.1.1.2 255.255.255.0

undo traffic-policy test inbound

undo traffic-policy test outbound

#
interface GigabitEthernet0/0/2
ip address 35.1.1.1 255.255.255.0
traffic-policy test inbound
#

 

 R3

dis traffic-policy test

dis traffic-profile all

 

#
acl number 2000
rule 5 permit source 3.3.3.0 0.0.0.255
rule 10 permit source 35.1.1.0 0.0.0.255
#

 

 

interface g0/0/2

undo traffic test inbound

traffic-policy test

dis traffic policy user-defined