NBAR
基於網絡的應用程序識別(NBAR)可以對使用動態分配TCP/UDP端口號的應用程序和HTTP流量等進行分類
1、啓動CEF
2、流量分類class map
3、設置policy map
5、調用class map
6、設置策略
7、把策略應用在接口上
加載相應文件文件到路由器flash
copy tftp flash pdlm文件自制到flash中
ip nbar pdlm flash://bittorrent.pdlm
ip cef
class-map name1
match protocol bittorrent
match protocol edonkey
exit
policy-map name2
class name1
drop
exit
int f0/1
service-policy input name2
用NBAR對進站的HTTP流量下載進行限速,其中凡是下載的圖象格式jpg,jpeg,gif速率爲100kbps,配置如
ip cef
class-map match-any name1(match all隨便一條,都要匹配上)
match protocol http url "*.jpeg|*.jpg"
match protocol http url "*.gif"
exit
policy-map name2
class name1
police 100000 conform-action transmit exceed-action drop
exit
int f0/1
service-policy input name2
使用NBAR對網絡流量做協議分析統計
int f0/1
ip nbar protocol-discovery
show ip nbar protocol-discovery top-n 5