1.配置IP地址和环回
[r1]int lo0
[r1-LoopBack0]ip add 1.1.1.1 24
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 14.1.1.1 24
[r2]int lo0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 24.1.1.1 24
[r3]int lo0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 34.1.1.1 24
[r4]int lo0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 14.1.1.2 24
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 24.1.1.2 24
[r4]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 34.1.1.2 24
(查看)
2.进行OSPF和RIP宣告
[r1]rip 1
[r1-rip-1]ver 2
[r1-rip-1]network 14.0.0.0
[r1-rip-1]network 1.0.0.0
[r2]ospf 1 router-id 2.2.2.2
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 24.1.1.1 0.0.0.0
[r2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0
[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0 (进程只在本地有用)
[r3-ospf-1-area-0.0.0.0]network 34.1.1.1 0.0.0.0
[r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[r4]rip 1
[r4-rip-1]ver 2
[r4-rip-1]network 14.0.0.0
[r4]ospf 1
[r4-ospf-1]area 0
[r4-ospf-1-area-0.0.0.0]network 24.1.1.2 0.0.0.0
[r4]ospf 2
[r4-ospf-2]area 0
[r4-ospf-2-area-0.0.0.0]network 34.1.1.2 0.0.0.0
(查看)
3.导入路由(RIP)
(1)重发布动态路由
[r4]rip 1
[r4-rip-1]import-route ospf 1
(定义总度量)
[r4-rip-1]import-route ospf 1 ?
cost Cost of the import route
route-policy Apply the specified route policy to filter route
<cr> Please press ENTER to execute command
[r4-rip-1]import-route ospf 1 cost 2
(2)重发布静态路由
[r4]ip route-static 0.0.0.0 0 LoopBack 0
[r4]ip route-static 99.1.1.0 24 LoopBack 0
[r4]rip 1
[r4-rip-1]import-route static
(3)重发布直连路由
[r4]rip 1
[r4-rip-1]import-route direct cost 6 (重发布直连路由优于其他重发布)
4.导入路由(OSPF)
(1)重发布动态路由
[r4]ospf 1
[r4-ospf-1]import-route rip
[r4-ospf-1]import-route rip cost 2 type 1
(修改种子度量) 修改类型()
(2)重发布静态路由
[r4]ospf 1
[r4-ospf-1]import-route static
[r4-ospf-1]import-route static cost 2 type 1
(3)重发布直连路由
[r4]ospf 1
[r4-ospf-1]import-route direct
[r4-ospf-1]import-route direct cost 2 type 1