您的当前位置:首页实验三:路由器基本配置

实验三:路由器基本配置

2020-09-26 来源:乌哈旅游
上机报告

姓名 指导教师 学号 机房名称 专业班级 (I520) 实验三:路由器基本配置 计科普1002 课程名称 上机日期 网络系统集成 2012 年10 月 26 日 上机项目名称 上机步骤及内容: 实验目的 1.使用路由器配置静态路由、RIP协议、OSPF协议。掌握使用相应协议实现路由选择的方法。 2.通过在路由器上使用相关的检查和排错命令学习如何维护和分析RIP协议、OSPF协议。 3.通过RIPv1和RIPv2配置过程的不同体会两者在实际使用上的差别。 实验要求 1.在路由器上配置静态路由、缺省路由; 2.配置RIP协议;配置OSPF协议; 3.掌握路由器接口配置,测试网络连通性; 4.理解每一步实验的作用,把实验的每一步所完成的任务详细地叙述清楚,并记录在实验报告上; 5.实验结束后上缴实验报告 实验仪器设备和材料清单 1.具备两个以太网端口的路由器三台,交换机两台; 2.两台具备以太网接口的PC机,分别连接路由器的内外网口,路由器端口、PC的IP地址可自己分配和设置 3.路由器拓扑结构成环状或线性连接; 4. 实验组网图。 图 1.1 实验组网图 实验内容 1.完成路由器的基本端口配置,静态路由,缺省路由配置; 2.RIPv2协议配置; 3. OSPF协议配置; 4.通过在路由器上使用相关的检查和排错命令学习如何维护和分析RIP协议、OSPF协议。 实验步骤 1.作路由器的端口IP地址配置,代码如下: 路由器r1 [H3C]sysname r1 [r1]int e0/1 [r1-Ethernet0/1]ip add 192.168.11.1 24 [r1-Ethernet0/1] %Oct 28 16:55:42:805 2012 r1 IFNET/4/UPDOWN: Line protocol on the interface Ethernet0/1 is UP [r1-Ethernet0/1]int e0/0 [r1-Ethernet0/0]ip add 192.168.22.1 24 路由器r2 [H3C]sysname r2 [r2]int e0/1 [r2-Ethernet0/1]ip add 192.168.22.2 24 [r2-Ethernet0/1] %Oct 28 16:40:33:465 2012 r2 IFNET/4/UPDOWN: Line protocol on the interface Ethernet0/1 is UP [r2-Ethernet0/1]int e0/0 [r2-Ethernet0/0]ip add 192.168.33.1 24 路由器r3 [H3C]sysname r2 [r3]int e0/1 [r2-Ethernet0/1]ip add 192.168.33.2 24 [r3-Ethernet0/1] %Oct 28 16:40:33:465 2012 r3 IFNET/4/UPDOWN: Line protocol on the interface Ethernet0/1 is UP [r3-Ethernet0/1]int e0/0 [r3-Ethernet0/0]ip add 192.168.44.1 24 2.配置静态路由 路由器r1 [r1]ip route-static 192.168.33.0 24 192.168.22.2 [r1]ip route-static 192.168.44.0 24 192.168.22.2 路由器r2 [r2]ip route-static 192.168.44.0 24 192.168.33.2 [r2]ip route-static 192.168.11.0 24 192.168.22.1 路由器r3 [r3]ip route-static 192.168.22.0 24 192.168.33.1 [r3]ip route-static 192.168.11.0 24 192.168.33.1 3.配置默认路由 路由器r1 [r1]ip route-static 0.0.0.0 24 192.168.22.2 路由器r2 [r1]ip route-static 0.0.0.0 24 192.168.33.2 路由器r3 [r1]ip route-static 0.0.0.0 24 192.168.33.1 4.RIPv2协议配置 路由器r1 [r1]rip [r1-rip-1]network 192.168.11.0 [r1-rip-1]network 192.168.22.0 [r1-rip-1]version 2 路由器r2 [r1]rip [r1-rip-1]network 192.168.33.0 [r1-rip-1]network 192.168.22.0 [r1-rip-1]version 2 路由器r3 [r1]rip [r1-rip-1]network 192.168.44.0 [r1-rip-1]network 192.168.33.0 [r1-rip-1]version 2 5.OSPF协议配置 路由器r1 [r1]inter [r1]interface loop [r1]interface LoopBack 0 [r1-LoopBack0]ip add 1.1.1.1 24 Info: Only 32-bit masks are supported on Loopback interfaces. The mask has been converted to 32-bit. [r1-LoopBack0]ip add 1.1.1.1 255.255.255.255 [r1-LoopBack0]quit [r1]rou [r1]router id 1.1.1.1 [r1]ospf 1 [r1-ospf-1]area 0 [r1-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0 [r1-ospf-1-area-0.0.0.0]network 192.168.11.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]network 192.168.22.0 0.0.0.255 路由器r2 [r2]int [r2]interface loop [r2]interface LoopBack 0 [r2-LoopBack0]ip add 2.2.2.2 255.255.255.255 [r2-LoopBack0]quit [r2]rou [r2]router id 2.2.2.2 [r2]ospf 100 [r2-ospf-100]area 0 [r2-ospf-100-area-0.0.0.0]network 2.2.2.2 0.0.0.0 [r2-ospf-100-area-0.0.0.0]network 192.168.22.0 0.0.0.255 [r2-ospf-100-area-0.0.0.0]quit [r2-ospf-100]area 192.168.10.1 [r2-ospf-100-area-192.168.10.1]net [r2-ospf-100-area-192.168.10.1]network 192.168.33.0 0.0.0.255 路由器r3 [r3]int [r3]interface loop [r3]interface LoopBack 0 [r3-LoopBack0]ip add 3.3.3.3 255.255.255.255 [r3-LoopBack0]quit [r3]ospf 1 [r3-ospf-1]area 192.168.10.1 [r3-ospf-1-area-192.168.10.1]network 3.3.3.3 0.0.0.0 [r3-ospf-1-area-192.168.10.1]network 192.168.44.0 0.0.0.255 [r3-ospf-1-area-192.168.10.1]network 192.168.33.0 0.0.0.255 6.验证配置 当配置了rip协议之后,是可以让路由器之间相互ping通,然后路由器之间是可以相互学习到的。我们一路由器r1为例,其效果如下: (1)在路由器r1上ping路由器r3 [r1]ping 192.168.44.1 PING 192.168.44.1: 56 data bytes, press CTRL_C to break Reply from 192.168.44.1: bytes=56 Sequence=1 ttl=254 time=2 ms Reply from 192.168.44.1: bytes=56 Sequence=2 ttl=254 time=1 ms Reply from 192.168.44.1: bytes=56 Sequence=3 ttl=254 time=1 ms Reply from 192.168.44.1: bytes=56 Sequence=4 ttl=254 time=1 ms Reply from 192.168.44.1: bytes=56 Sequence=5 ttl=254 time=1 ms --- 192.168.44.1 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/2 ms (2)查看路由表,知道路由器之间相互学习到了,所以能够路由ping通。 [r1]display ip routing-table Routing Tables: Public Destinations : 8 Routes : 8 Destination/Mask Proto Pre Cost NextHop Interface 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.11.0/24 Direct 0 0 192.168.11.1 Eth0/1 192.168.11.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.22.0/24 Direct 0 0 192.168.22.1 Eth0/0 192.168.22.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.33.0/24 RIP 100 1 192.168.22.2 Eth0/0 192.168.44.0/24 RIP 100 2 192.168.22.2 Eth0/0 (3)在进行了ospf协议的配置后,我们能够让路由ping通。 [r1]ping 3.3.3.3 PING 3.3.3.3: 56 data bytes, press CTRL_C to break Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=2 ms Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=1 ms Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=1 ms Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=1 ms Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=1 ms --- 3.3.3.3 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 1/1/2 ms (4)查看ospf的邻居状态。 [r1]display ospf brief OSPF Process 1 with Router ID 1.1.1.1 OSPF Protocol Information RouterID: 1.1.1.1 Border Router: Route Tag: 0 Multi-VPN-Instance is not enabled Applications Supported: MPLS Traffic-Engineering SPF-schedule-interval: 5 LSA generation interval: 5 LSA arrival interval: 1000 Transmit pacing: Interval: 20 Count: 3 Default ASE parameters: Metric: 1 Tag: 1 Type: 2 Route Preference: 10 ASE Route Preference: 150 SPF Computation Count: 10 RFC 1583 Compatible Graceful restart interval: 120 Area Count: 1 Nssa Area Count: 0 ExChange/Loading Neighbors: 0 Area: 0.0.0.0 (MPLS TE not enabled) Authtype: None Area flag: Normal SPF Scheduled Count: 8 ExChange/Loading Neighbors: 0 Interface: 192.168.11.1 (Ethernet0/1) Cost: 1 State: DR Type: Broadcast MTU: 1500 Priority: 1 Designated Router: 192.168.11.1 Backup Designated Router: 0.0.0.0 Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1 Interface: 192.168.22.1 (Ethernet0/0) Cost: 1 State: DR Type: Broadcast MTU: 1500 Priority: 1 Designated Router: 192.168.22.1 Backup Designated Router: 192.168.22.2 Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1 Interface: 1.1.1.1 (LoopBack0) Cost: 0 State: Loopback Type: PTP MTU: 1536 Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1 (5)查看ospf的全局汇总信息。 [r1]display ospf lsdb OSPF Process 1 with Router ID 1.1.1.1 Link State Database Area: 0.0.0.0 Type LinkState ID AdvRouter Age Len Sequence Metric Router 1.1.1.1 1.1.1.1 115 60 0 Router 2.2.2.2 2.2.2.2 105 48 0 Network 192.168.22.1 1.1.1.1 115 32 0 Sum-Net 192.168.44.0 2.2.2.2 69 28 2 Sum-Net 3.3.3.3 2.2.2.2 69 28 1 Sum-Net 192.168.33.0 2.2.2.2 79 28 1 (6)再次查看路由表,即查看ospf链路状态数据库。 [r1]display ip routing-table Routing Tables: Public Destinations : 11 Routes : 11 Destination/Mask Proto Pre Cost NextHop Interface 1.1.1.1/32 Direct 0 0 127.0.0.1 InLoop0 2.2.2.2/32 OSPF 10 1 192.168.22.2 Eth0/0 3.3.3.3/32 OSPF 10 2 192.168.22.2 Eth0/0 127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0 127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.11.0/24 Direct 0 0 192.168.11.1 Eth0/1 192.168.11.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.22.0/24 Direct 0 0 192.168.22.1 Eth0/0 192.168.22.1/32 Direct 0 0 127.0.0.1 InLoop0 192.168.33.0/24 OSPF 10 2 192.168.22.2 Eth0/0 192.168.44.0/24 OSPF 10 3 192.168.22.2 Eth0/0 结果分析与体会: 本次实验主要就是进行的路由器的一些基本配置,显示路由器的端口配置IP地址,然后就是配置静态路由让不在同一个网段的电脑能够ping通,再就是了解RIP和OSPF协议,知道这些协议的工作原理,这样我们就容易在实验时了解我们配置的目的。实验很简单,只要会这些配置文档,就可以轻松的把实验做好。 上机成绩、评语 指导教师签名 批改日期

因篇幅问题不能全部显示,请点此查看更多更全内容