R1通过R2来主访问R4的10.0.1.0/32和10.0.3.0/32网段,而R1通过R3来主访问R4的10.0.2.0/32和10.0.4.0/32网段
简易图:
R1:
un ter mo
sys
sys R1
int g0/0/0
ip add 192.168.12.1 24
int g0/0/1
ip add 192.168.13.1 24
int g0/0/2
ip add 192.168.15.1 24
int loo0
ip add 1.1.1.1 32
q
ospf router-id 1.1.1.1
area 0
net 192.168.0.0 0.0.255.255
q
R2:
un ter mo
sys
sys R2
int g0/0/0
ip add 192.168.12.2 24
int g0/0/01
ip add 192.168.24.2 24
int loo0
ip add 2.2.2.2 32
q
ospf router-id 2.2.2.2
area 0
net 192.168.0.0 0.0.255.255
q
R3:
un ter mo
sys
sys R3
int g0/0/0
ip add 192.168.34.3 24
int g0/0/01
ip add 192.168.13.3 24
int loo0
ip add 3.3.3.3 32
q
ospf router-id 3.3.3.3
area 0
net 192.168.0.0 0.0.255.255
q
R4:
un ter mo
sys
sys R4
int g0/0/0
ip add 192.168.34.4 24
int g0/0/01
ip add 192.168.24.4 24
int loo0
ip add 4.4.4.4 32
int loo1
ip add 10.0.1.1 32
int loo2
ip add 10.0.2.1 32
int loo3
ip add 10.0.3.1 32
int loo4
ip add 10.0.4.1 32
q
ospf router-id 4.4.4.4
area 0
net 192.168.0.0 0.0.255.255
net 10.0.1.0 0.0.0.255
net 10.0.2.0 0.0.0.255
net 10.0.3.0 0.0.0.255
net 10.0.4.0 0.0.0.255
q
R5:
un ter mo
sys
sys R5
int g0/0/2
ip add 192.168.15.5 24
int loo0
ip add 5.5.5.5 32
int loo1
ip add 10.0.11.1 32
q
ospf router-id 5.5.5.5
area 0
net 192.168.0.0 0.0.255.255
net 10.0.11.1 0.0.0.0
q
查看 R1、R4 路由是否已通
去往10.0.1-4.0/32的下一跳
R1:
acl 3000
rule 5 permit ip source 10.0.11.1 0 destination 10.0.0.0 0.0.254.255
acl 3001
rule permit ip source 10.0.11.1 0 de 10.0.1.0 0.0.254.255
policy-based-route G permit node 1
if-match acl 3000
apply ip-address next-hop 192.168.12.2
policy-based-route G permit node 2
if-match acl 3001
apply ip-address next-hop 192.168.13.3
int g0/0/02
ip policy-based-route G
没改变之前的选路
改变后的选路