双点双向重发布实验

第一步配置IP地址

R1:

[R1]int Serial 4/0/0
[R1-Serial4/0/0]ip address 12.0.0.1 24
[R1-Serial4/0/0]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip address 14.0.0.1 24

[R1-GigabitEthernet0/0/0]int l0
[R1-LoopBack0]ip address 1.1.1.1 24

 R2,R3,R4配置相同

第二步:划分rip和ospf

R1

[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]network 1.0.0.0  
[R1-rip-1]network 12.0.0.0
[R1-rip-1]network 14.0.0.0 

 R2

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 2.0.0.0
[R2-rip-1]network 12.0.0.0
[R2-rip-1]q
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255

R3 

[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 23.0.0.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 3.3.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255

 R4

[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 14.0.0.0
[R4-rip-1]q
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 34.0.0.0 0.0.0.255  
[R4-ospf-1-area-0.0.0.0]network 4.4.4.0 0.0.0.255

 第三步:重发布

R2

[R2]rip 1
[R2-rip-1]import-route ospf 1
[R2-rip-1]ospf 1
[R2-ospf-1]import-route  rip 1

 R4

[R4]rip 1
[R4-rip-1]import-route ospf 1
[R4-rip-1]q
[R4]ospf 1
[R4-ospf-1]import-route  rip 1

第四步:改接口

[R3-LoopBacke]ospf network-type broadcast

[R4-LoopBacke]ospf network-type broadcast

 第五步:写策略

R2

[R2]ip ip-prefix 1 permit 4.4.4.0 24

[R2]route-policy celve permit node 10

[R2-route-policy]apply cost +1

[R2]route-policy celve permit node 20

[R2]ip ip-prefix 1 permit 34.0.0.0 24

[R2]route-policy celve permit node 15

[R2-route-policy]apply cost +10

R4

[R4]ip ip-prefix 1 permit 2.2.2.0 24
[R4]route-policy celve deny node 10
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix 1
[R4-route-policy]q
[R4]route-policy celve permit node 20
Info: New Sequence of this List
[R4-route-policy]q

R4]ospf 1

[R4-ospf-1]import-route rip1 route-policy celve

[R4]ip ip-prefix 1 permit 23.0.0.0 24

[R4]route-policy celve permit node 15

[R4-route-policy]apply cost +10

[R4-ospf-1]import-route rip1 route-policy celve

猜你喜欢

转载自blog.csdn.net/m2282475145/article/details/131965663