案例配置拓扑:
2 案例配置需求
1、 根据拓扑配置IP,
2、 在五台路由器之间运行OSPF协议,发布直连网段和环回口;
3、 在R3上配置,优先保证1.1.1.1去往4.4.4.4的流量即使在拥塞时也能有100K的带宽;
4、 在R3上配置,使得1.1.1.1去往4.4.4.4的流量带宽不会超过100K;
5、 在R3上配置,为2.2.2.2去往5.5.5.5的流量保证带宽100K;
6、 在R3上配置,对于没有匹配的流量,进行整形,CIR为80K,Be和Bc为1000;
案例配置思路
1.根据拓扑配置IP地址
R1:
interface Loopback0
ip address 1.1.1.1 255.255.255.0
ip ospf network point-to-point
interface Serial1/1
ip address 13.1.1.1 255.255.255.0
serial restart-delay 0
R2:
interface Loopback0
ip address 2.2.2.2 255.255.255.0
ip ospf network point-to-point
interface Serial1/2
ip address 23.1.1.1 255.255.255.0
R3:
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface Serial1/1
ip address 13.1.1.2 255.255.255.0
interface Serial1/2
ip address 23.1.1.2 255.255.255.0
interface Serial1/4
ip address 34.1.1.2 255.255.255.0
interface Serial1/5
ip address 35.1.1.2 255.255.255.0
R4:
interface Loopback0
ip address 4.4.4.4 255.255.255.0
ip ospf network point-to-point
interface Serial1/4
ip address 34.1.1.1 255.255.255.0
R5:
interface Loopback0
ip address 5.5.5.5 255.255.255.0
ip ospf network point-to-point
interface Serial1/5
ip address 35.1.1.1 255.255.255.0
2.配置OSPF协议
R1:
router ospf 100
router-id 91.1.1.1
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 13.1.1.0 0.0.0.255 area 0
R2:
router ospf 100
router-id 92.2.2.2
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
R3:
router ospf 100
router-id 93.3.3.3
log-adjacency-changes
network 13.1.1.0 0.0.0.255 area 0
network 23.1.1.0 0.0.0.255 area 0
network 34.1.1.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
R4:
router ospf 100
router-id 94.4.4.4
log-adjacency-changes
network 4.4.4.0 0.0.0.255 area 0
network 34.1.1.0 0.0.0.255 area 0
R5:
router ospf 100
router-id 95.5.5.5
log-adjacency-changes
network 5.5.5.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
3.在R3上配置CBWFQ:
access-list 100 permit ip host 1.1.1.1 host 4.4.4.4
access-list 101 permit ip host 2.2.2.2 host 5.5.5.5
!
class-map match-all 1-4
match access-group 100
class-map match-all 2-5
match access-group 101
!
policy-map MQC
class 1-4
priority 100 /设置为优先队列,保证带宽100K/
police 100000 /做流量管制,CIR为100K/
class 2-5
bandwidth 100 /设置带宽保证100K/
class class-default
shape average 80000 1000 1000 /做流量整形,CIR为80K/
4.在R3的所有接口:
service-policy output MQC
案例检验结果
1.配置完成后,在R3上查看CBWFQ
R3#show policy-map interface serial 1/1
Serial1/1
Service-policy output: MQC
queue stats for all priority classes:
queue limit 64 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 0/0
Class-map: 1-4 (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: access-group 100
Priority: 100 kbps, burst bytes 2500, b/w exceed drops: 0
police:
cir 100000 bps, bc 3125 bytes
conformed 0 packets, 0 bytes; actions:
transmit
exceeded 0 packets, 0 bytes; actions:
drop
conformed 0 bps, exceed 0 bps
Class-map: 2-5 (match-all)
0 packets, 0 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: access-group 101
Queueing
queue limit 64 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 0/0
bandwidth 100 kbps
Class-map: class-default (match-any)
32 packets, 2080 bytes
5 minute offered rate 0 bps, drop rate 0 bps
Match: any
Queueing
queue limit 64 packets
(queue depth/total drops/no-buffer drops) 0/0/0
(pkts output/bytes output) 32/2320
shape (average) cir 80000, bc 1000, be 1000
target shape rate 80000
案例总结及其它
1、 CBWFQ基于类来完成WFQ的配置;
2、 Priority和bandwidth都可以保证带宽,但是priority优先级更高,优先被硬件队列调用;
3、 Priority保证的带宽,即使拥塞时也可以保证;
4、 Bandwidth保证的带宽,在拥塞时可能被占用,未拥塞时可以超过这个设定值;
5、 所有未被class调用的流量,都在默认类中;