在RouterA RouterB RouterC使用OSPF保證全網(wǎng)可達(dá),并且在RouterA上查看路由表發(fā)現(xiàn)到10.10.10.0的下一跳為RouterC的GE1/0/0接口地址。
要求:使10.0.2.0/24到10.0.0.0/24的流量走RouterB
方法:在RouterA上應(yīng)用策略路由,是10.0.2.0/24到10.0.0.0/24的流量重定向到RouterB上
拓?fù)洌?/strong>

基本配置
RouterA:
int g1/0/0
ip add 10.181.20.1 255.255.255.0
int g2/0/0
ip add 10.181.10.1 255.255.255.0
int g3/0/0
ip add 10.0.2.1 255.255.255.0
RouterB:
int g1/0/0
ip add 10.181.10.2 255.255.255.0
int g2/0/0
ip add 10.184.10.1 255.255.255.0
RouterC
int g1/0/0
ip add 10.181.20.2 255.255.255.0
int g2/0/0
ip add 10.184.10.2 255.255.255.0
int g3/0/0
ip add 10.0.0.1 255.255.255.0
配置OSPF協(xié)議
RouterA:
ospf 1
area 0
network 10.0.2.0 0.0.0.255
network 10.181.20.0 0.0.0.255
network 10.181.10.0 0.0.0.255
RouterB:
ospf 1
area 0
network 10.181.10.0 0.0.0.255
network 10.184.10.0 0.0.0.255
RouterC:
ospf 1
area 0
network 10.184.10.0 0.0.0.255
network 10.181.20.0 0.0.0.255
network 10.0.0.0 0.0.0.255
配置策略路由
定義ACL匹配目的源地址
acl number 3001
rule 5 permit ip source 10.0.2.0 0.0.0.255 destination 10.0.0.0 0.0.0.255
定義需要重定向的數(shù)據(jù)流分類(lèi)
traffic classifier rdt operator or
if-match acl 3001
定義流量行為重定向到RouterB的G1/0/0的接口地址
traffic behavior rdt
綁定流策略
traffic policy rdt
classifier rdt behavior rdt
最后驗(yàn)證配置。
在10.0.2.0/24網(wǎng)段的主機(jī)上執(zhí)行tracert,檢測(cè)路徑