交换机H3c3100,version 3.10。
(0)
最佳答案
qos方式:
# 创建VLAN 20和VLAN 30。
<DeviceA> system-view
[DeviceA] vlan 20
[DeviceA-vlan20] quit
[DeviceA] vlan 30
[DeviceA-vlan30] quit
# 创建批量接口组myport,并将GigabitEthernet1/0/1~GigabitEthernet1/0/4加入批量接口组。
[DeviceA] interface range name myport interface gigabitethernet 1/0/1 to gigabitethernet 1/0/4
# 将GigabitEthernet1/0/1~GigabitEthernet1/0/4的接口类型为trunk,并允许VLAN 20和VLAN 30通过。
[DeviceA-if-range-myport] port link-type trunk
[DeviceA-if-range-myport] port trunk permit vlan 20 30
[DeviceA-if-range-myport] undo port trunk permit vlan 1
[DeviceA-if-range-myport] quit
# 创建IPv4高级ACL 3000,对源IP地址为192.168.4.0/24网段的报文进行分类。
[DeviceA] acl advanced 3000
[DeviceA-acl-ipv4-adv-3000] rule deny tcp source 192.168.4.0 0.0.0.255 source-port eq 80
[DeviceA-acl-ipv4-adv-3000] quit
# 创建流分类vlan20_http,匹配ACL 3000。
[DeviceA] traffic classifier vlan20_http
[DeviceA-classifier-vlan20_http] if-match acl 3000
[DeviceA-classifier-vlan20_http] quit
# 创建流行为vlan20_http,动作为流量过滤(deny),拒绝数据包通过。
[DeviceA] traffic behavior vlan20_http
[DeviceA-behavior-vlan20_http] filter deny
[DeviceA-behavior-vlan20_http] quit
# 创建QoS策略,命名为vlan20_http,将流分类vlan20_http和流行为vlan20_http进行关联。
[DeviceA] qos policy vlan20_http
[DeviceA-qospolicy-vlan20_http] classifier vlan20_http behavior vlan20_http
[DeviceA-qospolicy-vlan20_http] quit
# 将QoS策略vlan20_http应用到VLAN 20和VLAN 30。
[DeviceA] qos vlan-policy vlan20_http vlan 20 30 inbound
# 创建IPv4基本ACL 2000,并配置允许来自Host A和Host B的报文通过的规则。
[DeviceB] acl basic 2000
[DeviceB-acl-ipv4-basic-2000] rule permit source 192.168.4.10 0
[DeviceB-acl-ipv4-basic-2000] rule permit source 192.168.4.15 0
[DeviceB-acl-ipv4-basic-2000] quit
# 配置报文过滤的缺省动作为Deny,即禁止未匹配上ACL规则的报文通过。
[DeviceB] packet-filter default deny
# 在GigabitEthernet1/0/1接口出方向上应用ACL 2000进行报文过滤。
[DeviceB] interface gigabitethernet 1/0/1
[DeviceB-GigabitEthernet1/0/1] packet-filter 2000 outbound
# 通过display qos vlan-policy命令显示Device A上基于VLAN应用的QoS策略,查看策略是否应用成功。
[DeviceA] display qos vlan-policy vlan inbound
Vlan 20
Direction: Inbound
Policy: vlan20_http
Classifier: vlan20_http
Operator: AND
Rule(s) :
If-match acl 3000
Behavior: vlan20_http
Filter enable: Deny
Vlan 30
Direction: Inbound
Policy: vlan20_http
Classifier: vlan20_http
Operator: AND
Rule(s) :
If-match acl 3000
Behavior: vlan20_http
Filter enable: Deny
# 通过display packet-filter verbose命令显示Device B上的报文过滤情况。
[DeviceB] display packet-filter verbose interface gigabitethernet 1/0/1 outbound
Interface: GigabitEthernet1/0/1
Outbound policy:
IPv4 ACL 2000
rule 0 permit source 192.168.4.10 0
IPv4 default action: Deny
(0)
您好
# 定义周期时间段test,时间范围为工作日的8:00~18:00。
<Sysname> system-view
[Sysname] time-range test 8:00 to 18:00 working-day
# 定义高级ACL 3000,配置目的IP地址为工资服务器的访问规则。
[Sysname] acl number 3000
[Sysname-acl-adv-3000] rule 1 deny ip destination 192.168.1.2 0 time-range test
[Sysname-acl-adv-3000] quit
# 在端口Ethernet1/0/1上应用ACL 3000。
[Sysname] interface Ethernet 1/0/1
[Sysname-Ethernet1/0/1] packet-filter inbound ip-group 3000
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论