实验报告
题目:静态路由器的配置
组 员: 专 业:电气工程及其自动化 学生邮箱:
一、实验要求
掌握静态路由方式实现网络的连通性。
二、技术原理
路由器属于网络层设备,能够根据IP包头的信息,选择一条最佳路径,将数据包装发出去。实现不同网段的主机之间的互相访问。
路由器是根据路由表进行选路好转发的。而路由表里就是由一条条的路由信息组成。路由表的产生方式一般有3种:
➢ 直接路由-----给路由器接口配置一个IP地址,路由器自动产生本接口IP所在网段的路由
信息。
➢ 静态路由-----在拓扑结构简单的网络中,网管员通过手工的方式配置本路由器未知网段
的路由信息,从而实现不同网段之间的链接。
➢ 动态路由协议学习产生的路由-----在大规模的网络中,或网络拓扑结构相对复杂的情况
下,通过在路由器上运行动态路由协议,路由器之间互相自动学习产生路由信息。
三、实现功能
实现网络的互连互通,从而实现信息的共享和传递。
四、实验设备
R1762(两台)、V35线缆(1条)、PC(两台)、直连线或者交叉线(2条)
五、实验拓扑
图中各端口的IP地址为: R1200-1:
F1/0:172.16.1.1/24 S1/2:172.16.2.1/24 R1200-2:
F1/0:172.16.3.2/24 S1/2:172.16.2.2/24
六、实验步骤与实验内容
1、查看路由器的相关配置情况。
R1700-1#sh ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 * - candidate default
Gateway of last resort is no set R1700-1#sh int fa 1/0
FastEthernet 1/0 is DOWN , line protocol is DOWN
Hardware is PQ2 FCC FAST ETHERNET CONTROLLER FastEthernet, address is 00d0.f86 87c5 (bia 00d0.f86b.87c5)
Interface address is: no ip address
ARP type: ARPA,ARP Timeout: 3600 seconds MTU 1500 bytes, BW Kbit
Encapsulation protocol is Ethernet-II, loopback not set Keepalive interval is 10 sec , set Carrier delay is 2 sec RXload is 1 ,Txload is 1 Queueing strategy: FIFO
Output queue 0/40, 0 drops; Input queue 0/75, 0 drops
5 minutes input rate 0 bits/sec, 0 packets/sec 5 minutes output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 res lack, 0 no buffer,0 dropped Received 0 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort 0 packets output, 0 bytes, 0 underruns,0 dropped 0 output errors, 0 collisions, 7 interface resets R1700-1#sh int s1/2
serial 1/2 is UP , line protocol is UP
Hardware is PQ2 SCC HDLC CONTROLLER serial Interface address is: no ip address MTU 1500 bytes, BW 2000 Kbit
Encapsulation protocol is HDLC, loopback not set Keepalive interval is 10 sec , set Carrier delay is 2 sec RXload is 1 ,Txload is 1 Queueing strategy: WFQ
5 minutes input rate 17 bits/sec, 0 packets/sec 5 minutes output rate 17 bits/sec, 0 packets/sec
430 packets input, 9460 bytes, 0 res lack, 0 no buffer,0 dropped Received 430 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort
430 packets output, 9460 bytes, 0 underruns,0 dropped 0 output errors, 0 collisions, 3 interface resets 1 carrier transitions V35 DCE cable
DCD=up DSR=up DTR=up RTS=up CTS=up R1700-1#sh ip int br
Interface IP-Address(Pri) OK? Status
serial 1/2 no address YES DOWN serial 1/3 no address YES DOWN FastEthernet 1/0 no address YES DOWN FastEthernet 1/1 no address YES DOWN Null 0 no address YES UP
2、在路由器1上配置接口的IP地址和串口上的时钟频率。并验证路由器接口配置、查看接口状态。
R1700-1#conf
Enter configuration commands, one per line. End with CNTL/Z. R1700-1(config)#int fa 1/0
R1700-1(config-if)#ip add 172.16.1.1 255.255.255.0 R1700-1(config-if)#no sh R1700-1(config-if)#int s 1/2
R1700-1(config-if)#ip add 172.16.2.1 255.255.255.0 R1700-1(config-if)#clock rate 64000 R1700-1(config-if)#no sh R1700-1(config-if)#exit
R1700-1(config)#sh ip int br
Interface IP-Address(Pri) OK? serial 1/2 172.16.2.1/24 YES serial 1/3 no address YES FastEthernet 1/0 172.16.1.1/24 YES FastEthernet 1/1 no address YES Null 0 no address YES R1700-1(config)#sh int s 1/2
serial 1/2 is UP , line protocol is UP
Hardware is PQ2 SCC HDLC CONTROLLER serial Interface address is: 172.16.2.1/24 MTU 1500 bytes, BW 2000 Kbit
Encapsulation protocol is HDLC, loopback not set Keepalive interval is 10 sec , set Carrier delay is 2 sec RXload is 1 ,Txload is 1 Queueing strategy: WFQ
5 minutes input rate 17 bits/sec, 0 packets/sec 5 minutes output rate 17 bits/sec, 0 packets/sec
448 packets input, 9856 bytes, 0 res lack, 0 no buffer,0 dropped Received 448 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort
448 packets output, 9856 bytes, 0 underruns,0 dropped 0 output errors, 0 collisions, 4 interface resets 1 carrier transitions V35 DCE cable
Status UP DOWN DOWN DOWN UP DCD=up DSR=up DTR=up RTS=up CTS=up
3、在路由器1上配置静态路由,并验证静态路由配置。
R1700-1(config)#ip route 172.16.3.0 255.255.255.0 172.16.2.2 R1700-1(config)#sh ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 * - candidate default
Gateway of last resort is no set
C 172.16.2.0/24 is directly connected, serial 1/2 C 172.16.2.1/32 is local host.
S 172.16.3.0/24 [1/0] via 172.16.2.2
4、在路由器2上配置接口的I地址和串口时钟频率。验证路由器接口配置、查看接口状态。
R1700-2#conf
Enter configuration commands, one per line. End with CNTL/Z. R1700-2(config)#int fa 1/0
R1700-2(config-if)#ip add 172.16.3.2 255.255.255.0 R1700-2(config-if)#no sh R1700-2(config-if)#exit R1700-2(config)#int s 1/2
R1700-2(config-if)#ip add 172.16.2.2 255.255.255.0 R1700-2(config-if)#no sh R1700-2(config-if)#exit
R1700-2(config)#sh ip int br
Interface IP-Address(Pri) OK? Status serial 1/2 172.16.2.2/24 YES UP serial 1/3 no address YES DOWN FastEthernet 1/0 172.16.3.2/24 YES DOWN FastEthernet 1/1 no address YES DOWN Null 0 no address YES UP
R1700-2(config)#sh int s1/2
serial 1/2 is UP , line protocol is UP
Hardware is PQ2 SCC HDLC CONTROLLER serial Interface address is: 172.16.2.2/24 MTU 1500 bytes, BW 2000 Kbit
Encapsulation protocol is HDLC, loopback not set Keepalive interval is 10 sec , set Carrier delay is 2 sec
RXload is 1 ,Txload is 1 Queueing strategy: WFQ
5 minutes input rate 17 bits/sec, 0 packets/sec 5 minutes output rate 17 bits/sec, 0 packets/sec
477 packets input, 10494 bytes, 0 res lack, 0 no buffer,0 dropped Received 477 broadcasts, 0 runts, 0 giants
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 abort
477 packets output, 10494 bytes, 0 underruns,0 dropped 0 output errors, 0 collisions, 3 interface resets 1 carrier transitions V35 DTE cable
DCD=up DSR=up DTR=up RTS=up CTS=up
5、在路由器2上配置静态路由,并验证静态路由配置。
R1700-2(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1 R1700-2(config)#sh ip route
Codes: C - connected, S - static, R - RIP O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 * - candidate default
Gateway of last resort is no set
S 172.16.1.0/24 [1/0] via 172.16.2.1
C 172.16.2.0/24 is directly connected, serial 1/2 C 172.16.2.2/32 is local host.
6、测试网络的互连互通性。
C:\\Documents and Settings\\Administrator>ping 172.16.3.22
Pinging 172.16.3.22 with 32 bytes of data:
Reply from 172.16.3.22: bytes=32 time<1ms TTL=128 Reply from 172.16.3.22: bytes=32 time<1ms TTL=128 Reply from 172.16.3.22: bytes=32 time<1ms TTL=128 Reply from 172.16.3.22: bytes=32 time<1ms TTL=128
Ping statistics for 172.16.3.22:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
C:\\Documents and Settings\\Administrator>ping 172.16.1.11
Pinging 172.16.1.11 with 32 bytes of data:
Reply from 172.16.1.11: bytes=32 time=20ms TTL=126 Reply from 172.16.1.11: bytes=32 time=20ms TTL=126 Reply from 172.16.1.11: bytes=32 time=20ms TTL=126 Reply from 172.16.1.11: bytes=32 time=20ms TTL=126
Ping statistics for 172.16.1.11:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:
Minimum = 20ms, Maximum = 20ms, Average = 20ms
C:\\Documents and Settings\\Administrator>
七、注意事项
如果两台路由器通过串口直接互连,必须在其中一段设置时钟频率。
八、心得体会
通过本次的实验,学会了如何配置静态路由,对网络之间的相互通信有了更深一步的了解和认识。
在实验中,需要格外的注意连线,因为我们做实验的过程中遇到接口接触不良的情况,在PC上显示线路未连接,而连错线的时候PC也是显示线路未连接,所以要注意区分这两种情况,找到原因,纠正连线。否则会浪费较多的时间。
因篇幅问题不能全部显示,请点此查看更多更全内容