上網(wǎng)行為管理器,功能很強大,限速只是很簡單的入門功能而已,最重要的是,能審計用戶的上網(wǎng)行為,甚至能監(jiān)測員工的聊天記錄,并且方便地存儲到內(nèi)置硬盤,或者網(wǎng)絡(luò)中的其他服務(wù)器。
今天我們要說的可不是上網(wǎng)行為管理器,要實現(xiàn)對上網(wǎng)用戶的限速,根本不用上網(wǎng)行為管理器,正如殺雞不用牛刀一樣。
今天的任務(wù)是,利用交換機的ACL,限制VLAN的上網(wǎng)速率,且只限制工作時間的網(wǎng)速,簡易拓撲圖如下所示:
上圖中,AR1表示路由器,借用LoopBack0來模擬一下互聯(lián)網(wǎng)。
vlan batch 11 to 12
#
interface Ethernet0/0/1
port link-type access
port default vlan 11
#
interface Ethernet0/0/2
port link-type access
port default vlan 12
#
interface Ethernet0/0/3
port link-type trunk
port trunk allow-pass vlan all
配置子接口終結(jié)VLAN
interface GigabitEthernet0/0/0.1
dot1q termination vid 11
ip address 192.168.11.2 255.255.255.0
arp broadcast enable
#
interface GigabitEthernet0/0/0.2
dot1q termination vid 12
ip address 192.168.12.2 255.255.255.0
arp broadcast enable
#
配置LoopBack0的IP地址,模擬互聯(lián)網(wǎng)
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
配置OSPF
ospf 1
area 0.0.0.0
network 1.1.1.1 0.0.0.0
network 192.168.11.2 0.0.0.0
network 192.168.12.2 0.0.0.0
vlan batch 11 to 12
#
dhcp enable
#
interface Vlanif11
ip address 192.168.11.1 255.255.255.0
dhcp select global
#
interface Vlanif12
ip address 192.168.12.1 255.255.255.0
dhcp select global
#
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan all
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan all
#
ip pool vlan11
gateway-list 192.168.11.1
network 192.168.11.0 mask 255.255.255.0
excluded-ip-address 192.168.11.2 192.168.11.20
dns-list 114.114.114.114
#
ip pool vlan12
gateway-list 192.168.12.1
network 192.168.12.0 mask 255.255.255.0
excluded-ip-address 192.168.12.2 192.168.12.20
dns-list 114.114.114.114
#
配置OSPF,與路由器互聯(lián)
ospf 1
area 0.0.0.0
network 192.168.11.1 0.0.0.0
network 192.168.12.1 0.0.0.0
#
創(chuàng)建周期時間段work-time,時間范圍為工作日的9:00~17:00
time-range work-time 09:00 to 17:00 working-day
#
配置ACL 2001,明確VLAN的工作時間
acl number 2001
rule 5 permit source 192.168.0.0 0.0.255.255 time-range work-time
#
配置流分類,匹配ACL 2001
traffic classifier c1
if-match acl 2001
#
配置流行為,限制上網(wǎng)速度不超過100Mbps(兩個VLAN的上網(wǎng)總速率不超過100Mbps)
traffic behavior b1
car cir 102400
statistic enable
#
配置流策略,并在接口GE0/0/1的入方向應(yīng)用該策略
traffic policy p1
classifier c1 behavior b1
#
interface g 0/0/1
traffic-policy p1 inbound
#
華為的網(wǎng)絡(luò)設(shè)備,越來越順手了,而且品質(zhì)有保障,技術(shù)支持到位,值得推薦。