萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 網路安全 >  >> 路由器知識 >> 路由器頻寬限制

思科路由器禁止下載與限速:ACL、Rate-limit、NBAR/PDLM 完整配置指南

思科企業級路由器提供 ACL、Rate-limit、NBAR/PDLM 多層次流控手段,可精準識別並限制/封鎖 P2P 流量。以下為實戰配置指南 (整理自原文技術細節)。

背景:思科路由器發展與流控需求

企業核心閘道需管控 BT、電驢、迅雷等 P2P 流量,防止佔滿頻寬影響業務。傳統 ACL 封埠易被動態換埠繞過,需引入 NBAR 應用層識別。

一、ACL + Rate-limit (基礎埠號限速)

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)。

二、ACL 封鎖下載 (直接丟棄)

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 + PDLM (應用層識別,推薦)

NBAR (Network-Based Application Recognition) 可深度檢測 L4-L7 協議特徵,不依賴埠號。PDLM 為協議特徵庫檔。

部署步驟

  1. 從 Cisco 官網下載 PDLM:bittorrent.pdlm、kazaa2.pdlm、emonkey.pdlm。
  2. TFTP 複製至路由器:copy tftp://server/bittorrent.pdlm flash:bittorrent.pdlm
  3. 載入 PDLM:ip nbar pdlm flash:bittorrent.pdlm
  4. 建立 Class-map:
    class-map match-all BITTORRENT
    match protocol bittorrent
  5. 建立 Policy-map (限速/丟棄):
    policy-map BITTORRENT_POLICY
    class BITTORRENT
    police cir 512000 bc 8000 be 8000 conform-action transmit exceed-action drop
    ! 或直接 drop
  6. 套用至 WAN 介面:
    interface 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

延伸應用

  • 同樣流程可識別/控制:Kazaa、eMule、Skype、HTTP URL、DNS、FTP、VoIP (SIP/H.323) 等。
  • 內部廣域網介面同樣套用,保障分支機構關鍵業務頻寬。

注意事項

  • NBAR 需 IOS 12.4(4)T 以上,舊機型可能不支援。
  • PDLM 為二進位檔,需官網下載對應版本。
  • 啟用 NBAR 增加 CPU 負載,高流量環境建議評估效能或用專用服務卡。

掌握 ACL→Rate-limit→NBAR/PDLM 進階路徑,即可應對從簡單埠號封鎖到複雜應用識別的各類企業級流控需求。

copyright © 萬盛學電腦網 all rights reserved