交换机配置 ACL策略流 策略路由+NQA联动
- 在SwitchA上配置NQA测试例 管理员名为user 实例名为test
[SwitchA] nqa test-instance user test
[SwitchA-nqa-user-test] test-type icmp
[SwitchA-nqa-user-test] destination-address ipv4 10.1.30.1
[SwitchA-nqa-user-test] source-address ipv4 10.1.30.2
[SwitchA-nqa-user-test] frequency 3
[SwitchA-nqa-user-test] probe-count 2
[SwitchA-nqa-user-test] interval seconds 1
[SwitchA-nqa-user-test] timeout 1
[SwitchA-nqa-user-test] start now
[SwitchA-nqa-user-test] quit
- 配置ACL规则
# 在SwitchA上创建编码为3001的高级ACL,规则为允许源IP地址为192.168.101.0/24的报文通过。
[SwitchA] acl 3001 [SwitchA-acl-adv-3001] rule permit ip source 192.168.101.0 0.0.0.255 [SwitchA-acl-adv-3001] quit
- 配置流分类
在SwitchA上创建流分类c1,匹配规则分别为ACL 3001。
[SwitchA] traffic classifier c1 operator or [SwitchA-classifier-c1] if-match acl 3001 [SwitchA-classifier-c1] quit
- 配置流行为
# 在SwitchA上创建流行为b1,指定重定向到10.1.30.1的动作,并联动NQA测试例。
[SwitchA] traffic behavior b1 [SwitchA-behavior-b1] redirect ip-nexthop 10.1.30.1 track-nqa user test [SwitchA-behavior-b1] quit
- 配置流策略并应用到接口上
# 在SwitchA上创建流策略p1,将流分类和对应的流行为进行绑定。
[SwitchA] traffic policy p1 [SwitchA-trafficpolicy-p1] classifier c1 behavior b1 [SwitchA-trafficpolicy-p1] quit
# 将流策略p1应用到接口GE2/0/1的入方向上。
[SwitchA] interface gigabitethernet 2/0/1 [SwitchA-GigabitEthernet2/0/1] traffic-policy p1 inbound [SwitchA-GigabitEthernet2/0/1] return
先配置acl规则
然后配置 流规则 traffic classifier c1 operator or 规则为与、或 and 则需要所有下方规则匹配才算匹配 or 只要下方一条匹配就匹配
然后配置 流行为 traffic behavior b1 流行为 为匹配流规则后的操作行为
然后配置流策略 traffic policy 流策略将流规则与流行为进行绑定
最后应用与接口 使流策略生效