要得到 PDLM ,要到 http://www.cisco.com/pcgi-bin/tablebuild.pl/pdlm 下载 bittorrent.pdlm 。您需要有 CCO 的帐号。
然后通过 TFTP 服务器将 bittorrent.pdlm 拷贝到路由中。
ip nbar pdlm bittorrent.pdlm
命令将 NBAR 中的 BT 功能启动。
再创建一个 class-map 和 policy map 并且把它应用到相应的路由器 的接口上。一般是 连接 Internet (Chinanet ) 的接口是 FastEthernet 或 10M 的以太网接口。在路由器 上您可以看见如下的配置 :
class-map match-all bittorrent
match protocol bittorrent
!
!
policy-map bittorrent-policy
class bittorrent
drop
!
interface FastEthernet0/
description neibujiekou
ip address 192.168.0.1 255.255.255.0
ip nat inside
service-policy input bittorrent-policy
service-policy output bittorrent-policy
!
实例:
Cisco (config)#ip cef
Cisco(config)#ip nbar pdlm bittorrent.pdlm
Cisco(config)#class-map match-any DenyBT-class
Cisco(config-cmap)#description DenyBT
Cisco(config-cmap)#match protocol bittorrent
Cisco(config-cmap)end
Cisco(config)#policy-map DenyBT-policy
Cisco(config-pmap)#class DenyBT-class
Cisco(config-pmap-c)#drop
Cisco(config-pmap-c)#en
Cisco(config)#interface e 0/1
Cisco(config-if)#service-policy input DenyBT-policy
NBAR (Network-Based Application Recognition) 的意思是网络应用识别。 NBAR 是一种动态能在四到七层寻找协议的技术,它不但能做到普通 ACL 能做到那样控制静态的、简单的网络应用协议 TCP/UDP 的端口号。例如我们熟知的 WEB 应用使用的 TCP 80 ,也能做到控制一般 ACLs 不能做到动态的端口的那些协议,例如 VoIP 使用的 H.323, SIP 等。