GNS3中實驗拓補圖:
redis
實驗內容:bash
R2和R3屬於AREA1,R3和R4屬於AREA0都是OSPF路由協議,R4和R5之間是RIP路由協議,R6屬於一個電信運營商,實現全網的互聯互通app
實驗步驟:ide
一、根據實驗拓撲圖的端口環境配置端口地址,及路由協議測試
a、R1spa
R1#conf t 進入全局模式 R1(config)#int f0/0 進入接口F0/0 R1(config-if)#ip add 192.168.10.1 255.255.255.0 配置IP地址 R1(config-if)#no shut 啓動接口 R1(config-if)#int f0/1 進入接口0/1 R1(config-if)#ip add 192.168.20.1 255.255.255.0 配置IP地址 R1(config-if)#no shut 開啓 R1(config-if)#ex 退出接口模式 R1( config)#ip route 0.0.0.0 0.0.0.0 192.168.20.2 將R1配置爲默認路由
b、R23d
Rt#conft 進入全局模式 R2(config)#intf0/1 設置接口f0/1 R2(config- if)#ip add 192 168.20.2 255.255 255.0 R2(config- if)#no shut 開啓 R2(config- if)#int f0/0 設置接口f0/0 R2(config- if)#ip add 192 168.30.1 255.255 255.0 R2(config- if)#no shut 開啓 R2(config-if)#ex 退出接口模式 R2(config)#ip route 192.168.10.0 255 255.255.0192.168.20.1 設置R2爲靜態路由 R2(config)#router ospf 1 啓動ospf進程 1 R2(config-router)#router-id 2.2.2.2 設置路由id R2(config-router)#network 192 16830.0 0.0.0.255 area 1 宣告30網段在area1中 R2(config-router) #redistribute connected subnets 將直連的20網段宣告 R2(config-router) #redistribute static subnets 宣告默認路由10段 R2(config- router)#ex
c、R3orm
R3#conft 進入全局模式 R3(config)#int f0/0 設置接口f0/0 R3(config-if)#ip add 192.168.30.2 255 255 255.0 配置IP地址 R3(config-if)#no shut 開啓 R3(config-if)#int f0/1 設置接口f0/1 R3(config-if)ip add 192.168 40.1255.255 255.0 配置IP地址 R3(config-if)#no shut 開啓 R3(config-if)#int1/0 設置接口f1/0 R3(config-if)ip add 12.0.0.1 255 255.255.0 配置IP地址 R3(config-if)#no shut 開啓 R3(config-if)#intf2/0 設置接口f2/0 R3(config-if)# ip add 192.168.70.1 255255 255.0 配置IP地址 R3(config-if)#no shut 開啓 R3(config-if)#ex R3(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2 將R3配置爲默認路由 R3(config)#router ospf 1 開啓ospf進程1 R3(config-router) #router-id 3.3.33 設置路由id R3(config-router) #network 192.168.30.0 0.0.0.255 area 1 宣告30網段在area1中 R3(config-router) #network 192.168 40.0 0.0.0.255 area 0 宣告40,70網段在area0中 R3(config-router) #network 192.168.70.0 0.0.0.255 area 0 R3(config-router) #default-information originate 注入外部默認路由 R3(config- router)#ex R3(config)#do show ip route查看路由表
d、R4router
Rt4#conf t 進入全局模式 R4(config)#int f0/0 配置接口f0/0 R4(config- if)#ip add 192 168 40.2 255 255.255.0 R4(config- if)#no shut 開啓 R4(config- if)#int f0/1 配置接口f0/1 R4(config- if)#ip add 192 168. 50.1255 255.255.0 R4(config- if)#no shut 開啓 R4(config)#router rip 進入rip協議 R4(config router)#ver2 版本2 R4(config - router )#no auto-summary 關閉路由彙總 R4(config router #network 192.168.50.0 宣告50網段 R4(config - router #redistribute ospf 1 metric 5 在rip中注入ospf R4(config router)#router ospf 1 開啓ospf進程1 R4(config router)#router-id 4.4.4.4 設置路由id R4(config router #network 192.168 40.0 0.0.0.255 area 0 告40網段在area0中 R4(config - router #redistribute rip subnets 在ospf中注入rip R4(config - router)#ex R4(config)#do show ip route查看路由信息
e、R5blog
Rrs#conft 進入全局模式 R5(config)#int f0/0 配置接口f0/0 R5(config- if)ip add 192.168 50.2255.255.255.0 R5(config - if)#no shut R5(config- if)#int f0/1 配置接口f0/1 R5(config- if)ip add 192.168.60.1 255 255 255.0 R5(config - if #no shut R5(config - if)#ex R5(config)#router rip 進入rip協議 R5(config router)#ver 2 版本2 R5(config-router )#no auto summary 關閉路由彙總 R5(config router )#network 192.168.50.0 宣告50, 60網段 R5(config router )#network 192.168.60.0
f、 R6
R6#conf t進入全局模式 R6(config)#int f0/0配置接口f0/0 R6(config-if)#ip add 12.0.0.2 255 255255.0 R6(config-if)#no shut R6(config-if)#int f0/1配置接口f0/1 R6(configif)#ip add 13.0.0.1 255.255 255.0 R6(config-if)#no shut R6(config)#ip route 192.168.0.0 255 255.0.0 12.0.0.1 設置靜態路由
二、配置pc機IP地址和網關
a、pc1
ip 192.168.10.2 192.168.10.1 配置pc1IP地址
b、pc2
ip 192.168.70.2 192.168.70.1 配置pc2IP地址
c、pc3
ip 13.0.0.13 13.0.0.1 配置pc3IP地址
d、pc4
ip 192.168.160.2 192.168.60.1 配置pc4IP地址
三、測試全網的互聯互通
搭建ospf協議與rip協議綜合實驗成功。