办公问答网

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 148|回复: 1

华为和H3C:一起学习如何配置流量统计

[复制链接]

1

主题

6

帖子

3

积分

新手上路

Rank: 1

积分
3
发表于 2022-9-20 09:16:38 | 显示全部楼层 |阅读模式
华为




1.创建VLAN并配置各接口。
#在switch上创建vlan20。
system-view
sysname switch
vlan 20
quit
#配置接口GE1/0/1为access类型接口,接口GE1/0/2为trunk类型接口,并将ge1/0/1和ge1/0/2加入vlan20。
interface gi 1/0/1
port link-type access
port default vlan 20
quit
interface gi 1/0/2
port link-type trunk
port trunk allow-pass vlan 20
quit
#创建vlanif20,配置IP地址10.10.10.2/24。
interface vlanif20
ip address 10.10.10.2 24
quit
2.配置router接口地址10.10.10.1/24
system-view
sysname router
interface gi 1/0/1
ip address 10.10.10.1 24
quit
3.配置ACL规则。
# 在Switch上创建编码为4000的二层ACL,匹配源MAC为0000-0000-0003的报文。
acl 4000
rule permit source-mac 0000-0000-0003 ffff-ffff-ffff
quit
4.配置流分类。
traffic classifier c1 operator and
if-match acl 4000
quit
5.配置流行为。
#在switch上创建流行为b1,并配置流量统计动作。
traffic behavior b1
statistic enable
quit
6.配置流策略并应用到接口上。
# 在Switch上创建流策略p1,将流分类和对应的流行为进行绑定。
traffic policy p1
classifier c1 behavior b1
quit
#将流策略p1应用到接口ge1/0/1。
interface gi 1/0/1
traffic-policy p1 inbound
quit
7.验证配置结果。
display acl 4000 //查看acl规则的配置信息。
display traffic classifier user-defined //查看流分类的配置信息。
display traffic policy user-defined p1 //查看流策略的配置信息。
display traffic policy statistics interface gi 1/0/1 inbound //查看流量统计信息。

H3C




1.定义基本ACL 2000,对源IP地址为1.1.1.1的报文进行分类。
system-view
acl basic 2000
rule permit source 1.1.1.1 0
quit
2.定义类classifier_1,匹配基本ACL 2000。
traffic classifier classifier_1
if-match acl 2000
quit
3.定义流行为behavior_1,动作为流量统计。
traffic behavior behavior_1
accounting
quit
4.定义策略policy,为类classifier_1指定流行为behavior_1。
qos policy policy
classifier classifier_1 behavior behavior_1
quit
5.将策略policy应用到端口gi 1/0/1的入方向上。
interface gi 1/0/1
qos apply policy policy inbound
quit
6.验证配置。
display qos policy interface gi 1/0/1 //查看配置后流量统计的情况。
文章源于网络,如有侵权,请私信文章标题联系删除,谢谢。
回复

使用道具 举报

2

主题

10

帖子

15

积分

新手上路

Rank: 1

积分
15
发表于 昨天 12:55 | 显示全部楼层
没人回帖。。。我来个吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|办公问答网

GMT+8, 2025-3-15 17:19 , Processed in 0.097426 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc. Templated By 【未来科技 www.veikei.com】设计

快速回复 返回顶部 返回列表