一、实验目的
1、掌握动态路由配置方法;
2、查看路由表
二、设备需求
本实验需要以下设备:
1、路由器4台。
2、PC机2台;
三、实验拓扑
四、实验步骤
1、根据拓扑搭建实验环境。
2、路由器互联接口配置,地址表如下:
路由器 |
端口 |
IP |
|
R1 |
GE 0/0/0 |
10.1.10.2/24 |
|
GE 0/0/1 |
10.1.20.1/24 |
||
Eth 0/0/0 |
192.168.10.1/24 |
||
R2 |
GE 0/0/0 |
10.1.10.1/24 |
|
GE 0/0/1 |
10.1.30.2/24 |
||
R3 |
GE 0/0/0 |
10.1.20.2/24 |
|
GE 0/0/1 |
10.1.30.1/24 |
||
GE 0/0/2 |
10.1.40.1/24 |
||
R4 |
GE 0/0/0 |
10.1.40.2/24 |
|
Eth 0/0/0 |
192.168.20.1/24 |
||
PC1 |
Fa0/0 |
192.168.10.2/24 |
|
PC2 |
Fa0/0 |
192.168.20.2/24 |
R1
[Huawei]
<Huawei>sys
[Huawei]sysname R1
[R1]inte giga0/0/0
[R1-GigabitEthernet0/0/0]ip address 10.1.10.2 24
[R1-GigabitEthernet0/0/0]inte giga0/0/1
[R1-GigabitEthernet0/0/1]ip address 10.1.20.1 24
[R1-GigabitEthernet0/0/1]inte Ethernet0/0/0
[R1-Ethernet0/0/0]ip address 192.168.10.1 24
R2
[Huawei]
<Huawei>sys
[Huawei]sysname R2
[R2]inte giga0/0/0
[R2-GigabitEthernet0/0/0]ip address 10.1.10.1 24
[R2-GigabitEthernet0/0/0]inte giga0/0/1
[R2-GigabitEthernet0/0/1]ip address 10.1.30.2 24
R3
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R3
[R3]inte giga0/0/0
[R3-GigabitEthernet0/0/0]ip address 10.1.20.2 24
[R3-GigabitEthernet0/0/0]inte giga0/0/1
[R3-GigabitEthernet0/0/1]ip address 10.1.30.1 24
[R3-GigabitEthernet0/0/1]inte giga0/0/2
[R3-GigabitEthernet0/0/2]ip address 10.1.40.1 24
R4
<Huawei>
<Huawei>sys
[Huawei]sysname R4
[R4]inte giga0/0/0
[R4-GigabitEthernet0/0/0]ip address 10.1.40.2 24
[R4-GigabitEthernet0/0/0]inte Eth0/0/0
[R4-Ethernet0/0/0]ip address 192.168.20.1 24
3、不做路由配置,用ping命令测试路由器之间的连通性(路由器任何一个接口地址能通都可以代表改路由器可达),同时在PC1和PC2上跟踪路由
PC1:tracert 192.168.20.2
PC2:tracert 192.168.10.2
以R1 ping R2、R3为例
4、在R1、R2、R3上查看路由表
[R2]disp ip routing-table !以查看R2路由表为例
第三个实验基础上 使用 undo ip route-static all 命令可以删除前文第一个实验配置的静态路由。这样可以减小工作量。
5、配置动态路由
R1配置动态路由
[R1]ospf 1 router-id 2.2.2.2
[R1-ospf-1]area 0
[R1-ospf-1-area-0.0.0.0]network 10.1.10.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 10.1.20.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.10.0 0.0.0.255
R2配置动态路由
[R2]ospf 1 router-id 1.1.1.1
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 10.1.10.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 10.1.30.0 0.0.0.255
R3配置动态路由
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[R3-ospf-1-area-0.0.0.0]network 10.1.20.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.1.30.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 10.1.40.0 0.0.0.255
R4配置动态路由
[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 10.1.40.0 0.0.0.255
[R4-ospf-1-area-0.0.0.0]network 192.168.20.0 0.0.0.255
6、在各路由器上查看邻居和学习到的路由,并记录路由的cost值。
以R3为例:
[R3]display ospf peer
[R3]display ip routing-table protocol ospf
7、PC1和PC2互ping验证连通性。所有路由器端口互ping验证连通性
五、实验成果
1、掌握ospf配置
3、掌握邻居表和路由表的查看
六、实验遇到的问题
1、配置路由器R4端口GE0/0/0的ip时错误配置在GE0/0/1上
解决办法:使用命令清除配置信息
[R4] inte giga0/0/1 !进入GE0/0/1端口
[R4-GigabitEthernet0/0/1] clear configuration interface giga0/0/1 !清除GE0/0/1端口的配置
Warning: All configurations of the interface will be cleared, and its state will
be shutdown. Continue? [Y/N] :y !出现该警告时输入Y
Info: Total execute 1 command(s), 1 successful, 0 failed.
2、配置完端口后如何检查有无错误
解决办法:使用命令查看端口ip简要信息(以R4为例)
[R4] display ip interface brief !查看R4的端口IP信息
*down: administratively down
!down: FIB overload down
^down: standby
(l): loopback
(s): spoofing
(d): Dampening Suppressed
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 8
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 8
Interface IP Address/Mask Physical Protocol
Ethernet0/0/0 192.168.20.1/24 up up
Ethernet0/0/1 unassigned down down
GigabitEthernet0/0/0 10.1.40.2/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
GigabitEthernet0/0/3 unassigned down down
NULL0 unassigned up up(s)
Serial0/0/0 unassigned down down
Serial0/0/1 unassigned down down
Serial0/0/2 unassigned down down
Serial0/0/3 unassigned down down
[R4]
3、设置完ospf配置后pc1,pc2之间无法ping通
原因:没有设置pc1,2的网关(pc网关就是路由器连接该pc的端口的ip)
文章来源:https://www.toymoban.com/news/detail-763695.html
文章来源地址https://www.toymoban.com/news/detail-763695.html
到了这里,关于ensp实验四:OSPF动态路由1的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!