不同廠牌路由器限速邏輯迥異。本文聚焦 Cisco 路由器,提供NBAR 應用識別深度封鎖 P2P與ACL 基礎埠口限速兩套互補方案。
原理: NBAR (Network-Based Application Recognition) 能動態檢測 L4-L7 協定特徵,不依賴固定埠口。PDLM (Packet Description Language Module) 為 NBAR 提供具體協定描述檔 (如 bittorrent.pdlm, emule.pdlm, kazaa2.pdlm),可從 Cisco 官網下載。
copy tftp://server/bittorrent.pdlm flash:ip nbar pdlm flash:bittorrent.pdlmclass-map match-all bittorrent
match protocol bittorrentpolicy-map bittorrent-policy
class bittorrent
drop (或 police 限速)interface FastEthernet0/0
service-policy input bittorrent-policy
service-policy output bittorrent-policy同樣適用於企業專線 WAN 介面,保障關鍵業務頻寬。
BT 傳統使用 6881-6890 埠口範圍。雖新版 BT 客戶端多動態隨機埠,但結合 NBAR 可形成纵深防禦。
access-list 130 deny tcp any any range 6881 6890
access-list 130 deny tcp any range 6881 6890 any
interface FastEthernet0/0
ip access-group 130 in
ip access-group 130 out
access-list 130 remark bt-traffic
access-list 130 permit tcp any any range 6881 6890
access-list 130 permit tcp any range 6881 6890 any
! 限制為 712kbps (約 700Kbps),突發 8000 bytes
rate-limit input access-group 130 712000 8000 8000 conform-action transmit exceed-action drop
rate-limit output access-group 130 712000 8000 8000 conform-action transmit exceed-action drop
show policy-map interface 觀察匹配統計,根據實際流量調整限速閾值。掌握 Cisco NBAR + ACL 組合拳,讓頻寬管理從「堵」轉向「疏」,精準保障業務體驗。