实验目的:   熟悉CAR 流量监管和GTS流量×××

              理解QOS是如何工作的

 

实验拓扑

 

 

 

 

实验思路

 

    在R2的S0/6/0上作CAR

 

    在R1的S0/6/0上作GTS

 

实验配置

 

 

R1

#

acl number 3000 

 rule 0 permit ip source 172.16.1.1 0 destination 192.168.1.1 0

 rule 1 deny ip

acl number 3001

 rule 0 permit ip source 172.16.1.2 0 destination 192.168.1.1 0

 rule 1 deny ip

#

interface Serial0/6/0

 link-protocol ppp

 ip address 10.0.0.1 255.255.255.252

 qos gts acl 3000 cir 8000 cbs 15000 ebs 0 queue-length 50

 qos gts acl 3001 cir 8000 cbs 15000 ebs 0 queue-length 50

#

interface Serial0/6/1

 link-protocol ppp

 ip address 10.0.0.5 255.255.255.252

#

interface Serial0/6/2

 link-protocol ppp

#

interface Serial0/6/3

 link-protocol ppp

#

interface NULL0 

#

interface LoopBack0

 ip address 172.16.1.1 255.255.255.255

#

interface Ethernet0/4/0

 port link-mode bridge

#

interface Ethernet0/4/1

 port link-mode bridge

#

interface Ethernet0/4/2

 port link-mode bridge

#

interface Ethernet0/4/3

 port link-mode bridge

#

interface Ethernet0/4/4

 port link-mode bridge

#

interface Ethernet0/4/5

 port link-mode bridge

#

interface Ethernet0/4/6

 port link-mode bridge

#

interface Ethernet0/4/7

 port link-mode bridge

#

 ip route-static 0.0.0.0 0.0.0.0 Serial0/6/0

 ip route-static 0.0.0.0 0.0.0.0 Serial0/6/1

#

 load xml-configuration

#

user-interface con 0

user-interface vty 0 4

#

return

 

 

R2

 

 

 

 

#

domain system

 access-limit disable

 state active

 idle-cut disable

 self-service-url disable

#

acl number 3000 

 rule 0 permit ip source 172.16.1.1 0 destination 192.168.1.1 0

 rule 1 deny ip

acl number 3001

 rule 0 permit ip source 172.16.1.2 0 destination 192.168.1.1 0

 rule 1 deny ip

#

interface Serial0/6/0

 link-protocol ppp

 ip address 10.0.0.2 255.255.255.252

 qos car inbound acl 3001 cir 8000 cbs 15000 ebs 0 green pass red discard

 qos car inbound acl 3000 cir 8000 cbs 15000 ebs 0 green pass red discard

#

interface Serial0/6/1

 link-protocol ppp

#

interface Serial0/6/2

 link-protocol ppp

#

interface Serial0/6/3

 link-protocol ppp

#

interface NULL0

#               

interface LoopBack0

 ip address 192.168.1.1 255.255.255.255

#

interface Ethernet0/4/0

 port link-mode bridge

#

interface Ethernet0/4/1

 port link-mode bridge

#

interface Ethernet0/4/2

 port link-mode bridge

#

interface Ethernet0/4/3

 port link-mode bridge

#

interface Ethernet0/4/4

 port link-mode bridge

#

interface Ethernet0/4/5

 port link-mode bridge

#

interface Ethernet0/4/6

 port link-mode bridge

#

interface Ethernet0/4/7

 port link-mode bridge

#

 ip route-static 0.0.0.0 0.0.0.0 Serial0/6/0

#

 load xml-configuration

#

user-interface con 0

user-interface vty 0 4

#

return

 
 
R3
 
 
 
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
interface Serial0/6/0
 link-protocol ppp
#
interface Serial0/6/1
 link-protocol ppp
 ip address 10.0.0.6 255.255.255.252
#
interface Serial0/6/2
 link-protocol ppp
#
interface Serial0/6/3
 link-protocol ppp
#
interface NULL0
#
interface LoopBack0
 ip address 172.16.1.2 255.255.255.255
#
interface Ethernet0/4/0
 port link-mode bridge
#
interface Ethernet0/4/1
 port link-mode bridge
#               
interface Ethernet0/4/2
 port link-mode bridge
#
interface Ethernet0/4/3
 port link-mode bridge
#
interface Ethernet0/4/4
 port link-mode bridge
#
interface Ethernet0/4/5
 port link-mode bridge
#
interface Ethernet0/4/6
 port link-mode bridge
#
interface Ethernet0/4/7
 port link-mode bridge
#
 ip route-static 0.0.0.0 0.0.0.0 Serial0/6/1
#
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return
 
 
测试:
 
1、用R1 R3 的loop back 口ping R2的loopback 口
 
在R2上查看如下信息
 
<R2>dis qos car interface 
Interface: Serial0/6/0
Direction: Inbound
  Rule(s): If-match acl 3001
  CIR 8000 (kbps),  CBS 15000 (byte),  EBS 0 (byte)
  Green Action: pass
  Red Action : discard
  Green : 16294(Packets) 20801400(Bytes)  
  Yellow: 0(Packets) 0(Bytes)  
  Red   : 0(Packets) 0(Bytes) 
  Rule(s): If-match acl 3000
  CIR 8000 (kbps),  CBS 15000 (byte),  EBS 0 (byte)
  Green Action: pass
  Red Action : discard
  Green : 12022(Packets) 16286384(Bytes)  
  Yellow: 0(Packets) 0(Bytes)  
  Red   : 0(Packets) 0(Bytes) 
<R2>
<R2>
<R2>
<R2>dis qos car interface 
Interface: Serial0/6/0
Direction: Inbound
  Rule(s): If-match acl 3001
  CIR 8000 (kbps),  CBS 15000 (byte),  EBS 0 (byte)
  Green Action: pass
  Red Action : discard
  Green : 16294(Packets) 20801400(Bytes)  
  Yellow: 0(Packets) 0(Bytes)  
  Red   : 0(Packets) 0(Bytes) 
  Rule(s): If-match acl 3000
  CIR 8000 (kbps),  CBS 15000 (byte),  EBS 0 (byte)
  Green Action: pass
  Red Action : discard
  Green : 12027(Packets) 16286804(Bytes)  
  Yellow: 0(Packets) 0(Bytes)  
  Red   : 0(Packets) 0(Bytes) 
<R2>
<R2>
<R2>
                                                                                                                                                                                                                                                                        2、测试方法如上
在R1上配置完成GTS后作测试
 
[R1]dis qos gts interface 
Interface: Serial0/6/0
 Rule(s): If-match acl 3000 
 CIR 8000 (kbps), CBS 15000 (byte), EBS 0 (byte)
 Passed   : 0(Packets) 0(Bytes)  
 Discarded: 0(Packets) 0(Bytes)  
 Rule(s): If-match acl 3001 
 CIR 8000 (kbps), CBS 15000 (byte), EBS 0 (byte)
 Passed   : 198(Packets) 16632(Bytes)  
 Discarded: 0(Packets) 0(Bytes)  
[R1]
[R1]
[R1]
[R1]
[R1]dis qos gts interface 
Interface: Serial0/6/0
 Rule(s): If-match acl 3000 
 CIR 8000 (kbps), CBS 15000 (byte), EBS 0 (byte)
 Passed   : 0(Packets) 0(Bytes)  
 Discarded: 0(Packets) 0(Bytes)  
 Rule(s): If-match acl 3001 
 CIR 8000 (kbps), CBS 15000 (byte), EBS 0 (byte)
 Passed   : 204(Packets) 17136(Bytes)  
 Discarded: 0(Packets) 0(Bytes)  
[R1]
[R1]
[R1]