Cisco路由器配置可定制队列

Cisco路由器配置可定制队列

Cisco路由器配置可定制队列(CQ)
【实验名称】
Cisco路由器配置可定制队列(CQ)

【实验目的】
掌握网络工程师配置可定制队列(CQ)的原理

【背景描述】
假设校园网通过一台路由器连接到校园外的另一台路由器上,现要在路由器上做适当配置,实现校园网内部主机与校园网外部主机的相互通信。
该网络存在的问题是:当校园网内部主机与校园网外部主机的相互通信时,内部主机访问外部网络的WWW服务时,网络响应速度很慢。本实验以2台R2624路由器为例,路由器分别为Router1和Router2,路由器之间通过串口采用V35 DCE/DTE电缆连接 。PC1的IP地址和缺省网关分别为172.16.1.11和172.16.1.1,PC2的IP地址和缺省网关分别为172.16.3.22和172.16.3.2 ,网络掩码都是255.255.255.0

【实现功能】
实现网络的互连互通,从而实现信息的共享和传递,并且使内部主机对外部网络WWW服务的访问得到应有的服务质量。
【实验设备】
R2624(2台)、V35 DTE线缆(1根)、V35 DCE线缆(1根)

【实验步骤】

第一步:在路由器Router1上配置接口的IP地址和串口上的时钟频率
Router1(config)#interface fastethernet 0 !进入接口F0的配置模式
Router1(config-if)#ip address 172.16.1.1 255.255.255.0 !配置路由器接口F0的IP地址
Router1(config)#no shutdown !开启路由器fastethernet0接口
!
Router1(config)#interface serial 0 !进入接口S0配置模式
Router1(config-if)#ip address 172.16.2.1 255.255.255.0 !配置路由器接口S0的IP地址
Router1(config-if)#clock rate 64000 !配置Router1的时钟频率(DCE)
Router1(config)#no shutdown !开启路由器fastethernet0接口

验证测试:验证路由器接口的配置
Router1#show ip interface brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0 172.16.1.1 YES manual up up

Serial0 172.16.2.1 YES manual down down

Serial1 unassigned YES unset administratively down down

Router1#show interface serial 0
Serial0 is down, line protocol is down
Hardware is HDLC4530A
Internet address is 172.16.2.1/24
MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
Last clearing of “show interface” counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/0 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 8 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=down DSR=down DTR=down RTS=down CTS=down

第二步:在路由器Router1上配置静态路由
Router1(config)#ip route 172.16.3.0 255.255.255.0 172.16.2.2

Router1(config)#ip route 172.16.3.0 255.255.255.0 serial 0

验证测试:验证Router1上的静态路由配置
Router1#show ip route
Codes: C – connected, S – static, R – RIP
O – OSPF, IA – OSPF inter area
E1 – OSPF external type 1, E2 – OSPF external type 2

Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet0
C 172.16.2.0 is directly connected, Serial0
S 172.16.3.0/24 [1/0] via 172.16.2.2

第三步:在路由器Router2上配置接口的IP地址和串口上的时钟频率
Router2(config)#interface fastethernet 0 !进入接口F0的配置模式
Router2(config-if)#ip address 172.16.3.2 255.255.255.0 !配置路由器接口F0的IP地址
Router2(config)#no shutdown !开启路由器fastethernet0接口
!
Router2(config)#interface serial 0 !进入接口S0配置模式
Router2(config-if)#ip address 172.16.2.2 255.255.255.0 !配置路由器接口S0的IP地址
Router2(config)#no shutdown !开启路由器fastethernet0接口

验证测试:验证路由器接口的配置
Router2#show ip interface brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0 172.16.3.2 YES manual up up

Serial0 172.16.2.2 YES manual up up

Serial1 unassigned YES unset administratively down down

Router2#show interface serial 0
Serial0 is up, line protocol is up
Hardware is HDLC4530A
Internet address is 172.16.2.2/24
MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
Last clearing of “show interface” counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/0 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 8 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up

第四步:在路由器Router2上配置静态路由
Router2(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1

Router2(config)#ip route 172.16.3.0 255.255.255.0 serial 0

验证测试:验证Router2上的静态路由配置
Router2#show ip route
Codes: C – connected, S – static, R – RIP
O – OSPF, IA – OSPF inter area
E1 – OSPF external type 1, E2 – OSPF external type 2

Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.3.0 is directly connected, FastEthernet0
C 172.16.2.0 is directly connected, Serial0
S 172.16.1.0/24 [1/0] via 172.16.2.1

第五步:测试网络的互连互通性
C:\>ping 172.16.3.22 !从PC1 ping PC2
Pinging 172.16.3.22 with 32 bytes of data:

Reply from 172.16.3.22: bytes=32 time<10ms TTL=126
Reply from 172.16.3.22: bytes=32 time<10ms TTL=126
Reply from 172.16.3.22: bytes=32 time<10ms TTL=126
Reply from 172.16.3.22: bytes=32 time<10ms TTL=126

C:\>ping 172.16.1.11 !从PC2 ping PC1
Pinging 172.16.1.11 with 32 bytes of data:

Reply from 172.16.1.11: bytes=32 time<10ms TTL=126
Reply from 172.16.1.11: bytes=32 time<10ms TTL=126
Reply from 172.16.1.11: bytes=32 time<10ms TTL=126
Reply from 172.16.1.11: bytes=32 time<10ms TTL=126

第六步:PC2需要安装Win2000 Server系统,并且将其配置为telnet服务器,FTP服务器,WWW服务器

第七步:从PC1对PC2进行WWW访问,同时从PC2中复制文件,观察WWW的响应效果

第八步:在Router1上定义CQ
Router1(config)#queue-list 1 protocol ip 1 tcp www ! 将WWW应用的数据流放入1队列
Router1(config)#queue-list 1 protocol ip 2 tcp telnet !将Telnet应用的数据流放入2队列
Router1(config)#queue-list 1 protocol ip 3 tcp ftp
Router1(config)#queue-list 1 protocol ip 3 tcp ftp-data !将Ftp应用的数据流放入3队列
Router1(config)#queue-list 1 queue 3 byte-count 4500 !定义3队列的服务门限值为4500字节,其余的队列均为1500字节
Router1(config)#queue-list 1 default 4 !将未指定的数据流放入4队列

第九步:在Router1的WAN0接口上启用CQ
Router1(config)#interface serial 0 !进入接口S0配置模式
Router1(config-if)#custom-queue-list 1 !启用可定制队列

验证测试:
Router1#show interfaces serial 0
Serial0 is up, line protocol is up
Hardware is HDLC4530A
MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
Last clearing of “show interface” counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: custom-list 1
Output queues: (queue #: size/max/drops)
0: 0/20/0 1: 0/20/0 2: 0/20/0 3: 0/20/0 4: 0/20/0
5: 0/20/0 6: 0/20/0 7: 0/20/0 8: 0/20/0 9: 0/20/0
10: 0/20/0 11: 0/20/0 12: 0/20/0 13: 0/20/0 14: 0/20/0
15: 0/20/0 16: 0/20/0
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 9 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up

第十步:从PC1对PC2进行WWW访问,同时从PC2中复制文件,再次观察WWW的响应效果

【注意事项】
如果两台路由器通过串口直接互连,则必须在其中一端设置时钟频率(DCE)。
实验效果可能不十分明显。

【参考配置】
Router1#show running-config ! 显示路由器Router1的全部配置
Router2#show running-config ! 显示路由器Router2的全部配置

成为第一个发表评论的人

发表评论

您的电子邮件地址不会被公开.


*