当前位置:文档之家› 实验三路由器基本配置

实验三路由器基本配置

上机报告姓名学号专业班级计科普1002课程名称网络系统集成指导教师机房名称(I520)上机日期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.完成路由器的基本端口配置,静态路由,缺省路由配置;2.RIPv2协议配置;3. OSPF协议配置;4.通过在路由器上使用相关的检查和排错命令学习如何维护和分析RIP协议、OSPF 协议。

实验步骤1.作路由器的端口IP地址配置,代码如下:路由器r1[H3C]sysname r1[r1]int e0/1[r1-Ethernet0/1]ip add 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 24路由器r2[H3C]sysname r2[r2]int e0/1[r2-Ethernet0/1]ip add 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 24路由器r3[H3C]sysname r2[r3]int e0/1[r2-Ethernet0/1]ip add 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 242.配置静态路由路由器r1[r1]ip route-static 24 route-static 24 路由器r2[r2]ip route-static 24 route-static 24 路由器r3[r3]ip route-static 24 route-static 24 配置默认路由路由器r1[r1]ip route-static 0.0.0.0 24 路由器r2[r1]ip route-static 0.0.0.0 24 路由器r3[r1]ip route-static 0.0.0.0 24 协议配置路由器r1[r1]rip[r1-rip-1]network 2路由器r2[r1]rip[r1-rip-1]network 2路由器r3[r1]rip[r1-rip-1]network 25.OSPF协议配置路由器r1[r1]inter[r1]interface loop[r1]interface LoopBack 0[r1-LoopBack0]ip add 1.1.1.1 24Info: 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 id 1.1.1.1[r1]ospf 1[r1-ospf-1]area 0[0.0.0]network 0.0.0 0.0.0 路由器r2[r2]int[r2]interface loop[r2]interface LoopBack 0[r2-LoopBack0]ip add 2.2.2.2 id 2.2.2.2[r2]ospf 100[r2-ospf-100]area 0[0.0.0]network 0.0.0 0.0.0 0.0.0.255路由器r3[r3]int[r3]interface loop[r3]interface LoopBack 0[r3-LoopBack0]ip add 3.3.3.3 1[r3-ospf-1]area 3.3.3.3 0.0.0.255[ 0.0.0.2556.验证配置当配置了rip协议之后,是可以让路由器之间相互ping通,然后路由器之间是可以相互学习到的。

我们一路由器r1为例,其效果如下:(1)在路由器r1上ping路由器r3[r1]ping PING 56 data bytes, press CTRL_C to breakReply from bytes=56 Sequence=1 ttl=254 time=2 msReply from bytes=56 Sequence=2 ttl=254 time=1 msReply from bytes=56 Sequence=3 ttl=254 time=1 msReply from bytes=56 Sequence=4 ttl=254 time=1 msReply from bytes=56 Sequence=5 ttl=254 time=1 ms--- ping statistics ---5 packet(s) transmitted5 packet(s) received% packet lossround-trip min/avg/max = 1/1/2 ms(2)查看路由表,知道路由器之间相互学习到了,所以能够路由ping通。

[r1]display ip routing-tableRouting Tables: PublicDestinations : 8 Routes : 8Destination/Mask Proto Pre Cost NextHop InterfaceDirect 0 0 InLoop0Direct 0 0 InLoop0Direct 0 0 Eth0/1Direct 0 0 InLoop0Direct 0 0 Eth0/0Direct 0 0 InLoop0RIP 100 1 Eth0/0RIP 100 2 Eth0/0(3)在进行了ospf协议的配置后,我们能够让路由ping通。

[r1]ping 3.3.3.3PING 3.3.3.3: 56 data bytes, press CTRL_C to breakReply from 3.3.3.3: bytes=56 Sequence=1 ttl=254 time=2 msReply from 3.3.3.3: bytes=56 Sequence=2 ttl=254 time=1 msReply from 3.3.3.3: bytes=56 Sequence=3 ttl=254 time=1 msReply from 3.3.3.3: bytes=56 Sequence=4 ttl=254 time=1 msReply from 3.3.3.3: bytes=56 Sequence=5 ttl=254 time=1 ms--- 3.3.3.3 ping statistics ---5 packet(s) transmitted5 packet(s) received% packet lossround-trip min/avg/max = 1/1/2 ms(4)查看ospf的邻居状态。

[r1]display ospf briefOSPF Process 1 with Router ID 1.1.1.1OSPF Protocol InformationRouterID: 1.1.1.1 Border Router:Route Tag: 0Multi-VPN-Instance is not enabledApplications Supported: MPLS Traffic-EngineeringSPF-schedule-interval: 5LSA generation interval: 5LSA arrival interval: 1000Transmit pacing: Interval: 20 Count: 3Default ASE parameters: Metric: 1 Tag: 1 Type: 2Route Preference: 10ASE Route Preference: 150SPF Computation Count: 10RFC 1583 CompatibleGraceful restart interval: 120Area Count: 1 Nssa Area Count: 0ExChange/Loading Neighbors: 0Area: 0.0.0.0 (MPLS TE not enabled)Authtype: None Area flag: NormalSPF Scheduled Count: 8ExChange/Loading Neighbors: 0Interface: (Ethernet0/1)Cost: 1 State: DR Type: Broadcast MTU: 1500Priority: 1Designated Router: Backup Designated Router: 0.0.0.0Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1Interface: (Ethernet0/0)Cost: 1 State: DR Type: Broadcast MTU: 1500Priority: 1Designated Router: Backup Designated Router: Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1Interface: 1.1.1.1 (LoopBack0)Cost: 0 State: Loopback Type: PTP MTU: 1536Timers: Hello 10, Dead 40, Poll 40, Retransmit 5, Transmit Delay 1(5)查看ospf的全局汇总信息。

相关主题