当前位置:首页>微思动态 > >详情
全国热线电话 400-881-4699

在线留言

【分享案例】流量监管典型配置

发布作者:微思网络   发布时间:2022-06-21   浏览量:0

1

配置需求

  1. 设备Device A通过接口GigabitEthernet1/0/3和设备Device B的接口GigabitEthernet1/0/1互连

  2. Server、Host A、Host B可经由Device A和Device B访问Internet

  3. Server、Host A与Device A的GigabitEthernet1/0/1接口在同一网段

  4. Host B与Device A的GigabitEthernet1/0/2接口在同一网段


要求在设备Device A上对接口GigabitEthernet1/0/1接收到的源自Server和Host A的报文流分别实施流量控制如下:

  1. 来自Server的报文流量约束为10240kbps,流量小于10240kbps时可以正常发送,流量超过10240kbps时则将违规报文的优先级设置为0后进行发送;

  2. 来自Host A的报文流量约束为2560kbps,流量小于2560kbps时可以正常发送,流量超过2560kbps时则丢弃违规报文;


对设备Device B的GigabitEthernet1/0/1和GigabitEthernet1/0/2接口收发报文有如下要求:

  1. Device B的GigabitEthernet1/0/1接口接收报文的总流量限制为20480kbps,如果超过流量限制则将违规报文丢弃;

  2. 经由Device B的GigabitEthernet1/0/2接口进入Internet的报文流量限制为10240kbps,如果超过流量限制则将违规报文丢弃。




组网图



图片
4-5 流量监管配置组网图




配置步骤



(1)      配置设备Device A

# 配置ACL规则列表,分别匹配来源于Server和Host A的报文流。

<DeviceA> system-view
[DeviceA] acl basic 2001
[DeviceA-acl-ipv4-basic-2001] rule permit source 1.1.1.1 0
[DeviceA-acl-ipv4-basic-2001] quit
[DeviceA] acl basic 2002
[DeviceA-acl-ipv4-basic-2002] rule permit source 1.1.1.2 0
[DeviceA-acl-ipv4-basic-2002] qui

# 创建流分类server,匹配Server发出的报文流。
[DeviceA] traffic classifier server
[DeviceA-classifier-server] if-match acl 2001
[DeviceA-classifier-server] qui

# 创建流分类host,匹配Host发出的报文流。
[DeviceA] traffic classifier host
[DeviceA-classifier-host] if-match acl 2002
[DeviceA-classifier-host] qui

# 创建流行为server,动作为流量监管,cir为10240kbps,对超出限制的报文(红色报文)将其DSCP优先级设置为0后发送。
[DeviceA] traffic behavior server
[DeviceA-behavior-server] car cir 10240 red remark-dscp-pass 0
[DeviceA-behavior-server] qui

# 创建流行为host,动作为流量监管,cir为2560kbps,由于默认对红色报文的处理方式就是丢弃,因此无需配置。
[DeviceA] traffic behavior host
[DeviceA-behavior-host] car cir 2560
[DeviceA-behavior-host] qui

# 创建QoS策略,命名为car,将流分类server和流行为server进行关联;将流分类host和流行为host进行关联。
[DeviceA] qos policy car
[DeviceA-qospolicy-car] classifier server behavior server
[DeviceA-qospolicy-car] classifier host behavior host
[DeviceA-qospolicy-car] qui

# 将QoS策略car应用到接口GigabitEthernet1/0/1的入方向上。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] qos apply policy car inboun


(2)      配置设备Device B

# 配置高级ACL3001,匹配HTTP报文。

<DeviceB> system-view
[DeviceB] acl advanced 3001
[DeviceB-acl-adv-3001] rule permit tcp destination-port eq 80
[DeviceB-acl-adv-3001] qui

# 创建流分类http,匹配ACL 3001。
[DeviceB] traffic classifier http
[DeviceB-classifier-http] if-match acl 3001
[DeviceB-classifier-http] quit

# 创建流分类class,匹配所有报文。

[DeviceB] traffic classifier class
[DeviceB-classifier-class] if-match any
[DeviceB-classifier-class] quit

# 创建流行为car_inbound,动作为流量监管,cir为20480kbps,由于默认对红色报文的处理方式就是丢弃,因此无需配置。

[DeviceB] traffic behavior car_inbound
[DeviceB-behavior-car_inbound] car cir 20480
[DeviceB-behavior-car_inbound] quit

# 创建流行为car_outbound,动作为流量监管,cir为10240kbps。

[DeviceB] traffic behavior car_outbound
[DeviceB-behavior-car_outbound] car cir 10240
[DeviceB-behavior-car_outbound] quit

# 创建QoS策略,命名为car_inbound,将流分类class和流行为car_inbound进行关联。

[DeviceB] qos policy car_inbound
[DeviceB-qospolicy-car_inbound] classifier class behavior car_inbound
[DeviceB-qospolicy-car_inbound] quit

# 创建QoS策略,命名为car_outbound,将流分类http和流行为car_outbound进行关联。

[DeviceB] qos policy car_outbound
[DeviceB-qospolicy-car_outbound] classifier http behavior car_outbound
[DeviceB-qospolicy-car_outbound] quit

# 将QoS策略car_inbound应用到接口GigabitEthernet1/0/1的入方向上。

[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] qos apply policy car_inbound inbound

# 将QoS策略car_outbound应用到接口GigabitEthernet1/0/2的出方向上。

[DeviceB] interface gigabitethernet 1/0/2
[DeviceB-GigabitEthernet1/0/2] qos apply policy car_outbound outboun


IP限速配置举例


配置需求

要求在设备Device上对接口GigabitEthernet1/0/2接收到的报文流进行限速:对HostA~HostZ(源地址属于IP地址段2.1.1.1~2.1.1.100)进行IP限速,逐IP地址流量限速5kbps,网段内各IP地址的流量共享剩余带宽。


组网图

图片
4-6 IP限速配置组网图



配置步骤

在接口GigabitEthernet1/0/2上对源地址属于IP地址段2.1.1.12.1.1.100内所有PC进行限速,网段内各IP地址的流量共享剩余带宽。

<Device> system-view
[Device] qos carl 1 source-ip-address range 2.1.1.1 to 2.1.1.100 per-address shared-bandwidth
[Device] interface gigabitethernet 1/0/2
[Device-GigabitEthernet1/0/2] qos car inbound carl 1 cir 500 cbs 1875 ebs 0 green pass red discard
[Device-GigabitEthernet1/0/2] qui




返回顶部