思科企業級路由器提供 ACL、Rate-limit、NBAR/PDLM 多層次流控手段,可精準識別並限制/封鎖 P2P 流量。以下為實戰配置指南 (整理自原文技術細節)。
企業核心閘道需管控 BT、電驢、迅雷等 P2P 流量,防止佔滿頻寬影響業務。傳統 ACL 封埠易被動態換埠繞過,需引入 NBAR 應用層識別。
access-list 130 remark bt
access-list 130 permit tcp any any range 6881 6890
access-list 130 permit tcp any range 6881 6890 any
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
針對 BT 傳統埠 6881-6890 進行速率限制 (CIR 712kbps)。
access-list 130 deny tcp any any range 6881 6890
access-list 130 deny tcp any range 6881 6890 any
ip access-group 130 in
ip access-group 130 out
缺點:現代 P2P 動態換埠 (8000/8080/2070 等),封鎖常用埠會誤傷正常業務。
NBAR (Network-Based Application Recognition) 可深度檢測 L4-L7 協議特徵,不依賴埠號。PDLM 為協議特徵庫檔。
bittorrent.pdlm、kazaa2.pdlm、emonkey.pdlm。copy tftp://server/bittorrent.pdlm flash:bittorrent.pdlmip nbar pdlm flash:bittorrent.pdlmclass-map match-all BITTORRENT
match protocol bittorrentpolicy-map BITTORRENT_POLICY
class BITTORRENT
police cir 512000 bc 8000 be 8000 conform-action transmit exceed-action drop
! 或直接 dropinterface FastEthernet0/0
description Internal_Interface
ip address 192.168.0.1 255.255.255.0
ip nat inside
service-policy input BITTORRENT_POLICY
service-policy output BITTORRENT_POLICY掌握 ACL→Rate-limit→NBAR/PDLM 進階路徑,即可應對從簡單埠號封鎖到複雜應用識別的各類企業級流控需求。