OSPF高级配置实验

OSPF高级配置实验拓扑图 路由器接口IP及区域规划

R1 f0/0:192.168.10.1/24 f0/1:192.168.20.1/24 R2 f0/0:192.168.30.1/24 f0/1:192.168.20.2/24 R3 f0/0:192.168.30.2/24 f0/1:192.168.40.1/24 f1/0:12.0.0.1/24 f2/0:192.168.70.1/24 R4 f0/0:192.168.40.2/24 f0/1:192.168.50.1/24 R6 f0/0:192.168.50.2/24 f0/1:192.168.60.1/24 R6 f0/0:12.0.0.2/24 f0/1:13.0.0.1/24 其中R2的f0/0接口到R3的f0/0属于area0区域 R3f0/1接口到R4的f0/0接口属于area1区域 area0、area1区域都属于ospf协议 R4的f/1接口到R5属于RIP动态路由协议 R6在在这里充当电信运营商

实验规划拓扑图如下:

路由器接口及区域配置

R1接口配置 输入以下内容:

conf t //进入全局模式 (config)int f0/0 //进入f0/0接口 (config-if)ip add 192.168.10.1 255.255.255.0 //配置IP地址 (config-if)no shut //启动配置 ex //退出 (config-if)int f0/1 //进入f010接口 (config-if)ip add 192.168.20.1 255.255.255.0 //配置IP地址 (config-if)no shut //启动配置 (config-if)ex //退出 (config)ip router 0.0.0.0 0.0.0.0 192.168.20.2 //在末梢网络配置默认路由并指向下一条地址 R2接口配置 输入以下内容: conf t //进入全局模式 int f0/1 //进入f0/1接口 ip add 192.168.20.2 255.255.255.0 //配置IP地址 no shut //启动配置 ex //退出 int f0/0 //进入f0/0接口 ip add 192.168.30.1 255.255.255.0 //配置IP地址 no shut //启动配置 ex //退出 router ospf 1 //启用OSPF1进程
router-id 2.2.2.2 //标注route-id 2.2.2.2
network 192.168.30.0 0.0.0.255 area 1 //在area1种宣告30段落网段
ex //退出 ip route 192.168.10.0 255.255.255.0 192.168.20.1 //配置静态路由
router ospf 1 //启用OSPF1进程 redistribute connected subnets //注入直连网段20段落 redistribute static subnets //注入静态网段10段落 ex //退出 R3接口配置 输入以下内容: conf t //进入全局模式 int f0/0 //进入f0/0接口 ip add 192.168.30.2 255.255.255.0 //配置IP地址 no shut //启动配置 int f0/1 //进入f0/1接口 ip add 192.168.40.1 255.255.255.0 //配置IP地址 no shut //启动配置 int f1/0 //进入f1/0接口 ip add 12.0.0.1 255.255.255.0 //配置IP地址 no shut //启动配置 int f2/0 //进入f2/0接口 ip add 192.168.70.1 255.255.255.0 //配置IP地址 no shut //启动配置 do show ip int b //查看接口配置结果 ip route 0.0.0.0 0.0.0.0 12.0.0.2 (//配置默认路由并指向下一跳地址) router ospf 1 (//启用OSPF1进程) router-id 3.3.3.3 (//标注router-id 3.3.3.3) network 192.168.30.0 0.0.0.255 area 1 (//在area1中宣告30段落地址) network 192.168.40.0 0.0.0.255 area 0 (//在area0中宣告40段落地址) network 192.168.70.0 0.0.0.255 area 0 (//在area0中宣告70段落地址) default-information originate (//注入外部默认路由) ex //退出 R4接口配置 输入以下内容: conf t int f0/0 ip add 192.168.40.2 255.255.255.0 no shut int f0/1 ip add 192.168.50.1 255.255.255.0 no shut ex router rip (//配置rip协议) ver 2 no atuo-summary network 192.168.50.0 ex router ip redistribute ospf 1 metric 5 (//在OSPF协议中注入进程号和度量值) ex router ospf 1 (//启动OSPF1进程) router-id 4.4.4.4 (//标注router-id 4.4.4.4) network 192.168.40.0 0.0.0.255 area 0 redistribute rip subnets (//注入rip协议) ex R5接口配置 输入以下内容: conf t int f0/0 ip add 192.168.50.2 255.255.255.0 no shut int f0/1 ip add 192.168.60.1 255.255.255.0 no shut ex (//配置rip协议) router rip ver 2 no antuo-summary network 192.168.50.0 network 192.168.60.0 ex R6接口配置 输入以下内容: conf t int f0/0 ip add 12.0.0.2 255.255.255.0 no shut ex int f0/1 ip add 13.0.0.1 255.255.255.0 no shut ex ip route 192.168.0.0 255.255.255.0 12.0.0.1 (//配置静态路由)

配置PC机IP地址及网关

PC机1:192.168.10.2 192.168.10.1 PC机2:192.168.70.2 192.168.70.1 PC机3:192.168.60.2 192.169.60.1 PC机4:13.0.0.13 13.0.0.1

验证配置结果

测试四台PC机是否能实现全网互通,以此来验证OSPF高级配置是否成功

使用命令:do shiw ip route查看个路由器路由表学习情况