目录

带宽管理配置实验

带宽管理配置实验

一、实验拓扑

https://i-blog.csdnimg.cn/direct/7d09fece596a43ae881cfb01027c22e9.png

配置流程:

1、带宽通道:整体带宽、每个用户带宽、连接数、优先级信息

2、带宽策略

3、策略+通道,引用

4、配置接口出入带宽

二、实验需求和配置

1、基础配置

接口配置

[dianxin]interface GigabitEthernet 0/0/0

[dianxin-GigabitEthernet0/0/0]ip add 12.0.0.2 24

[liantong]interface GigabitEthernet 0/0/0

[liantong-GigabitEthernet0/0/0]ip add 13.0.0.2 24

[FW]interface GigabitEthernet 1/0/0

[FW-GigabitEthernet1/0/0]ip add 12.0.0.1 24

[FW]interface GigabitEthernet 1/0/1

[FW-GigabitEthernet1/0/1]ip add 13.0.0.1 24

[FW]int g 1/0/2.10

[FW-GigabitEthernet1/0/2.10]ip add 192.168.1.254 24

[FW]interface GigabitEthernet 1/0/2.20

[FW-GigabitEthernet1/0/2.20]int g 1/0/2.30

[FW-GigabitEthernet1/0/2.30]ip add 192.168.3.254 24

[FW-GigabitEthernet1/0/2.30]int g 1/0/2.40

[FW-GigabitEthernet1/0/2.40]ip add 192.168.4.254 24

[FW]interface GigabitEthernet 1/0/3

[FW-GigabitEthernet1/0/3]ip add 10.1.1.254 24

配置VLAN并划分接口

[SW1]vlan batch 10 20 30 40

[SW1]interface GigabitEthernet 0/0/1

[SW1-GigabitEthernet0/0/1]port link-type trunk

[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30 40

[SW1]int g 0/0/2

[SW1-GigabitEthernet0/0/2]port link-type access

[SW1-GigabitEthernet0/0/2]port default vlan 10

[SW1]int g 0/0/3

[SW1-GigabitEthernet0/0/3]port link-type access

[SW1-GigabitEthernet0/0/3]port default vlan 20

[SW1]int g 0/0/4

[SW1-GigabitEthernet0/0/4]port link-type access

[SW1-GigabitEthernet0/0/4]port default vlan 30

[SW1]int g 0/0/5

[SW1-GigabitEthernet0/0/5]port link-type access

[SW1-GigabitEthernet0/0/5]port default vlan 40

划分安全区域

firewall zone untrust

set priority 5

add interface GigabitEthernet1/0/0

add interface GigabitEthernet1/0/1

firewall zone trust

set priority 85

add interface GigabitEthernet0/0/0

add interface GigabitEthernet1/0/2.10

add interface GigabitEthernet1/0/2.20

add interface GigabitEthernet1/0/2.30

add interface GigabitEthernet1/0/2.40

firewall zone dmz

set priority 50

add interface GigabitEthernet1/0/3

配置路由

[FW]ip route-static 0.0.0.0 0 12.0.0.2

[FW]ip route-static 0.0.0.0 0 13.0.0.2

配置NAT策略

nat-policy

rule name 01

source-zone trust

action source-nat easy-ip

2、带宽管理配置

需求一

企业组织架构中存在部门A,部门A中存在销售组1和研发组2:

销售部门—->Email、ERP业务

可以对部门A中的销售组进行带宽资源细分,保证销售员工的业务流量正常转发:

1、部门A中的下行最大带宽不超过60M

2、部门A的销售组下行最大带宽不超过30M

3、部门A的销售组的Email业务下行最小带宽不低于20M

分析:需求之间存在父子关系

A部门带宽通道—最大60M

部门A销售组带宽通道—最大30M

部门A销售组Email业务带宽通道—最小20M

带宽策略配置一

[FW]traffic-policy  —- 进入带宽策略配置视图

[FW-policy-traffic]profile 01    —-创建一个带宽通道,名称为01

[FW-policy-traffic-profile-01]bandwidth maximum-bandwidth whole downstream 60000   —-设定带宽,最大带宽,下行60M

[FW]traffic-policy

[FW-policy-traffic]display this

rule name 01      —-策略名称

description A

source-zone trust

destination-zone untrust

source-address 192.168.1.0 mask 255.255.255.0

source-address 192.168.2.0 mask 255.255.255.0

action qos profile 01        —-动作为限流,且调用带宽通道

https://i-blog.csdnimg.cn/direct/0b369369068445b7ac2a59dc1353a71d.png

[FW]traffic-policy

[FW-policy-traffic]profile 02

[FW-policy-traffic-profile-02]bandwidth maximum-bandwidth whole downstream 30000

[FW]traffic-policy

[FW-policy-traffic]display this

rule name 02 parent 01

description A_xiaoshou

source-zone trust

destination-zone untrust

source-address 192.168.1.0 mask 255.255.255.0

action qos profile 02

https://i-blog.csdnimg.cn/direct/89c2d273116f4b4d83816960eacdbd94.png

[FW]traffic-policy

[FW-policy-traffic]display this

profile 03

bandwidth guaranteed-bandwidth whole downstream 20000

rule name 03 parent 02

description A_xiaoshou_email

source-zone trust

destination-zone untrust

source-address 192.168.1.0 mask 255.255.255.0

action qos profile 03

https://i-blog.csdnimg.cn/direct/3be0645790404457a8027bfd738de405.png

https://i-blog.csdnimg.cn/direct/472eb2eb9c224fd5a9604eb854e915a4.png

安全策略

[FW]security-policy

[FW-policy-security]dis th

security-policy

rule name 01

description 带宽策略(01)引入

source-zone trust

destination-zone untrust

source-address 192.168.1.0 mask 255.255.255.0

source-address 192.168.2.0 mask 255.255.255.0

action permit

需求二

给部门A和部门B划分可使用的带宽资源。要避免P2P业务占据较多的带宽,还需要限制部门A和部门B使用P2P业务的带宽总和。

1、部门A下行最大带宽60M

2、部门B下行最大带宽40M

3、部门A和部门B的P2P业务下行最大带宽不超过80M

4、P2P流量需要计算到各自部门的总流量中

带宽策略配置二

带宽通道:

traffic-policy

profile 05_P2P

bandwidth reference-mode rule-shared

bandwidth maximum-bandwidth whole downstream 80000

https://i-blog.csdnimg.cn/direct/c58b512ac8894f28a487b7c26af8da52.png

[FW]traffic-policy

[FW-policy-traffic]dis th

rule name 05 parent 01

description A_P2P业务

source-zone trust

destination-zone untrust

source-address 192.168.1.0 mask 255.255.255.0

source-address 192.168.2.0 mask 255.255.255.0

application app Oracle_MySQL

action qos profile 05_P2P

rule name 04

description B

source-zone trust

destination-zone untrust

source-address 192.168.3.0 mask 255.255.255.0

source-address 192.168.4.0 mask 255.255.255.0

action qos profile 04

rule name 06 parent 04

description B_P2P业务

source-zone trust

destination-zone untrust

source-address 192.168.3.0 mask 255.255.255.0

source-address 192.168.4.0 mask 255.255.255.0

application app Oracle_MySQL

action qos profile 05_P2P

https://i-blog.csdnimg.cn/direct/993be1a67dd343b0a4f78ceea96fbba4.png

https://i-blog.csdnimg.cn/direct/a30a7813f8a34f45ac3db31db68c80ea.png https://i-blog.csdnimg.cn/direct/7c51c3228f6946fabc6b296aa5ee882e.png

https://i-blog.csdnimg.cn/direct/1e95d285efc04f6e95d8b9741118eaa4.png

需求三

在不影响正常用户上网和web服务器正常提供对外服务的情况下,实现以下功能:

1、将从ISP购买的100M带宽进行划分

上网高峰期(工作日下午3点-6点),上网用户下行带宽60M(U-T),外用用户下行带宽40M(D-U)

2、2台web服务器,限制每一台web服务器对外提供的最大下行带宽不超过20M

3、假设,总共30个上网用户,在上网高峰期,限制每个用户访问Internet的最大下行带宽不超过2M

新建时间段:

https://i-blog.csdnimg.cn/direct/08dafb07f70c48b98f3978c0d2175c65.png

带宽策略配置三

profile 06

bandwidth maximum-bandwidth whole downstream 60000

bandwidth maximum-bandwidth per-ip downstream 2000

rule name 07

description 企业上网用户策略

source-zone trust

destination-zone untrust

source-address 192.168.0.0 mask 255.255.0.0

time-range time_01

action qos profile 06

https://i-blog.csdnimg.cn/direct/29cef7f0e92e45bfb74bc0ef42dda4d6.png https://i-blog.csdnimg.cn/direct/b3802dd1067a4de4b317fc5287533947.png

profile 07

bandwidth maximum-bandwidth whole downstream 40000

bandwidth maximum-bandwidth per-ip downstream 20000

rule name 08

description 外网用户访问服务器

source-zone untrust

destination-zone dmz

destination-address 10.1.1.0 mask 255.255.255.0

action qos profile 07

https://i-blog.csdnimg.cn/direct/c64ffe846e654dce986b369426844c9b.png 需求四

部门A的上网用户数量不固定,为了让用户公平的使用带宽,根据实际在线上网用户数量,平均分配带宽:

1、部门A的下行最大带宽60M

2、根据实时的上网用户数量,对部门A的60M带宽资源进行均分

动态均分功能:在配置了整体最大带宽的前提下,FW根据在线IP/用户的个数和带宽使用率,动态的对每一个IP/用户能够使用的最大带宽进行平均分配

计算方式: 每个IP/用户最大带宽=MAX(带宽最小值,整体最大带宽/IP用户数*平均分配系数)

带宽通道:

profile 08

bandwidth maximum-bandwidth whole downstream 60000

bandwidth average per-ip manual multiplier 1 minimum 1000

https://i-blog.csdnimg.cn/direct/71591d46d8b74aa7b993a2a7835b881c.png

平均分配系数—-与带宽使用率存在反比关系

0                <70%

1                70-75%

2                75-80%

3

4

带宽策略配置四

rule name 09

description A_用户带宽分配

source-zone trust

destination-zone untrust

source-address 192.168.1.0 mask 255.255.255.0

source-address 192.168.2.0 mask 255.255.255.0

action qos profile 08

https://i-blog.csdnimg.cn/direct/62d83389c9424b0d8b54a67a027132e5.png 需求五

设定出入接口带宽:

电信购买带宽100M

联通购买带宽50M

https://i-blog.csdnimg.cn/direct/339f91ab96094025a1ac726e35780c7f.png

https://i-blog.csdnimg.cn/direct/13af6da8dadc464e82d857f6ec3b83c5.png

需求六–配额策略

运营商—>流量套餐—>对中小企业500G/月,超出部分,额外计费

限额—>每一个员工规定上网时长

1、员工40人,10名管理人员+30名牛马

高管–>20G/月

牛马–>10G/月

2、牛马—>4h/日,流量500M/日

3、超额后限制

牛马—>禁止上网

高管—>超过配额后最大带宽限定为800K

https://i-blog.csdnimg.cn/direct/2cbf297b50d94b5f885f7cc0d3da2894.png

[FW]quota-policy       —-进入配额策略视图

[FW-policy-quota]profile niuma          —–创建配额通道

[FW-policy-quota-profile-niuma]stream-daily 500     —–每日流量限额

[FW-policy-quota-profile-niuma]stream-monthly 10240        —-每月流量配额

[FW-policy-quota-profile-niuma]time-daily 240      ——设定上网时长

[FW-policy-quota-profile-niuma]limit-bandwidth 0     —–超出配额后的限制带宽为0

[FW-policy-quota]rule name niuma

[FW-policy-quota-rule-niuma]user user-group /default/niuma   —–策略应用用户

[FW-policy-quota-rule-niuma]action quota profile niuma

https://i-blog.csdnimg.cn/direct/e9820e60b2644a1f94f02b39ffc55c68.png

quota-policy

profile gaoguan

stream-monthly 20480

limit-bandwidth 800

rule name gaoguan

description 高管

user user-group /default/gaoguan

action quota profile gaoguan

https://i-blog.csdnimg.cn/direct/856e544156084e789f6ba055836141e4.png

需求七—流量整形和流量监管

无法在web界面实现

流量监管:对进入接口的,超出限制速率的报文进行丢弃。

流量整形:对接口发送的,超出限制速率的报文先进行缓存,等待流量不超出速率时发送。