@ OSPF 分流实验
OSPF分流实验
实验要求及拓扑图
实验步骤
基本IP配置
R1:
int g0/0/0
ip address 14.1.12.1 24
int g0/0/1
ip address 14.1.13.1 24
int lo1
ip address 10.1.1.1 24
int lo2
ip address 10.2.1.1 24
R2:
int g0/0/0
ip address 14.1.12.2 24
int g0/0/1
ip address 14.1.24.2 24
int lo1
ip address 10.1.2.1 24
int lo2
ip address 10.2.2.1 24
R3:
int g0/0/0
ip address 14.1.34.3 24
int g0/0/1
ip address 14.1.13.3 24
int g0/0/2
ip address 14.0.35.3 24
int g4/0/0
ip address 14.0.36.3 24
R4:
int g0/0/0
ip address 14.1.34.4 24
int g0/0/1
ip address 14.1.24.4 24
int g0/0/2
ip address 14.0.46.4 24
int g4/0/0
ip address 14.0.45.4 24
R5:
int g0/0/0
ip address 14.0.45.5 24
int g0/0/2
ip address 14.0.35.5 24
int lo1
ip address 10.1.5.1 24
int lo2
ip address 10.2.5.1 24
R6:
int g0/0/0
ip address 14.0.36.6 24
int g0/0/0
ip address 14.0.36.6 24
int lo1
ip address 10.1.6.1 24
int lo2
ip address 10.2.6.6 24
OSPF配置
R1:
ospf 1 router-id 1.1.1.1
area 0.0.0.1
network 10.1.1.0 0.0.0.255
network 10.2.1.0 0.0.0.255
network 14.1.0.0 0.0.255.255
R2:
ospf 1 router-id 2.2.2.2
area 0.0.0.1
network 10.1.2.0 0.0.0.255
network 10.2.2.0 0.0.0.255
network 14.1.0.0 0.0.255.255
R3:
ospf 1 router-id 3.3.3.3
area 0.0.0.1
network 14.1.0.0 0.0.255.255
ospf 2 router-id 3.3.3.3
area 0.0.0.0
network 14.0.0.0 0.0.255.255
R4:
ospf 1 router-id 4.4.4.4
area 0.0.0.1
network 14.1.0.0 0.0.255.255
ospf 2 router-id 4.4.4.4
area 0.0.0.0
network 14.0.0.0 0.0.255.255
R5:
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 10.1.5.0 0.0.0.255
network 10.2.5.0 0.0.0.255
network 14.0.0.0 0.0.255.255
R6:
ospf 1 router-id 6.6.6.6
area 0.0.0.0
network 10.1.6.0 0.0.0.255
network 10.2.6.0 0.0.0.255
network 14.0.0.0 0.0.255.255
重发布,控制选路
1.抓取路由
由图可知r3应抓取的是10.2网段即业务路由
指令如下:
[r3]ip ip-prefix a1 permit 10.2.1.0 24
[r3]ip ip-prefix a2 permit 10.2.2.0 24
[r3]ip ip-prefix a3 permit 10.2.5.0 24
[r3]ip ip-prefix a4 permit 10.2.6.0 24
同理,r4配置相同
2.对需要备份的路由将cost值增大,即进行备份
[r3]route-policy 1 permit node 10
[r3-route-policy]if-match ip-prefix a1
[r3-route-policy]apply cost 10
[r3-route-policy]q
[r3]route-policy 1 permit node 20
其余皆为同理配置
进行重发布调用:
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]import-route ospf 2 route-policy 3
[r3-ospf-1]import-route ospf 2 route-policy 4
[r3]ospf 2 router-id 3.3.3.3
[r3-ospf-1]import-route ospf 1 route-policy 1
[r3-ospf-1]import-route ospf 1 route-policy 2