1.配置各路由接口以及环回的IP
R1
[R1]int s4/0/0
[R1-Serial4/0/0]ip address 12.1.1.1 24
[R1-Serial4/0/0]int l0
[R1-LoopBack0]ip address 1.1.1.1 24
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 14.1.1.1 24
R2
[R2]int l0
[R2-LoopBack0]ip address 2.2.2.2 24
[R2-LoopBack0]int s4/0/0
[R2-Serial4/0/0]ip address 12.1.1.2 24
[R2-Serial4/0/0]int s4/0/1
[R2-Serial4/0/1]ip address 23.1.1.2 24
R3
[R3]int l0
[R3-LoopBack0]ip address 3.3.3.3 24
[R3-LoopBack0]int s4/0/0
[R3-Serial4/0/0]ip address 23.1.1.3 24
[R3-Serial4/0/0]int s4/0/1
[R3-Serial4/0/1]ip address 34.1.1.3 24
R4
[R4]int l0
[R4-LoopBack0]ip address 4.4.4.4 24
[R4-LoopBack0]int g0/0/01
[R4-GigabitEthernet0/0/1]ip address 14.1.1.4 24
[R4-GigabitEthernet0/0/1]int s4/0/0
[R4-Serial4/0/0]ip address 34.1.1.4 24
2.给蓝色区域起RIP协议,橙色区域起OSPF协议
R1
[R1] rip 1
[R1-rip-1]version 2
[R1-rip-1]network 12.0.0.0
[R1-rip-1]net 1.0.0.0
[R1-rip-1]net 14.0.0.0
[R1-rip-1]net 172.16.0.0
R2
[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 12.0.0.0
[R2-rip-1]network 2.0.0.0
[R2]ospf 1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
R3
[R3]ospf 1
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 23.1.1.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 3.3.3.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
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 4.4.4.0 0.0.0.255
3.多点双向重发布
R2
[R2]rip 1
[R2-rip-1]import-route ospf 1
[R2-rip-1]q
[R2]ospf 1
[R2-ospf-1]import-route rip 1
R4
[R4]ospf 1
[R4-ospf-1]import-route rip1
[R4-ospf-1]q
[R4]rip 1
[R4-rip-1]import-route ospf 1
R4
[R4-LoopBack0]ospf network-type broadcast
R2
[R2]ip ip-prefix 1 permit 172.16.1.0 24
[R2]ip ip-prefix 2 permit 172.16.2.0 24
[R2]ip ip-prefix 3 permit 172.16.3.0 24
[R2]ip ip-prefix 4 permit 172.16.4.0 24
起路由策略
[R2]route-policy 1 deny node 10
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 1
[R2-route-policy]q
[R2]route-policy 1 permit node 20
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 2
[R2-route-policy]apply cost-type type-1
[R2-route-policy]q
[R2]route-policy 1 permit node 30
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 3
[R2-route-policy]apply cost 6
[R2-route-policy]q
[R2]route-policy 1 permit node 40
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 4
[R2-route-policy]apply cost 9
[R2-route-policy]apply cost-type type-1
[R2-route-policy]q
[R2]route-policy 1 permit node 50
Info: New Sequence of this List.
[R2-route-policy]q
[R2]ospf 1
[R2-ospf-1]import-route rip 1 route-policy 1
R4
[R4]ip ip-prefix 1 permit 172.16.1.0 24
[R4]ip ip-prefix 2 permit 172.16.2.0 24
[R4]ip ip-prefix 3 permit 172.16.3.0 24
[R4]ip ip-prefix 4 permit 172.16.4.0 24
[R4]route-policy 1 deny node 10
Info: New Sequence of this List.
[R4-route-policy] if-match ip-prefix 1
[R4-route-policy]route-policy 1 permit node 20
Info: New Sequence of this List.
[R4-route-policy] if-match ip-prefix 2
[R4-route-policy] apply cost-type type-1
[R4-route-policy]route-policy 1 permit node 30
Info: New Sequence of this List.
[R4-route-policy] if-match ip-prefix 3
[R4-route-policy] apply cost 6
[R4-route-policy]route-policy 1 permit node 40
Info: New Sequence of this List.
[R4-route-policy] if-match ip-prefix 4
[R4-route-policy] apply cost 9
[R4-route-policy] apply cost-type type-1
[R4-route-policy]route-policy 1 permit node 50
Info: New Sequence of this List.
[R4]ospf 1
[R4-ospf-1]import-route rip 1 route-policy 1
[R2]route-policy 1 permit node 15
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix xx
[R2-route-policy]apply cost-type type-1
[R2-route-policy]q
[R2]os
[R2]ospf 1
[R2-ospf-1]import-route rip 1 route-policy 1
[R2]ip ip-prefix xx permit 12.1.1.0 24
[R2]route-policy 1 permit node 25
Info: New Sequence of this List.
[R2-route-policy]if-match ip-prefix 12
[R2-route-policy]apply cost-type type-1
R4
[R4]route-policy 1 permit node 15
Info: New Sequence of this List.
[R4-route-policy]if-match ip-prefix 14
[R4-route-policy]apply cost-type type-1
R1
[R1]ip ip-prefix 4 permit 4.4.4.0 24
[R1]int s4/0/0
[R1-Serial4/0/0]rip metricin ip-prefix 4 2
[R1]ip ip-prefix 23 permit 23.1.1.0 24
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]rip metricin ip-prefix 23 2
[R1]ip ip-prefix 34 permit 34.1.1.0 24
[R1]int s4/0/0
[R1-Serial4/0/0]rip metricin ip-prefix 34 2