组网需求

如图所示,企业内部用户通过交换机连接到RouterA的Eth2/0/0,并通过RouterA的GE0/0/1接口连接到WAN侧网络。
现在要求在RouterA上通过配置基于智能应用控制SAC(Smart Application Control)的流分类,禁止企业用户进行BT下载。
操作步骤
RouterA的配置
#
sysname RouterA
#
vlan batch 20
#
sac enable signature sd1:/sacrule.dat //使能SAC功能,并加载特征库文件
#
traffic classifier c1 operator or //创建流分类c1
if-match app-protocol bittorrent //匹配BT应用协议
#
traffic behavior b1 //创建流行为b1
deny //禁止匹配指定规则的报文流通过
#
traffic policy p1 //创建流策略p1
classifier c1 behavior b1 //将流分类和对应的流行为进行绑定
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
sac protocol-statistic enable //使能接口基于SAC的流量统计功能
traffic-policy p1 inbound //将流策略p1应用到接口入方向
#
interface Ethernet2/0/0
port link-type trunk //配置接口的链路类型为Trunk
port trunk allow-pass vlan 20 //配置Trunk类型接口加入vlan 20
#
interface GigabitEthernet0/0/1
ip address 192.168.4.1 255.255.255.0
sac protocol-statistic enable //使能接口基于SAC的流量统计功能
traffic-policy p1 inbound //将流策略p1应用到接口入方向
#
检查配置结果
执行display sac protocol-statistic protocol检查Eth2/0/0和GE0/0/1接口上基于不同SAC应用协议的报文统计信息,可以看到接口下Inbound方向可能会有BT数据流,但是Outbound方向没有BT数据流,说明Eth2/0/0和GE0/0/1接口收到的BT数据流都被丢弃,不会再被转发。

如图所示,企业内部用户通过交换机连接到RouterA的Eth2/0/0,并通过RouterA的GE0/0/1接口连接到WAN侧网络。
现在要求在RouterA上通过配置基于智能应用控制SAC(Smart Application Control)的流分类,禁止企业用户进行BT下载。
操作步骤
RouterA的配置
#
sysname RouterA
#
vlan batch 20
#
sac enable signature sd1:/sacrule.dat //使能SAC功能,并加载特征库文件
#
traffic classifier c1 operator or //创建流分类c1
if-match app-protocol bittorrent //匹配BT应用协议
#
traffic behavior b1 //创建流行为b1
deny //禁止匹配指定规则的报文流通过
#
traffic policy p1 //创建流策略p1
classifier c1 behavior b1 //将流分类和对应的流行为进行绑定
#
interface Vlanif20
ip address 192.168.2.1 255.255.255.0
sac protocol-statistic enable //使能接口基于SAC的流量统计功能
traffic-policy p1 inbound //将流策略p1应用到接口入方向
#
interface Ethernet2/0/0
port link-type trunk //配置接口的链路类型为Trunk
port trunk allow-pass vlan 20 //配置Trunk类型接口加入vlan 20
#
interface GigabitEthernet0/0/1
ip address 192.168.4.1 255.255.255.0
sac protocol-statistic enable //使能接口基于SAC的流量统计功能
traffic-policy p1 inbound //将流策略p1应用到接口入方向
#
检查配置结果
执行display sac protocol-statistic protocol检查Eth2/0/0和GE0/0/1接口上基于不同SAC应用协议的报文统计信息,可以看到接口下Inbound方向可能会有BT数据流,但是Outbound方向没有BT数据流,说明Eth2/0/0和GE0/0/1接口收到的BT数据流都被丢弃,不会再被转发。