首先配置所有路由器的端口地址以及loopback地址
R1
ip route-static 0.0.0.0 0 192.168.10.2
R2
[R2]ospf
[R2-ospf-1]a 1
[R2-ospf-1-area-0.0.0.1]net 192.168.20.0 0.0.0.255
[R2-ospf-1-area-0.0.0.1]net 2.2.2.2 0.0.0.0
[R2-ospf-1-area-0.0.0.1]q
[R2-ospf-1]import-route static
[R2-ospf-1]import-route direct
[R2-ospf-1]q
[R2]ip route-static 1.1.1.1 32 192.168.10.1
R3
[R3]ospf
[R3-ospf-1]a 1
[R3-ospf-1-area-0.0.0.1]net 192.168.20.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]q
[R3-ospf-1]a 0
[R3-ospf-1-area-0.0.0.0]net 192.168.30.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]net 3.3.3.3 0.0.0.0
[R3-ospf-1-area-0.0.0.0]q
[R3-ospf-1]import-route direct
[R3-ospf-1]default-route-advertise always
[R3-ospf-1]q
[R3]ip route-static 0.0.0.0 0 192.168.40.5
R4
[R4]rip
[R4-rip-1]v 2
[R4-rip-1]un su
[R4-rip-1]net 192.168.50.0
[R4-rip-1]import-route ospf 1 cost 3
[R4-rip-1]ospf
[R4-ospf-1]import-route rip 1 type 1 cost 1
[R4-ospf-1]q
[R4]ospf
[R4-ospf-1]import-route direct
[R4-ospf-1]q
[R4]ospf
[R4-ospf-1]a 0
[R4-ospf-1-area-0.0.0.0]
[R4-ospf-1-area-0.0.0.0]net 192.168.30.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]net 4.4.4.4 0.0.0.0
[R4-ospf-1-area-0.0.0.0]q
[R4-ospf-1]q
[R4]rip
[R4-rip-1]default-route originate
[R4-rip-1]q
R5
[R5]ip route-static 0.0.0.0 0 192.168.40.3
R6
[R6]rip
[R6-rip-1]v 2
[R6-rip-1]un su
[R6-rip-1]net 192.168.50.0
[R6-rip-1]net 6.0.0.0
[R6-rip-1]q