企業(yè)網(wǎng)用戶的IP為10.0.0.2/24,通過(guò)Switch連接Internet。Switch為運(yùn)營(yíng)商設(shè)備。企業(yè)網(wǎng)用戶只租用了1Mbps的上行帶寬和2Mbps的下行帶寬。 圖1 普通CAR配置組網(wǎng)
配置思路流量監(jiān)管功能是通過(guò)QoS命令行實(shí)現(xiàn)。本案例中,用戶采用固定IP,因此可以通過(guò)匹配用戶IP地址的方法匹配用戶流量,并對(duì)其做流量監(jiān)管。
配置步驟
# 配置ACL規(guī)則匹配源IP為10.0.0.2的流量 <H3C> system-view [H3C] acl number 3001 [H3C-acl-adv-3001] rule permit ip source 10.0.0.2 0 [H3C-acl-adv-3001] quit
# 配置ACL規(guī)則匹配目的IP為10.0.0.2的流量 [H3C] acl number 3002 [H3C-acl-adv-3002] rule permit ip destination 10.0.0.2 0 [H3C-acl-adv-3002] quit
# 配置流分類,匹配ACL規(guī)則3001,即匹配源IP為10.0.0.2的流量 [H3C] traffic classifier source_hostA [
H3C-classifier-source_hostA] if-match acl 3001 [
H3C-classifier-source_hostA] quit
# 配置流分類,匹配ACL規(guī)則3002,即匹配目的IP為10.0.0.2的流量 [H3C] traffic classifier destination_hostA [
H3C-classifier-destination_hostA] if-match acl 3002 [
H3C-classifier-destination_hostA] quit
# 配置流行為,用于對(duì)上行流量進(jìn)行流量監(jiān)管,速率為1000kbps [H3C] traffic behavior uplink [H3C-behavior-uplink] car cir 1000 [H3C-behavior-uplink] quit
# 配置流行為,用于對(duì)下行流量進(jìn)行流量監(jiān)管,速率為2000kbps [H3C] traffic behavior downlink [H3C-behavior-downlink] car cir 2000 [H3C-behavior-downlink] quit
# 配置QoS策略,用于端口入方向,即用戶的上行方向 [H3C] qos policy uplink [H3C-qospolicy-uplink] classifier source_hostA behavior uplink [H3C-qospolicy-uplink] quit
# 配置QoS策略,用于端口出方向,即用戶的下行方向 [H3C] qos policy downlink [H3C-qospolicy-downlink] classifier destination_hostA behavior downlink [H3C-qospolicy-downlink] quit
# 在端口上下發(fā)QoS策略,匹配出入方向的流量 [H3C] interface GigabitEthernet 3/0/1 [H3C-GigabitEthernet3/0/1] qos Apply policy uplink inbound [H3C-GigabitEthernet3/0/1] qos apply policy downlink outbound